Ford21 Posted July 16, 2005 Share Posted July 16, 2005 (edited) I hope this is the right forum to post this question. I am very new to Autoit and have written a little script. I would like it to hit the w key every 10 seconds in my script. When i run it, it kinda works, it hits w over and over non stop. I get a ton of scripts running at once to. I dont think im telling it to exit or something right. Any help would be great thanks. Hope this helps you understand, thanks for feedback guys! Run ("new1.exe") WinWaitActive ("World of Warcraft") Send ("{w}") Sleep (10000) WinCLose ("World of Warcraft") Exit Edited July 16, 2005 by Ford21 Link to comment Share on other sites More sharing options...
Valuater Posted July 16, 2005 Share Posted July 16, 2005 show us your script post it here with (no spaces) [ code ] your script here [ / code ] maybe we can help 8) Link to comment Share on other sites More sharing options...
Lord_Doominik Posted July 16, 2005 Share Posted July 16, 2005 ahhhm, i don't understand really what you want... plz post your code, than we can help you... it could be, that you use wrong commands, or a wrong loop... Link to comment Share on other sites More sharing options...
Ford21 Posted July 16, 2005 Author Share Posted July 16, 2005 Updated my code I have. Im new dont forget heh, thanks guys Link to comment Share on other sites More sharing options...
Ford21 Posted July 16, 2005 Author Share Posted July 16, 2005 Hmm ya im still having issues, any help would be great. Thank you Link to comment Share on other sites More sharing options...
Developers Jos Posted July 16, 2005 Developers Share Posted July 16, 2005 Let me guess: You called your script new1 and compiled it ... right ? SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Lord_Doominik Posted July 16, 2005 Share Posted July 16, 2005 (edited) ähm... yes, your problem is that you use the Run() function... it's much better and faster and only uses 1 file opened if you use a loop: HotkeySet("{ESC}", "Exit1") While 1 WinWaitActive ("World of Warcraft") Send ("{w}") Sleep (10000) Wend Func Exit1() WinClose ("World of Warcraft") Exit End Func Edited July 16, 2005 by Lord_Doominik Link to comment Share on other sites More sharing options...
DaleHohm Posted July 16, 2005 Share Posted July 16, 2005 You need to put your Send key in a loop so that it repeats. "While 1" creates a condition that is always true and thus an infinite loop. To stop this program, right-click on its tray icon and stop it. To do this more gracefully, read the documentation on HotKeySet and look through the forum for examples of how to create a Terminate function. Dale Run ("new1.exe") WinWaitActive ("World of Warcraft") While 1 Send ("{w}") Sleep (10000) Wend WinCLose ("World of Warcraft") Exit Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Lord_Doominik Posted July 16, 2005 Share Posted July 16, 2005 (edited) haha, i was faster and built hotkeyset in ... because he don't have a gui xD... but i removed the Run("newl.exe") part, because i think his file is named newl.exe... because he said that the w key always was hit, but many programs were open... and if you don't remove the Run function he gets every 10 seks 2 times the w key... xD ahm and @jdbe iit can't be so that he called is script new1.au3... 'cause he said that the w key always gets pushed... Edited July 16, 2005 by Lord_Doominik Link to comment Share on other sites More sharing options...
DaleHohm Posted July 16, 2005 Share Posted July 16, 2005 Please see Lord_D for all of your future custom programming needs... he won't require that you learn anything... Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Lord_Doominik Posted July 16, 2005 Share Posted July 16, 2005 all the needed i said ^^... that it's better with a loop... and i think he'll understand mine too... it's called learning by doing and not learning by explaining ^^... it's better for his future in programming if he checks himself with the helpfile or with testing, what the different code lines do... and i think that this isn't a very difficult script... if it is more complicate you're right, than it's better to explain everything... Link to comment Share on other sites More sharing options...
Ford21 Posted July 16, 2005 Author Share Posted July 16, 2005 Ok guys just seen your posts, I have not tested them yet but soon will.. No matter what you 2 Rock.. Thanks for your help guys! Link to comment Share on other sites More sharing options...
Ford21 Posted July 17, 2005 Author Share Posted July 17, 2005 (edited) ähm... yes, your problem is that you use the Run() function... it's much better and faster and only uses 1 file opened if you use a loop:HotkeySet("{ESC}", "Exit1") While 1 WinWaitActive ("World of Warcraft") Send ("{w}") Sleep (10000) Wend Func Exit1() WinClose ("World of Warcraft") Exit End Func<{POST_SNAPBACK}>When I try this code I get the error Func has no matching end func, any clue? I tryed puting a end on it but no luck, Thanks Edited July 17, 2005 by Ford21 Link to comment Share on other sites More sharing options...
Ford21 Posted July 17, 2005 Author Share Posted July 17, 2005 You need to put your Send key in a loop so that it repeats. "While 1" creates a condition that is always true and thus an infinite loop.To stop this program, right-click on its tray icon and stop it. To do this more gracefully, read the documentation on HotKeySet and look through the forum for examples of how to create a Terminate function.DaleRun ("new1.exe") WinWaitActive ("World of Warcraft") While 1 Send ("{w}") Sleep (10000) Wend WinCLose ("World of Warcraft") Exit<{POST_SNAPBACK}> This one gives me a error that is wierd, MZ then a squard, next line MZ^ERROR unable to parse line. Not real sure, Any clue? Thanks Link to comment Share on other sites More sharing options...
Ford21 Posted July 17, 2005 Author Share Posted July 17, 2005 (edited) Hmm I tried to modify your script to get it to work. It works like my first one, opens like 10000 scripts or something, but no error lol.. Any advice please. Thanks again guys O also when this happens i have no clue how to stop all of them, I end up having to reboot, any commands fro this, cnt c dont seem to work. Run ("crazy.exe") While 1 WinWaitActive ("World of Warcraft") Send ("{w}") Sleep (10000) Wend Edited July 17, 2005 by Ford21 Link to comment Share on other sites More sharing options...
LxP Posted July 17, 2005 Share Posted July 17, 2005 When I try this code I get the error Func has no matching end func, any clue? I tryed puting a end on it but no luck, Thanks<{POST_SNAPBACK}>It should be EndFunc without any space inbetween. Link to comment Share on other sites More sharing options...
Lord_Doominik Posted July 17, 2005 Share Posted July 17, 2005 (edited) When I try this code I get the error Func has no matching end func, any clue? I tryed puting a end on it but no luck, Thanks<{POST_SNAPBACK}>ahm sry, did a typing error... it is EndFunc and not End Func...this is correctHotkeySet("{ESC}", "Exit1") While 1 WinWaitActive ("World of Warcraft") Send ("{w}") Sleep (10000) Wend Func Exit1() WinClose ("World of Warcraft") Exit EndFunclxp already corrected me... thanks to him ^^... Edited July 17, 2005 by Lord_Doominik Link to comment Share on other sites More sharing options...
Ford21 Posted July 17, 2005 Author Share Posted July 17, 2005 Awesome Guys, I got it working good enought to do what I needed. I must thank all you guys for your help, with out you this script would have never worked. I learned a few new things also! Thanks again guys 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