Help on fixing script
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Help on fixing script
Good day to all. I'm new in scripting and i just follow the guides on this site. I made this script out of the guides here but i need some help. I'm currently playing a game where you need to press 1 to 0 in order to cast skills and all. My script is working but the problem is the order of numbers are not being followed. Once activated it randomly activated 1 then 5 then 3 and so forth.
Any help on this is appreciated. I just want it to click numbers 1 to 0 in order.
Here is my script
$F8::
Counter := 1
send 1,2,3,4,5,6,7,8,9,0
sleep 50
return
Thank you in advance
Any help on this is appreciated. I just want it to click numbers 1 to 0 in order.
Here is my script
$F8::
Counter := 1
send 1,2,3,4,5,6,7,8,9,0
sleep 50
return
Thank you in advance
Re: Help on fixing script
Remove all the commas. They identify the separation between parameters (at least before the last parameter). You don’t want to be sending commas anyway, so they shouldn’t be there in any case.
Re: Help on fixing script
Hallo,
perhaps?:
perhaps?:
Code: Select all
$F8::
Loop, 10
{ ; sends 1,2,3,4,5,6,7,8,9,0
Send,% Mod(A_Index, 10)
sleep 50
}
Return
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Re: Help on fixing script
I tried doing that in this format
1234567890
Or even
1
2
3
4
5
6
7
8
9
0
But it's still clicking random numbers
@boiler
1234567890
Or even
1
2
3
4
5
6
7
8
9
0
But it's still clicking random numbers
@boiler
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Re: Help on fixing script
@Rohwedder
Doesn't the loop will only make it repeat the script by 10 times? Or i maybe wrong. I will still try it. Thank you
Doesn't the loop will only make it repeat the script by 10 times? Or i maybe wrong. I will still try it. Thank you
Re: Help on fixing script
If you don't want a repeat:
Code: Select all
$F8:: ; sends 1,2,3,4,5,6,7,8,9,0,1,2 …
++Counter
Send,% Mod(Counter, 10)
Return
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Re: Help on fixing script
@Rohwedder
Thank you for the help and it works but somehow it's still doing random numbers. Is there any code that will make it use the numbers in order like 1 , 2 , 3 ,4 ,5 and so forth?
Thank you for the help and it works but somehow it's still doing random numbers. Is there any code that will make it use the numbers in order like 1 , 2 , 3 ,4 ,5 and so forth?
Re: Help on fixing script
it's still doing random numbers ???
There is certainly no random command built into this script! Maybe you had pressed the F8 key too long so this hotkey was triggered several times? For testing a Tooltip shows the Counter just sent:
There is certainly no random command built into this script! Maybe you had pressed the F8 key too long so this hotkey was triggered several times? For testing a Tooltip shows the Counter just sent:
Code: Select all
$F8:: ; sends 1,2,3,4,5,6,7,8,9,0,1,2 …
++Counter
Send,% Counter := Mod(Counter, 10)
ToolTip,% Counter
KeyWait, F8
ToolTip
Return
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Re: Help on fixing script
@Rohwedder
Yes it still does random numbers. i just pressed it once and it does random starting from 1 then 5 then 6 sometimes it starts with 9 then random again.
Should i just copy and paste every code there or do i need to remove anything?
Yes it still does random numbers. i just pressed it once and it does random starting from 1 then 5 then 6 sometimes it starts with 9 then random again.
Should i just copy and paste every code there or do i need to remove anything?
Re: Help on fixing script
Maybe the variable Counter is changed by another part of your script. I have renamed it:
Code: Select all
$F8:: ; sends 1,2,3,4,5,6,7,8,9,0,1,2 …
++F8Counter
Send,% F8Counter := Mod(F8Counter, 10)
ToolTip,% F8Counter
KeyWait, F8
ToolTip
Return
-
- Posts: 6
- Joined: 06 Dec 2022, 11:42
Re: Help on fixing script
@Rohwedder
I will try this new code. Thank you once again for your help
I will try this new code. Thank you once again for your help