Unc3nZureD Posted June 23, 2010 Share Posted June 23, 2010 (edited) hi. i've got a simple script. I think the source is good but it don't want to work. (some errors are posible) so the script: expandcollapse popupmsgbox(0, "Help", "Hotkeys:" & @CRLF & " " & @CRLF & "F1 - RPGmenu" & @CRLF & "F2 - RTV" & @CRLF & "F3 - RPGrank" & @CRLF & "F6 - Votekick" & @CRLF & "F5 - Voteban" & @CRLF & "Esc - Exit script") HotKeySet("{ESC}", "Terminate") HotKeySet("{F1}", "rpgmenu") HotKeySet("{F2}", "RTV") HotKeySet("{F3}", "rpgrank") HotKeySet("{F5}", "votekick") HotKeySet("{F6}", "voteban") Func rpgmenu() Send("{y}") sleep(200) Send("rpgmenu") Send("{ENTER}") EndFunc Func RTV() Send("{y}") sleep(200) Send("rtv") Send("{ENTER}") EndFunc Func rpgrank() Send("{y}") sleep(200) Send("rpgrank") Send("{ENTER}") EndFunc Func voteban() Send("{y}") sleep(200) Send("votekick") Send("{ENTER}") EndFunc Func votekick() Send("{y}") sleep(200) Send("voteban") Send("{ENTER}") EndFunc is there any error in the source? if i start it it starts for 1ms and it exit. Edited June 23, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
AlmarM Posted June 23, 2010 Share Posted June 23, 2010 Add While 1 Sleep(100) WEnd Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
jchd Posted June 23, 2010 Share Posted June 23, 2010 Your script does nothing except defining function and intercepting hotkeys you define. Place a waiting loop right after the block of HotKeySet(...) calls. While 1 Sleep(10) WEnd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 23, 2010 Author Share Posted June 23, 2010 Add While 1 Sleep(100) WEnd woohoo! ty Link to comment Share on other sites More sharing options...
nf67 Posted June 23, 2010 Share Posted June 23, 2010 (edited) You need to add a while loop so the program doesn't run through all the code immediately (and exits when done).I suggest you add it between the funcs and HotKeySets, because if you add it before there, your script will never reach HotKeySet (because it remains in the loop).(...) HotKeySet("{F5}", "votekick") HotKeySet("{F6}", "voteban") While 1 ;Optional: You could add Sleep(XXX) here so the script won't be too heavy for your memory. WEnd Func rpgmenu() Send("{y}") sleep(200) (...) Edited June 23, 2010 by nf67 Link to comment Share on other sites More sharing options...
jchd Posted June 23, 2010 Share Posted June 23, 2010 nf67, A Sleep(<something small>) is more than recommended: it's necessary to avoid hogging a core to 100% uselessly. With a small Sleep, the core usage will be low (in the few %). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
trancexx Posted June 23, 2010 Share Posted June 23, 2010 nf67,A Sleep(<something small>) is more than recommended: it's necessary to avoid hogging a core to 100% uselessly. With a small Sleep, the core usage will be low (in the few %).Just as an additional information, in this particular case sleep value doesn't have to be small at all, meaning any sleep would be good. This is due to the fact that sleeps larger than 10 are split into chunks of sleeps 10 internally by AutoIt (for it not to fall asleep). Seems. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jchd Posted June 23, 2010 Share Posted June 23, 2010 That's new to me. I'll dig further someday, thanks Trancexx (you deserve an uppercase!). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
EnderWiggin Posted June 24, 2010 Share Posted June 24, 2010 That's new to me. I'll dig further someday, thanks Trancexx (you deserve an uppercase!).Uppercase isn't always an upgrade. Proper nouns come and go but lowercase is forever. 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