casio Posted April 20, 2008 Posted April 20, 2008 hi im new in this and i want to know if with autoit can be make a scrip which send a key, for example 2, indefinitely, all the time sending the key "2" but with a timer, for example every 40 s. Is it possible?how? thanks and sorry for my question its too "nooby" but i just started with a3
monoceres Posted April 20, 2008 Posted April 20, 2008 (edited) Now that is simple: while 1 Send("2") Sleep(40000) WEnd And for your future scripting experience, read the entire Language Reference in the help file. It will get you some of the basic concepts of programming! Edited April 20, 2008 by monoceres Broken link? PM me and I'll send you the file!
qazwsx Posted April 20, 2008 Posted April 20, 2008 (edited) Yes autoit can: While 1 send ("2") Sleep (40000) Wend Also next time make your topic title more descriptive, and show us some code that you have tried. Do you have scite yet? If not, download it and also look through the autoit helpfile. Edit: is autoit sleep in seconds? been a while Edit2: dam too slow Edited April 20, 2008 by sccrstvn93
NELyon Posted April 20, 2008 Posted April 20, 2008 Haha. Both of you are wrong While 1 Send("2") Sleep(40000) Wend
qazwsx Posted April 20, 2008 Posted April 20, 2008 ok thats wat i thought. milliseconds not seconds (or watever those are).
monoceres Posted April 20, 2008 Posted April 20, 2008 Haha. Both of you are wrong While 1 Send("2") Sleep(40000) WendNo I'm not (What do you mean by edit?) Broken link? PM me and I'll send you the file!
Valuater Posted April 20, 2008 Posted April 20, 2008 expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner, $begin HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") ;;;; Body of program would go here ;;;; While 1 Sleep(10) If $Runner Then $dif = Int(TimerDiff($begin)/1000) If $dif >= 40 Then Send("2") $begin = TimerInit() EndIf EndIf WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMe() $Runner = Not $Runner $begin = TimerInit() EndFunc w..tiamw 8)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now