Jump to content
Sign in to follow this  

HotKeySet issues

Recommended Posts


Why does this always run _Login() regardless of my button presses, and quite ignores me when I actually command it to start the function?

Global $LoginID = FileRead(@ScriptDir & "\LoginID.txt")
If @error Then
   Global $LoginID = InputBox("What is your user ID?", "Please specify a user ID!")
   If @error Then Exit
   Local $MsBox = MsgBox(4, "Do you want to save your user ID?", "Would you like to save user ID in a file so it won't ask you again?")
   If $MsBox = 6 Then
      Local $fFile = FileOpen(@ScriptDir & "\LoginID.txt", 8 + 2)
      FileWrite($fFile, $LoginID)

HotKeySet("^!u", _Login()) ;CTRL + ALT + U

While 1

Func _Login()
   Local $MsBox = MsgBox(1, "Signing in or out!", "We will sign in or out for you now, is that OK?", 10)
   If $MsBox = 2 Then Return

Also, if the second MessageBox times out, how can I see that? Will $MsBox = -1? Or maybe @error will be set to a none zero??

Edited by Sodori

Share this post

Link to post
Share on other sites


HotKeySet("^!u", "_Login") ;CTRL + ALT + U
HotKeySet("^!u", _Login()) ;CTRL + ALT + U
for second question
Failure: $IDTIMEOUT (-1) if the message box timed out.

so it shud return -1 if timeouted

so "If $MsBox = -1 Then MsgBox(16,'','something something something dark side')" should work 

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


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  

  • Create New...