Send number every second Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NextOG
Posts: 3
Joined: 23 Mar 2017, 22:19

Send number every second

23 Mar 2017, 22:30

Basically what I want is a script that every second it counts down 1 number and sends a keystroke with that number.
For example if the starting number is 50 it should do
50, 49, 48, 47, 48...., 5, 4, 3,2 ,1
Here's the code I have so far not sure if any of it would work:

Code: Select all

#Persistent
SetTimer, Counter, 60000
Return

Counter:
x = 250
while(x > 0){
Send, x.number?{enter}
x -= 1
sleep, 1000
}
Return
User avatar
boiler
Posts: 16949
Joined: 21 Dec 2014, 02:44

Re: Send number every second  Topic is solved

24 Mar 2017, 02:52

Send, %x%{Enter}

However, you have another problem. You are duplicating the action by having a timer and a while loop with a one-second sleep. Do one or the other, not both.
NextOG
Posts: 3
Joined: 23 Mar 2017, 22:19

Re: Send number every second

24 Mar 2017, 16:50

Thanks boiler! My code works now but now I was wondering if I could have a pop up box that says "enter starting x:" and I can input "30" and instead of starting at 250 it will start at 30.
NextOG
Posts: 3
Joined: 23 Mar 2017, 22:19

Re: Send number every second

25 Mar 2017, 09:21

Thank you so much Helgef my script is now complete :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, Bobak, mapcarter and 301 guests