Jump to content

Default HotKeySet script example bug?


Recommended Posts

I just downloaded the newest version of AutoIt and copied the example script in HotKeySet help and tried to run it but the tray icon blinks red X. Is there a bug with this script?

; Press Esc to terminate script, Pause/Break to "pause"

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

You must be even newer than me :)

That's what happens if you click the icon in the Tray. No X if you deselect "Script Paused" from the icon's context menu. The behavior of clicking the icon can be changed with AutoItSetOption("TrayAutoPause", 0)

Link to comment
Share on other sites

Runs fine for me... I am guessing you really new to autoit in which case, if you click on the tray icon it will cause the script to pause and the icon will flash the red X... Right Clicking on the icon and taking the pause off will reset the script to working again. If your not really new to autoit and this info offends, sorry, was just trying to help.. :)

Link to comment
Share on other sites

Appreciate the feedback, thanks. Actually, it's working now. The problem was clicking the icon, I kept on clicking on it to check if it was paused or not.

Actually, I'm new to the "newer AutoIt syntax" but an intermediate user still using 3.1.1 which is legacy syntax and backwards compatible with all my older complex scripts.

I refuse to upgrade 3 years ago since everything was stable and worked fine, and I remember trying 3.1.5-ish with new syntax coding and my script broke-up, I was pretty busy then so I just rolled back to 3.1.1 and kept chugging along with work. With more time on my hands now, I'm going take another shot at installing the newest version and see what breaks this time and see if I can fix it.

Link to comment
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
 Share

  • Recently Browsing   0 members

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