Jump to content

Need a better way to exit a script


matumbo
 Share

Recommended Posts

Hi

Anyone knows if it is a way to make a script to exit after the "01" buttom is pressed 10 times?

I have been trying to find a better way, earlier i used:

Hotkeyset("{""}), "terminate")

func terminate()

exit

EndFunc

to exit but often it doesn't work.

Link to comment
Share on other sites

not to sound confused nor a jerk here, but your code and post have the following issues:

1. There is no 01 key. There is a 1 and a 0, but not a 01.

2. If you are using _ispressed, then we need to see all your code, not just the snippit to see the problem.

3. You could use the following to solve your problem:

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")  ;Shift-Alt-d

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc
Edited by Volly
Link to comment
Share on other sites

I have been useing Hotkeyset before but sometimes the Hotkey does not respond.

CODE
#include <misc.au3>

Do

processclose("taskmgr.exe")

if _ispressed("01") Then

mousemove(1,1,0)

EndIf

until

The script is really simple and it's not finished, I have been trying to find a function that exit the script after i have clicked the left mousebutton a couple of times instead of useing keys to exit.

Is there a way to do it?

Link to comment
Share on other sites

It's just a fun but enoying script,

it move the mouse to the upper right corner everytime left mouse button is pressed and blocks taskmanager.exe so it's hard to exit the script without knowing how to do it.

Edited by matumbo
Link to comment
Share on other sites

  • Developers

Sounds like a blast to me.

Just throw your pc/laptop out of the window when you want to have a blast ...

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...