Jump to content

Recommended Posts

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
 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites
Posted (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 by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Posted (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 by IcantCodeHelp

Share this post


Link to post
Share on other sites
Posted (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 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.

Share this post


Link to post
Share on other sites
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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
Posted (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 by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...