IcantCodeHelp Posted April 9, 2019 Share Posted April 9, 2019 can someone fix my script and add hot key as esc and fix the loop the problem is it wont stop looping While 1 HotKeySet("{ESC}", "_Exit") WinActivate("Untitled") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") WEnd Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 9, 2019 Author Share Posted April 9, 2019 can someone fix my script and add hot key as esc and fix the loop the problem is it wont stop looping While 1 HotKeySet("{ESC}", "_Exit") WinActivate("Untitled") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") WEnd Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 9, 2019 Author Share Posted April 9, 2019 can someone fix my script and add hot key as esc and fix the loop the problem is it wont stop looping While 1 HotKeySet("{ESC}", "_Exit") WinActivate("Untitled") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") WEnd Link to comment Share on other sites More sharing options...
jdelaney Posted April 9, 2019 Share Posted April 9, 2019 HotKeySet("{ESC}", "_Exit") While 1 ; add in your stuff WEnd Func _Exit () Exit EndFunc IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
AlmarM Posted April 9, 2019 Share Posted April 9, 2019 5 hours ago, IcantCodeHelp said: can someone fix my script and add hot key as esc and fix the loop the problem is it wont stop looping While 1 HotKeySet("{ESC}", "_Exit") WinActivate("Untitled") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") WEnd Oh boy this is an old post. Anyway, you should probably move that HotKeySet outside of the while loop. I assume you've a _Exit function defined somewhere? 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...
Developers Jos Posted April 9, 2019 Developers Share Posted April 9, 2019 (edited) Could you please STOP posting your problem at multiple places where it even doesn't belong at all! I assume you are in a rush or something be we are not and hate to have to clean up for your impatience. Jos Edited April 9, 2019 by Jos 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...
IcantCodeHelp Posted April 9, 2019 Author Share Posted April 9, 2019 sorry i was in a rush in a wouldnt stop going @Jos Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 9, 2019 Author Share Posted April 9, 2019 And thanks guys @AlmarM @jdelaney Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 9, 2019 Author Share Posted April 9, 2019 13 hours ago, Jos said: Could you please STOP posting your problem at multiple places where it even doesn't belong at all! I assume you are in a rush or something be we are not and hate to have to clean up for your impatience. Jos 18 hours ago, jdelaney said: HotKeySet("{ESC}", "_Exit") While 1 ; add in your stuff WEnd Func _Exit () Exit EndFunc it didnt work is there something i missed? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 9, 2019 Developers Share Posted April 9, 2019 Why are you quoting me? 7 minutes ago, IcantCodeHelp said: it didnt work is there something i missed? What does that mean? you run this code and Esc does stop it and it keeps running? Jos 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...
Earthshine Posted April 10, 2019 Share Posted April 10, 2019 It means he didn’t put his code inside the loop And just ran that piece of code My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 10, 2019 Author Share Posted April 10, 2019 (edited) 1 hour ago, Earthshine said: It means he didn’t put his code inside the loop And just ran that piece of code i did but once i clicked ESC it didnt stop @Jos Edited April 10, 2019 by IcantCodeHelp Link to comment Share on other sites More sharing options...
jdelaney Posted April 10, 2019 Share Posted April 10, 2019 (edited) Works for me. Post your full script. Provide steps to reproduce. I can reproduce with something like this: HotKeySet("{ESC}", "_Exit") While 1 MsgBox(1,1,1) WEnd Func _Exit () Exit EndFunc The Exit still occurs, but not until the msgbox is closed. Edited April 10, 2019 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 10, 2019 Developers Share Posted April 10, 2019 5 hours ago, IcantCodeHelp said: i did but once i clicked ESC it didnt stop @Jos Clicked ESC? Or did you mean pushed? Which program are you running in the foreground that could snoop this key press? ... And as stated: post your none working code when you want help. Jos 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...
IcantCodeHelp Posted April 10, 2019 Author Share Posted April 10, 2019 here's the script HotKeySet("{ESC}", "_Exit") While 1 WinActivate("Untitled") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") send("-work") send("{Enter}") send("-dep all") send("{Enter}") sleep("120000") WEnd Func _Exit() Exit EndFunc? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 10, 2019 Developers Share Posted April 10, 2019 (edited) ... and the answer to my other question is??? PS: The script works fine with Notepad providing it is a empty unchanged file. So provide sufficient info when you want help please. Edited April 10, 2019 by Jos 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...
IcantCodeHelp Posted April 10, 2019 Author Share Posted April 10, 2019 im not so good at this i just made the code in note pad than ran it Link to comment Share on other sites More sharing options...
IcantCodeHelp Posted April 10, 2019 Author Share Posted April 10, 2019 i clicked Esc Link to comment Share on other sites More sharing options...
Developers Jos Posted April 10, 2019 Developers Share Posted April 10, 2019 Again: Your posted script works fine with notepad and stops when you press Esc. Open SciTE, which came with the AutoIt3 installer, Open the script it that. Start Notepad and press F5 (Run) in SciTE so the script starts. Then press Esc and you will see the script ends. Jos 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...
IcantCodeHelp Posted April 10, 2019 Author Share Posted April 10, 2019 oh thank you ill test it 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