Sign in to follow this  
Followers 0
knucklesCZ

General question about AutoIt functioning

2 posts in this topic

Hello. I'd like to ask a question about AutoIt basics, as I was deeply thinking about creating a script, I got stuck at some questions such as:

The Sleep function stops the script completely (it stops everything, if the script repeats an action every 5 seconds and there is a Sleep(1000), will it repeat once per 6 seconds in real time)?
Can there be multiple loops working simultaneously depending on IFs or Switches? (loops controlling keyboard, deducing things from imagesearch etc.)
If there can be multiple loops working in one moment (multiple actions), does Sleep stop the whole script or just one of the loops?

Thanks for responses.

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

  • Similar Content

    • InunoTaishou
      By InunoTaishou
      Update 2017-04-21:
      Added a timeout My previous attempt of checking that the function is valid was not working. Added a 1 time function call before entering the While loop to test the function. Now sets error to $SLEEP_UNTIL_INVALID_CALL if the function supplied is does not exist or invalid arguments supplied Added an @Error value $SLEEP_UNTIL_TIMEOUT_REACHED, set when the condition was not met but timeout reached  
      Inspired by a very vague topic, and completely unnecessary, I had fun trying to making this up. A function that will sleep until the conditional statement, or function call statement, provided executes to the condition you want! I know, completely useless!!! It's pretty interesting actually. Instead of having to write multiple while loops per conditions, you just need to use SleepUntil and set your own condition.
      Basic syntax:
      SleepUntil("$iMyNumber = 100") Will sleep until the variable in your script $iMyNumber is 100. All conditional operators are supported (=, <>, >=, <=, >, and <). Will not support multiple conditions (i.e., $iMyNumber > 100 and $iMyNumber < 1000).
      More advanced syntax, using a value returned from a function call:
      SleepUntil("Func = TimerDiff|Args = {" & TimerInit() & "}| > 5000") Well check the value returned from TimerDiff using the value returned from TimerInit() and stop sleeping once it's > 5000 (5 seconds)./
      Anyways, better to show through the example.
      Example.au3
      #include <String.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GuiEdit.au3> #include "SleepUntil.au3" AutoItSetOption("GUICloseOnESC", 0) Global $sName = "Test" Global $bBool = True Global $iInt = -1 Global $dDouble = 0.0 Global $sMsg = "Welcome," & @CRLF & _ "The SleepUntil function can use a function to check against a condition or just a regular conditional statement. " & _ "I.e. $iValue = 300" & @CRLF & "A basic conditional example would be" & @CRLF & @TAB & _ "Global $bWaiting = True" & @CRLF & @TAB & _ 'SleepUntil("$bWaiting <> $bWaiting")' & @CRLF & _ "This is a good example of having some kind of global flag where you want to wait until the user triggers the flag to not be true" & @CRLF & @CRLF & _ "The first set of examples will use function calls to compare against the condition value." & @CRLF & _ "First example calls GUIGetMsg using the with no arguments and sleeps until the value returned is " & _ "$GUI_EVENT_CLOSE" & @CRLF & @CRLF & _ "Syntax for the function call for SleepUntil is:" & @CRLF & _ 'SleepUntil("Func = FunctionName|Args = {Argument1}, {Argument2}, {ArgumnetN}|(Condition Operator) Value' & @CRLF & _ 'Example (Where function call has arguments)' & @CRLF & @TAB & _ 'Global $iTimer = TimerInit()' & @CRLF & @TAB & _ 'SleepUntil("Func = TimerDiff|Args = {$iTimer}|>= 5000")' & @CRLF & @CRLF & _ "Example (Where no arguments are needed for the function)" & @CRLF & @TAB & _ 'SleepUntil("Func = GUIGetMsg|Args = NoArgs| = $GUI_EVENT_CLOSE")' & @CRLF & @CRLF & _ 'If you do not want any arguments you can set Args = NoArgs, "Args = " & $SLEEP_UNTIL_NO_ARGS, or just leave the args section blank (I.e. ||(Condition Operator) Value' & @CRLF & _ "The first example will start once you close this window!" Global $hMain = GUICreate("Introduction", 800, 600, 0, 0, BitOR($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) Global $edtEdit = GUICtrlCreateEdit($sMsg, 10, 10, 775, 555, $ES_MULTILINE) GUICtrlSetBkColor($edtEdit, 0x1F1F1F) GUICtrlSetColor($edtEdit, 0xF1F1F1) GUICtrlSetFont($edtEdit, 11, 400, "", "Consolas") GUICtrlSetResizing($edtEdit, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM) GUISetState(@SW_SHOWMAXIMIZED) _GUICtrlEdit_SetSel(GUICtrlGetHandle($edtEdit), 0, 0) ; Slep until person running this example script closes the GUI or it reaches the 30 second timeout SleepUntil("Func = GUIGetMsg||= $GUI_EVENT_CLOSE", 50, 30000) GUIDelete($hMain) MsgBox("", "Timer", "Starting the examples. The next sleep will last until 2 seconds have passed") ; Sleep until TimerDif(Timer Created) > 2000 ToolTip("Sleeping until 2 seconds has passed", 0, 0) SleepUntil("Func = TimerDiff|Args = {" & TimerInit() & "}|> 2000") MsgBox("", "Timer", "2 Seconds has passed. Met condition and left sleep function") ; Sleep until the call to ConsoleWrite3Times is >= 3 ToolTip("Sleeping until the function ConsoleWrite3Times() as been called three times", 0, 0) SleepUntil("Func: ConsoleWrite3Times|Args = " & $SLEEP_UNTIL_NO_ARGS & "|>= 3", 500) MsgBox("", "Print 3 Times", "Did ConsoleWrite 3 times. Met condition needed and left sleep function") HotKeySet("{F1}", SetName) MsgBox("", "Next", "Next SleepUntil examples can be met by pressing the {F1} Key to trigger the conditions" & @CRLF & _ "Next example will sleep until $sName = InunoTaishou") ; Sleep until user presses {F1} and changes $sName = InunoTaishou ToolTip("$sName = " & $sName, 0, 0) SleepUntil("sName = InunoTaishou", 100) MsgBox("", $sName, "Name has been updated to " & $sName & ". Met condition needed and left sleep function" & @CRLF & _ "Next example will sleep until $bBool <> True") ; Sleep until user preses {F1} and $bBool <> True ToolTip("$bBool = " & $bBool, 0, 0) SleepUntil("$bBool <> $bBool", 100) MsgBox("", $bBool, "Bool has been updated to " & $bBool & ". Met condition needed and left sleep function" & @CRLF & _ "Next example will sleep until $iInt > 0") ; Sleep until user presses {F1} and $iInt > 0 ToolTip("$iInt = " & $iInt, 0, 0) SleepUntil("$iInt > 0", 100) MsgBox("", $iInt, "Int has been updated to " & $iInt & ". Met condition needed and left sleep function" & @CRLF & _ "Next example will sleep until $dDouble = 99.99") ; Sleep until user presses {F1} and $dDouble = 99.99 ToolTip("$dDouble = " & $dDouble, 0, 0) SleepUntil("$dDouble = 99.99", 100) MsgBox("", $dDouble, "Double has been updated to " & $dDouble & ". Met condition needed and left sleep function" & @CRLF & _ "Next example will sleep until function Print is called with the msg provided") Local $sMsgToPrint = InputBox("Message", "What message should be used for ConsoleWrite?", "This is a the default msg!") SleepUntil("Func = Print|Args = {" & $sMsgToPrint & "}, {" & InputBox("Times?", "How many times to print " & $sMsgToPrint & "?", 10) & "}| = $sMsgToPrint") MsgBox("", "Print", "Congrats! That's all the examples I have") Func ConsoleWrite3Times() Local Static $iPrint = 0 $iPrint += 1 ConsoleWrite("ConsoleWrite number " & $iPrint & @LF) Return $iPrint EndFunc Func Print($sMsg, $iTimes) If ($iTimes < 1) Then $iTimes = 1 For $i = 1 to $iTimes ConsoleWrite($sMsg & @LF) Next Return $sMsg EndFunc Func SetName() $sName = "InunoTaishou" HotKeySet("{F1}", SetBool) EndFunc ;==>SetName Func SetBool() $bBool = False HotKeySet("{F1}", SetInt) EndFunc ;==>SetBool Func SetInt() $iInt = 100 HotKeySet("{F1}", SetDouble) EndFunc ;==>SetInt Func SetDouble() $dDouble = 99.99 EndFunc ;==>SetDouble SleepUnti.au3
      #include-once #include <String.au3> Global Const $SLEEP_UNTIL_VAR_NOT_DECLARED = -100 Global Const $SLEEP_UNTIL_SPLIT_OOR = -101 Global Const $SLEEP_UNTIL_INVALID_OPERATOR = -102 Global Const $SLEEP_UNTIL_INVALID_FUNC = -103 Global Const $SLEEP_UNTIL_INVALID_CALL = -104 Global Const $SLEEP_UNTIL_TIMEOUT_REACHED = -105 Global Const $SLEEP_UNTIL_NO_ARGS = "NoArgs" ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ; #CURRENT# ===================================================================================================================== ; SleepUntil: Sleeps until the condition statement supplied meets the requirements ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ; _StringArgsToArray: Returns the argument string as an array, single argument, or "" ; _ConditionOperator: Returns the condtional operator in the statement ; _ValueProper: Returns the value supplie as the proper type ; _EvalCondition: Tests the statement ; _EvalTestFunc: Does a one time check to make sure the function exists and arguments are valid ;================================================================================================================================ ; #FUNCTION# ==================================================================================================================== ; Name ..........: SleepUntil ; Description ...: Sleeps until the condition supplied is met. ; Syntax ........: SleepUntil($sConditionStatement[, $iTime = 100[, $iTimeout = Default]]) ; Parameters ....: $sConditionStatement - String formatted condition statement ; $iTime - (Optional) Time (In Milliseconds) to sleep between each check of the condition ; $iTimeout - (Optional) Timeout (In Milliseconds) to stop sleeping if condition not met ; Return values .: Success - Returns True if the condition statement supplied was proper and was able to execute ; checking the condition ; Failure - Returns False and Sets the @Error flag ; -100 ($SLEEP_UNTIL_VAR_NOT_DECLARED): Variable to check against in the $sConditionStatement statement ; is not declared in the script. ; -101 ($SLEEP_UNTIL_SPLIT_OOR): StringSplit resulted in out of range expected. ; -102 ($SLEEP_UNTIL_INVALID_OPERATOR): Invalid operator used for condition. Regular AutoIt condition ; operators are used ; -103 ($SLEEP_UNTIL_INVALID_FUNC): Invalid function supplied in function call condition ; -104 ($SLEEP_UNTIL_INVALID_CALL): Function supplied does not exist or parameters supplied do not match ; the function called ; -105 ($SLEEP_UNTIL_TIMEOUT_REACHED): Timeout was reached but the condition was not met ; Author ........: InunoTaishou ; Remarks .......: The $sConditionStatement parameter can be a simple $vVar = Value or can use the value returned from a function call ; to sleep. ; Proper syntax for a function call is "Func = FunctionName|Args = {Argument1}, {Argument2}, {ArgumentN}|Operator Value" ; The argument portion of the statement can be omitted, making it just FunctionName||Operator Value ; You can also use Args = NoArgs or Args = $SLEEP_UNTIL_NO_ARGS ; All arguments must be wrapped in curly braces ({}) ; Example .......: Yes ; =============================================================================================================================== Func SleepUntil($sConditionStatement, $iTime = 100, $iTimeout = Default) ; Comparison to use, check if Var = Val or Var <> Val in the while loop Local $sConditionOperator = _ConditionOperator($sConditionStatement) Local $aSplit = Null Local $vValue = Null Local $vReturn = Null Local $iInternalTimeoutTimer = Null ; Cannot have a 0 or negative timeout If ($iTimeout <= 0) Then $iTimeout = Default ; Check that $iTime is within the range that Sleep() will take If ($iTime < 10) Then $iTime = 10 If ($iTime > 2147483647) Then $iTime = 2147483647 ; Invalid operator supplied in statement If ($sConditionOperator = "") Then Return SetError($SLEEP_UNTIL_INVALID_OPERATOR, 0, False) ElseIf ($sConditionOperator = "Func") Then Local $bTestCall = Null $aSplit = StringSplit($sConditionStatement, "|", $STR_NOCOUNT + $STR_ENTIRESPLIT) ; Split string has 3 indexes, [0] = Function name, [1] = Arguments for the function call, [2] = Condition/Comparison If (UBound($aSplit) = 3) Then Local $aRegExp = StringRegExp(StringReplace($aSplit[0], "Func", ""), "([_a-zA-Z0-9].*)", 3) If (@error) Then Return SetError($SLEEP_UNTIL_INVALID_FUNC, 0, False) ; Function named store in the $aRegExp[0] Local $sFunc = $aRegExp[0] Local $aArgs = _StringArgsToArray($aSplit[1]) $sConditionOperator = _ConditionOperator($aSplit[2]) $aSplit = StringSplit($aSplit[2], $sConditionOperator, $STR_NOCOUNT + $STR_ENTIRESPLIT) ; Check that the condition supplied was a valid condition (i.e., $sVar = "String") If (UBound($aSplit) = 2) Then ; Get the value that's in the $aSplit[1] $vValue = _ValueProper(StringStripWS($aSplit[1], $STR_STRIPLEADING + $STR_STRIPTRAILING)) If (@error) Then Return SetError($SLEEP_UNTIL_VAR_NOT_DECLARED, 0, False) Else Return SetError($SLEEP_UNTIL_SPLIT_OOR, 0, False) EndIf ; There are no arguments for the function call If ($aArgs = $SLEEP_UNTIL_NO_ARGS) Then If ($iTimeout) Then $iInternalTimeoutTimer = TimerInit() ; Do a test call to the function to make sure it's valid $bTestCall = _EvalTestFunc($sFunc, $SLEEP_UNTIL_NO_ARGS, $sConditionOperator, $vValue) ; Invalid function If (@error) Then ; Return Return SetError($SLEEP_UNTIL_INVALID_CALL, 0, False) ; Was a valid function, now if the value returned from the function call does not ; meet the condition ElseIf (Not _EvalCondition($bTestCall, $sConditionOperator, $vValue)) Then Sleep($iTime) ; Keep waiting until the condition becomes true While (_EvalCondition(Call($sFunc), $sConditionOperator, $vValue)) ; $iTimeout was set, check to see if we reached the timeout If ($iTimeout And TimerDiff($iInternalTimeoutTimer) >= $iTimeout) Then Return SetError($SLEEP_UNTIL_TIMEOUT_REACHED, 0, False) Sleep($iTime) WEnd EndIf ; There are argument(s) for the function call Else If ($iTimeout) Then $iInternalTimeoutTimer = TimerInit() ; Do a test call to the function to make sure it's valid $bTestCall = _EvalTestFunc($sFunc, $aArgs, $sConditionOperator, $vValue) If (@error) Then Return SetError($SLEEP_UNTIL_INVALID_CALL, 0, False) ElseIf (Not _EvalCondition($bTestCall, $sConditionOperator, $vValue)) Then Sleep($iTime) While (_EvalCondition(Call($sFunc, $aArgs), $sConditionOperator, $vValue)) ; $iTimeout was set, check to see if we reached the timeout If ($iTimeout And TimerDiff($iInternalTimeoutTimer) >= $iTimeout) Then Return SetError($SLEEP_UNTIL_TIMEOUT_REACHED, 0, False) Sleep($iTime) WEnd EndIf EndIf Else Return SetError($SLEEP_UNTIL_SPLIT_OOR, 0, False) EndIf Else ; Split the condition $aSplit = StringSplit($sConditionStatement, $sConditionOperator, $STR_NOCOUNT + $STR_ENTIRESPLIT) ; Variables used to hold the name of the Var to check and the value to check against Local $sVar = Null ; Check that the condition supplied was a valid condition (i.e., $sVar = "String") If (UBound($aSplit) = 2) Then ; Get the var name, removing the '$' character so it can be used in Eval() ; and removing the trailing and leading spaces $sVar = StringReplace(StringStripWS($aSplit[0], $STR_STRIPLEADING + $STR_STRIPTRAILING), "$", "") ; Check that the variable is declared, if not return an error If (Not IsDeclared($sVar)) Then Return SetError($SLEEP_UNTIL_VAR_NOT_DECLARED, 0, False) ; Get the value, also removing the trailing and leading spaces $vValue = _ValueProper(StringStripWS($aSplit[1], $STR_STRIPLEADING + $STR_STRIPTRAILING)) If (@error) Then Return SetError($SLEEP_UNTIL_VAR_NOT_DECLARED, 0, False) Else Return SetError($SLEEP_UNTIL_SPLIT_OOR, 0, False) EndIf If ($iTimeout) Then $iInternalTimeoutTimer = TimerInit() While (_EvalCondition(Eval($sVar), $sConditionOperator, $vValue)) Sleep($iTime) ; $iTimeout was set, check to see if we reached the timeout If ($iTimeout And TimerDiff($iInternalTimeoutTimer) >= $iTimeout) Then Return SetError($SLEEP_UNTIL_TIMEOUT_REACHED, 0, False) WEnd EndIf Return True EndFunc ;==>SleepUntil ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _EvalTestFunc ; Description ...: Tests the $sFunc to make sure it's valid ; Syntax ........: _EvalTestFunc($sFunc, $aArgs, $sConditionOperator, $vValue) ; Return values .: Value returned from _EvalCondition, like in the normal While loop used above ; Author ........: InunoTaishou ; Remarks .......: ; =============================================================================================================================== Func _EvalTestFunc($sFunc, $aArgs, $sConditionOperator, $vValue) Local $vFuncCall = Null If ($aArgs = $SLEEP_UNTIL_NO_ARGS) Then $vFuncCall = Call($sFunc) Else $vFuncCall = Call($sFunc, $aArgs) EndIf If (@error) Then Return SetError($SLEEP_UNTIL_INVALID_CALL, 0, False) Return _EvalCondition($vFuncCall, $sConditionOperator, $vValue) EndFunc ;==>_EvalTestFunc ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _StringArgsToArray ; Description ...: Turns string of arguments into an array of arguments, or none if no arguments ; Syntax ........: _StringArgsToArray($sString) ; Return values .: Array of arguments, "", or 1 single argument ; Author ........: InunoTaishou ; Remarks .......: ; =============================================================================================================================== Func _StringArgsToArray($sString) If (StringInStr($sString, $SLEEP_UNTIL_NO_ARGS) Or $sString = "") Then Return $SLEEP_UNTIL_NO_ARGS Local $aReturn = _StringBetween("{CallArgArray}" & $sString, "{", "}") Local $iArgCount = UBound($aReturn) If ($iArgCount > 1) Then For $iArg = 0 To $iArgCount - 1 $aReturn[$iArg] = _ValueProper($aReturn[$iArg]) Next ; If there's only 2 arguments ; This means the [0] index has the CallArgArray string, meaning there's only one ; real argument for the function call Return $iArgCount = 2 ? $aReturn[1] : _ $aReturn Else Return $SLEEP_UNTIL_NO_ARGS EndIf EndFunc ;==>_StringArgsToArray ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _ConditionOperator ; Description ...: Returns the operator used in the condition statement ; Syntax ........: _ConditionOperator($sConditionStatement) ; Return values .: Func, =, <>, >=, <=, >, < ; Author ........: InunoTaishou ; Remarks .......: ; =============================================================================================================================== Func _ConditionOperator(Const $sConditionStatement) Return (StringInStr($sConditionStatement, "Func") ? "Func" : _ StringInStr($sConditionStatement, "=") ? "=" : _ StringInStr($sConditionStatement, "<>") ? "<>" : _ StringInStr($sConditionStatement, ">=") ? ">=" : _ StringInStr($sConditionStatement, "<=") ? "<=" : _ StringInStr($sConditionStatement, ">") ? ">" : _ StringInStr($sConditionStatement, "<") ? "<" : "") EndFunc ;==>_ConditionOperator ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _ValueProper ; Description ...: Returns the value supplied in the correct format. I.e. string "1234" into Int 1234, $vVar to the value in $vVar ; Syntax ........: _ValueProper($vValue) ; Return values .: Value returned in the proper type ; Author ........: InunoTaishou ; Remarks .......: ; =============================================================================================================================== Func _ValueProper($vValue) If (IsNumber($vValue)) Then Return Number($vValue) If ($vValue = "True") Then Return True If ($vValue = "False") Then Return False If ($vValue = "Null") Then Return Null If (StringInStr($vValue, "Eval") Or StringLeft($vValue, 1) = "$") Then $vValue = StringMid($vValue, StringInStr($vValue, "(") + 1) If (Not @error) Then If (StringRight($vValue, 1) = ")") Then $vValue = StringTrimRight($vValue, 1) EndIf If (StringLeft($vValue, 1) = "$") Then $vValue = StringTrimLeft($vValue, 1) If (Not IsDeclared($vValue)) Then Return SetError($SLEEP_UNTIL_VAR_NOT_DECLARED, 0, "") Return _ValueProper(Eval($vValue)) EndIf ; Value supplied was already proper Return $vValue EndFunc ;==>_ValueProper ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _EvalCondition ; Description ...: Tests the $vTest against $vAgainst using the conditional operator supplied ; Syntax ........: _EvalCondition($vValue) ; Return values .: True if the $vTest against $vAgainst is true ; Author ........: InunoTaishou ; Remarks .......: I use a while statement for the main sleep portion of the SleepUntil instead of Do...Until ; Looking at this doesn't make sense (Why is the operator = but I'm doing $vTest <> $vAgainst ; because logically While($vTest <> $vAgainst)...Sleep....WEnd ; =============================================================================================================================== Func _EvalCondition($vTest, $sConditionOperator, $vAgainst) Switch ($sConditionOperator) Case "=" Return $vTest <> $vAgainst Case "<>" Return $vTest = $vAgainst Case ">=" Return $vTest < $vAgainst Case "<=" Return $vTest > $vAgainst Case ">" Return $vTest <= $vAgainst Case "<" Return $vTest >= $vAgainst EndSwitch EndFunc ;==>_EvalCondition Edit: Did a test call to the function to make sure it's valid. checking for the 0xDEAD and 0xBEEF errors inside the while loops wasn't working since the _EvalCondition was being called right after it.
      Edit: Forgot about the _ that can be used in function calls. Added the _ to the StringRegExp
    • Fhelipe
      By Fhelipe
      So I wanted to use my machine as a server for a program that had a unique login system. It can only log in 1 person and the password is in the script itself. I would like to adptar my code or change it completely so that I can create a database and the Script At Time Of Login Get Database Login And Log In
      Experience with Autoit: Basic                      (sorry for bad English)
      Experience with SQL: None                              (translator only)
      Code Currently Used To Login:
      ;=========================================================
      While 1
          $MSG = GUIGetMsg()
          Switch $MSG
          Case $ButtonOk
              If VerifyLogin(GUICtrlRead($USERNAME),GUICtrlRead($PASSWORD)) = 1 Then
                  GUIDelete($Form1)
                  MsgBox(-1,"Logado com Sucesso","Login Sucedido, Para Parar o Aimbot Pressione ESC!")
                  Run ("C:\Program Files (x86)\Steam\steamapps\common\Mitos.is The Game\Mitosis.exe")
                  RunP()
              Else
                  MsgBox(-1,"Error","Usúario ou Senha está incorreto, Ou Ainda Não Pagou!")
               EndIf
          Case -3
              Exit
           Case $ButtonCancel
              Exit
                Case $HelpButton
               MsgBox(-1, "Criadores", "Criadores: Zummey & Ralta")
      Case $Register
         MsgBox(-1, "ERRO", "PROGRAMA EM DESENVOLVIMENTO FUNÇÃO DESABILITADA")
          EndSwitch
      WEnd
      Func VerifyLogin($USERNAME,$PASSWORD)
          If $USERNAME = "Zummey" And $PASSWORD = "xd90fe10" Then
              Return 1
          Else
              Return 0
          EndIf
      EndFunc; End login
      ;=========================================================
    • IamKJ
      By IamKJ
      I am trying to allow the GUI to gather info as to when to execute a function.  I am having trouble doing this.  So far this is what I have.
       
      ;Timer Func timer () If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"Timer","Please format your answer in 00:00:00:000") Select Case $iMsgBoxAnswer = 6 ;Yes Global $infotime = InputBox ('Time', 'What time to execute?') Do $rawtimer = ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec()) until $rawtimer = $infotime if $rawtimer = $infotime Then msgbox (0,'Worked','Worked') Else EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect EndFunc Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc I have also tried _GUIToolTip_GetText in order to read the tooltip until the time specified, but it still doesn't work.  Any help would be great.
    • IamKJ
      By IamKJ
      So I have a lot of different functions in the little program I'm making.  Most of them use the Do statement, such as finding images, clicking buttons, etc.
       
      The question I have is how would I be able to both
      1) Create a hotkey to pause whatever I am doing at the moment.  If I have to put something into every function in the program, I don't mind.
      2) Create a hotkey to exit whatever I am doing and stop all loops or commands and bring back the main GUI?
    • Manivel
      By Manivel
      Hi,
      Can any one please share the Connection string for SQL Developer. 
      How to Connect the SQL Developer from AutoIT. We need to execute the query through AutoIt. is that possible ?