send bug with high variables Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alialmans
Posts: 3
Joined: 17 May 2021, 15:58

send bug with high variables

17 May 2021, 16:15

Was toying around on my first day of learning, wrote a script that lists off combinations of letters and numbers, but at higher values it inexplicably started malfunctioning

(here's the code)

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^q::
Myvar := 0
loop, 10000 {
send, {!}AA
if(myvar<10)
send, 0
if(myvar<100)
send, 0
if(myvar<1000)
send, 0
send, %Myvar% {enter}
Myvar:=Myvar+1
}
return
(everything in notepad)

at first everything went well, but at some point it started slipping up, the mistakes always came in groups and the frequency of appearance of these groups rose as far as I can tell, the mistakes were slightly different each time I ran the script

here's an example

Code: Select all

!AA8764 
!AA8765 
!AA8766 
!AA8767 
!AA8768 
!*&
*&&) 
!AA8771 
!AA*&!A*
!AA8774 
!AA*
&&& 
!AA8778& !!*&*! 
!AA878a8838** !AA8786 
!AA878 AA* !A*!AA8790 
!AA879
AA88!AA8794 
!AA8795 
8796 
!AA8797 
!AA8798 
!AA8799 
!AA8800
Last edited by gregster on 17 May 2021, 17:19, edited 1 time in total.
Reason: codebox/[code] tags fixed. Topic moved to 'Ask For Help'.
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: send bug with high variables

17 May 2021, 18:40

How about if you use SendEvent instead of SendInput?
Alialmans
Posts: 3
Joined: 17 May 2021, 15:58

Re: send bug with high variables

18 May 2021, 06:25

mikeyww wrote:How about if you use SendEvent instead of SendInput?
makes no noticable difference
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: send bug with high variables

18 May 2021, 07:07

Huh. I did see your issue when I tried SendInput-- perhaps a Windows buffering issue, though I'm not sure-- but when I used SendEvent, I had no trouble; I let it run up to 1000. Others might know more here.
Alialmans
Posts: 3
Joined: 17 May 2021, 15:58

Re: send bug with high variables

18 May 2021, 15:02

mikeyww wrote: Huh. I did see your issue when I tried SendInput-- perhaps a Windows buffering issue, though I'm not sure-- but when I used SendEvent, I had no trouble; I let it run up to 1000. Others might know more here.
oh, for me the issue never appeared up to 1000, it was always a few thousand in
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: send bug with high variables

19 May 2021, 08:15

I ran it to the end-- no problems. You could post your revised script here.
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: send bug with high variables  Topic is solved

19 May 2021, 09:18

Hallo,
here:
!AA0623
!AA0624
!AA06a20
a2
a62001!= A&§§
§$!A03A§!
Notepad seems to have a limited input buffer. When this gets overfilled it goes crazy. Therefore the Sleep, 50:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
^q::
Myvar := 0
loop, 1000
{
	Send,% "{Text}" Format("!AA{:04}`n", Myvar++)
	Sleep, 50
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Lamron750, nacken012, septrinus and 242 guests