I wrote a script, but it's not working.
It should work like if I type in the InputBox a number, it should sleep x minutes and then go on.
I tried it with
InputBox, Text
Sleep, %OutputVar% ** 60000
but it doesn´t work.
I also tried it with copy the right nuber in minutes and then Sleep, %Clipboard% ** 60000, but it either didn´t worked.
Pleas help, thanks
Sleep for a custom time
-
- Posts: 3
- Joined: 25 May 2019, 13:07
- Contact:
Re: Sleep for a custom time
Well, you read a variable via InputBox (in your case text), and then use some unrelated and possibly empty variable called OutputVar in the sleep command.
Also ** is the power operator, not the multiply operator, which would be simply *.
Also ** is the power operator, not the multiply operator, which would be simply *.
Code: Select all
InputBox, var
sleep, var * 1000 ; the sleep command accepts expressions; no % needed, but wouldn't hurt: sleep % var * 1000 is equivalent
msgbox % "I waited " var " seconds"
-
- Posts: 3
- Joined: 25 May 2019, 13:07
- Contact:
Re: Sleep for a custom time
Thank you for the quick answer.
My final script is finished:
Sleep, 200
InputBox, var,
Sleep, 3000
WinActivate, ahk_exe chrome.exe
Sleep, 1000
Loop, %var% {
Sleep, 10000
MouseMove, 100, 100
Sleep, 20000
MouseMove, 300, 300
Sleep, 20000
MouseMove, 800, 800
Sleep, 10000
}
ExitApp
Space::
ExitApp
My final script is finished:
Sleep, 200
InputBox, var,
Sleep, 3000
WinActivate, ahk_exe chrome.exe
Sleep, 1000
Loop, %var% {
Sleep, 10000
MouseMove, 100, 100
Sleep, 20000
MouseMove, 300, 300
Sleep, 20000
MouseMove, 800, 800
Sleep, 10000
}
ExitApp
Space::
ExitApp
Who is online
Users browsing this forum: No registered users and 99 guests