Hi all,
Im really bad at scripting, i can never seem to understand it. So i was hoping you could help me out.
Im after a script that i think may be a bit complex. I would like this to be toggled on/off with the F7 key.
While it is toggled on i need it to do 2 different things.
the first is to constantly hold down the right trigger on an xbox one controller
the second is to press the A button on the xbox one controller once, randomly between 10 and 30 second. i need it to keep doing this till the script is toggled off.
and lastly i need this to be sent to a target window as well, even if its minimized or in the background.
I have managed to worked out setting this "settitlematchmode,2" and then added "-WINDOWNAME" sends the script command to a window. But im at a loss on how to do the rest.
Please can someone help me out. I have spent the last hour trying to work it out and so far all i have is that tiny bit of code.
Thanks Joe.
Help with script (timing & toggled loop)
-
- Posts: 6
- Joined: 25 Apr 2019, 08:20
Re: Help with script (timing & toggled loop)
To toggle something on/off, I recommend using SetTimer. In this format:
Then, find what key your xBox One Controller is for the right trigger, and just use this format:
where "key" = the key you need to change it out with.
Same would be true for pressing the "A" key.
To get a random number, use the 'random' command.
And to send things to the target window, use controlclick/controlsend.
G'luck Joe.
Code: Select all
count := 0
x::SetTimer, label, % (toggle := !toggle) ? 50 : "Off"
label:
ToolTip, % "AutoHotKey: " ++count
return
Code: Select all
send {key down}
Same would be true for pressing the "A" key.
To get a random number, use the 'random' command.
Code: Select all
random, outvar, min, max
G'luck Joe.
-
- Posts: 6
- Joined: 25 Apr 2019, 08:20
Re: Help with script (timing & toggled loop)
Hi thanks for taking the time to give me some help. But im afraid after reading that im more lost then ever.
So for the loop where would i set the key that starts and stops it, also does the rest of the script go with in the loop or after it?
As for finding out the key for what the Xbox Controllers are i dont know how to do that, i did a google search but nothing seemed to tell me.
So for the loop where would i set the key that starts and stops it, also does the rest of the script go with in the loop or after it?
As for finding out the key for what the Xbox Controllers are i dont know how to do that, i did a google search but nothing seemed to tell me.
-
- Posts: 6
- Joined: 25 Apr 2019, 08:20
Re: Help with script (timing & toggled loop)
Can someone please provide some more help? im still struggling with this.
Who is online
Users browsing this forum: Google [Bot], QrJuicy and 75 guests