Sign in to follow this  
Followers 0
doyoulikecheese

Wow, I feel stupid...

14 posts in this topic

I have a continuously looping script, and I want to keep it that way, but I also want to be able to set a hotkey that will disable the loop whenever it is clicked... Is this possible and if so how?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have a continuously looping script, and I want to keep it that way, but I also want to be able to set a hotkey that will disable the loop whenever it is clicked... Is this possible and if so how?

At the beginning of the script:

HotKeySet("^z", "MyExit")

At the end of the script:

Func MyExit()
    Exit 
EndFunc

EDIT: Nevermind, this CLOSES the ENTIRE script.

Edited by multiloser

Share this post


Link to post
Share on other sites

HotKeySet("{end}","Terminate")
while 1
sleep(1000) 
WEnd

Func Terminate()
    Exit
EndFunc


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Thank you both a LOT

Share this post


Link to post
Share on other sites

Guys,

Thanks. I was after something to completely terminate my script, as it is controlling a GUI with a lot of selections and if something went wrong (I'm still writing it), it was extremely hard to take back control of the mouse. Works great

Share this post


Link to post
Share on other sites

Seriously, did you see the date on the last post in the thread before posting in this thread?

Yes I did, but as the two posters are current members (last seen today and 7th October) and I used their solution, I thought it only fit to say Thank you. I wasn't aware that saying thanks was a problem???

Share this post


Link to post
Share on other sites

Yes I did, but as the two posters are current members (last seen today and 7th October) and I used their solution, I thought it only fit to say Thank you. I wasn't aware that saying thanks was a problem???

one year later?

Share this post


Link to post
Share on other sites

Is this a conspiracy??? I extend a common courtesy and I get pounced on for it????

If you walked down the street and saw someone you knew but hadn't seen them for a year, would you walk past them or say Hi?

If you found a great quote from a long dead author, would you claim it as your own, or give the author credit?

When your mom sends you a birthday present and you haven't seen her for a while, do you just ignore her?

Come on, all I said was Thanks. Since when was being polite bounded by time???

Share this post


Link to post
Share on other sites

If you walked down the street and saw someone you knew but hadn't seen them for a year, would you walk past them or say Hi?

I would walk past them.

If you found a great quote from a long dead author, would you claim it as your own, or give the author credit?

I would claim it as my own.

When your mom sends you a birthday present and you haven't seen her for a while, do you just ignore her?

Absolutely yes.

...

Just joking, but is pointless thanks someone 1 year later, you bumped an old topic

Share this post


Link to post
Share on other sites

@eohalloran

Your examples are not valid at all, lets take this one as an example:

If you walked down the street and saw someone you knew but hadn't seen them for a year, would you walk past them or say Hi?

Did you meet the previous posters? No they "walked down the street" over a year ago. You were shouting "Hi" straight out to nobody.

Reviving a post that has been dead for over a year without any valid reasons is dangerously close to spamming and you should try to avoid that for your own good.

Share this post


Link to post
Share on other sites

... Reviving a post that has been dead for over a year without any valid reasons is ...

He has stated his reason [to thank the author of the code in posts 2 and 3 for the solution he was looking for]. {Code that ironically does not do what the OP wanted.}

You (and others) have deemed that reason invalid. I see no problem with it and I look at every thread that I have ever posted to... had he been thanking me, I would have seen it and appreciated it - no matter how old the post or the code.

On a somewhat related topic: Let's clarify a point of etiquette - new topic vs. posting to an old topic. This forum likes new posts and that is fine, but if this forum is going to be different many other forums; I would hope it would be posted in a FAQ or "Read before posting" sticky.

Even that funny video about posting mentions that it is better to post to an old topic rather than make a new one. (Maybe it shows that the poster searched a bit before posting :-)

http://www.autoitscript.com/forum/index.ph...st&p=580197

~just my ramblings on the topic~


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

He has stated his reason [to thank the author of the code in posts 2 and 3 for the solution he was looking for]. {Code that ironically does not do what the OP wanted.}

You (and others) have deemed that reason invalid. I see no problem with it and I look at every thread that I have ever posted to... had he been thanking me, I would have seen it and appreciated it - no matter how old the post or the code.

On a somewhat related topic: Let's clarify a point of etiquette - new topic vs. posting to an old topic. This forum likes new posts and that is fine, but if this forum is going to be different many other forums; I would hope it would be posted in a FAQ or "Read before posting" sticky.

Even that funny video about posting mentions that it is better to post to an old topic rather than make a new one. (Maybe it shows that the poster searched a bit before posting :-)

http://www.autoitscript.com/forum/index.ph...st&p=580197

~just my ramblings on the topic~

I love you! I'm also going to bookmark this because I always lose this code and need it every time for a new script. :) Thanks.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

... need it every time for a new script. :) Thanks.

You might consider using a template file. It is just an au3 file as mentioned here: http://www.autoitscript.com/forum/index.ph...st&p=291364

That way, every time you do a right click > New > AutoIt v3 Script the new file will contain all of the code that you want to start off with - just delete what you might not want.

Edit: The link above is a resurrected thread 23+ months old :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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
Sign in to follow this  
Followers 0