Sodori Posted January 29, 2015 Share Posted January 29, 2015 (edited) Hi, 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) EndIf EndIf HotKeySet("^!u", _Login()) ;CTRL + ALT + U While 1 Sleep(500) WEnd 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 EndFunc 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 January 29, 2015 by Sodori Link to comment Share on other sites More sharing options...
Solution bogQ Posted January 29, 2015 Solution Share Posted January 29, 2015 (edited) its HotKeySet("^!u", "_Login") ;CTRL + ALT + U not 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 January 29, 2015 by bogQ Sodori 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - 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. Link to comment Share on other sites More sharing options...
Sodori Posted January 29, 2015 Author Share Posted January 29, 2015 It's annoying those obvious but missed things >.< Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now