Nefarious9 Posted June 9, 2006 Share Posted June 9, 2006 anyone please give me a very simple script i cant do it myself im too noob at autoit i might aswell learn something from it anyway the script i want it to press "Z" every 0.1 sec in a loop and i want to have a "F12" hotkey to start and stop it im sure its very easy to make its short and simple but i just cant get the damn commands right i tried to do it myself Link to comment Share on other sites More sharing options...
pinkfoyd Posted June 9, 2006 Share Posted June 9, 2006 see this command :Send --------------------------------------------------------------------------------Sends simulated keystrokes to the active window.and :While...WEnd --------------------------------------------------------------------------------Loop based on an expression. Link to comment Share on other sites More sharing options...
nfwu Posted June 9, 2006 Share Posted June 9, 2006 (edited) Also See:HotKeySetSleepAlso, look at my sig for a simple tutorial on starting with AutoIt! (Credit to Valuater)#)Edit: Here is the link: http://www.autoitscript.com/forum/index.php?showtopic=21048 Edited June 9, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
BigDod Posted June 9, 2006 Share Posted June 9, 2006 Have a look at This tutorial you will learn a lot from it. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Nefarious9 Posted June 9, 2006 Author Share Posted June 9, 2006 i know all those commands but i have no idea how to structure them i get an error every time here is what i tried to do : HotKeySet ("F12" [, "Pause"] ) While WinActive("MapleStory") WEnd Sleep(100) Send ("Z") Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 9, 2006 Share Posted June 9, 2006 (edited) HI, have a start with: HotKeySet("{F11}", "_run"); change to F12 ... HotKeySet("{ESC}", "end") Global $status = 0 While 1 Sleep(10) WEnd Func _run() If $status = 0 Then $status = 1 ElseIf $status = 1 Then $status = 0 EndIf While $status Send("Z") Sleep(100) WEnd EndFunc ;==>_run Func end() Exit(0) EndFunc Edit: It isn't 100 % correct, because the sleep(100) could be a bit ... ! If you need it exactly every 100ms you should have to deal with TimerInit. So long, Mega Edited June 9, 2006 by th.meger Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 i know all those commands but i have no idea how to structure them i get an error every time here is what i tried to do : HotKeySet ("F12" [, "Pause"] ) While WinActive("MapleStory") WEnd Sleep(100) Send ("Z")Remove the "[" "]" brackets, those only show you that something (a parameter) is optional. HotKeySet ("{F12}" , "Pause") While 1;Need something here other than blank or 0 ;WinActive("MapleStory") Sleep(100) WEnd Func Pause() MsgBox(0, '', 'You made it to the pause function') EndFuncAlso use curly brackets "{" "}" around your "hotkey buttons like Fxnumber and Insert/Pause/etc.. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nfwu Posted June 9, 2006 Share Posted June 9, 2006 Time for a break down! zzz~ HotKeySet("{F12}", "_Stop") ;;If you press {F12}, it calls the function _Stop Global $notstop = 1 ;;Create a variable called $notstop. while $notstop = 1 ;;While $notstop is equal to 1, Sleep(100) ;;wait for 100 milliseconds Send("z") ;; send the z keystroke wend Exit ;;Quit application Func _Stop() ;;Control would come here if you press {F12}, because of the HotKeySet in the first line. $notstop = 0 ;;Set $notstop to 0, which would cause the while loop to terminate. EndFunc #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 9, 2006 Share Posted June 9, 2006 HI, @nfwu: Your solution has no loop. It starts only one time and then it could be stopped. That's it. But maybe that's what he/she wants. So long, Mega So, it is on you Nefarious9, to tell us, what fits your needs. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
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