Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/24/2014 in all areas

  1. You can look into an adlibregister, to continually check the text of the button vs the new text...change when required. Or, in your loop, do the checks: Global $iCounter = 0 Global $sButton1Prefix = "Button1Text" Global $sButton2Prefix = "Button2Text" Global $aButtons[2][2]=[[$sButton1Prefix & $iCounter,""],[$sButton2Prefix & $iCounter,""]] #include <GUIConstantsEx.au3> Example() Func Example() Local $msg $h = GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $aButtons[0][1] = GUICtrlCreateButton($aButtons[0][0], 10, 30, 100) $aButtons[1][1] = GUICtrlCreateButton($aButtons[1][0], 0, -1) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect Sleep(1000) $iCounter+=1 ; something chnages the array...just manually doing so now $aButtons[0][0] = $sButton1Prefix & $iCounter $aButtons[1][0] = $sButton2Prefix & $iCounter If Not (ControlGetText($h,"",$aButtons[0][1]) = $aButtons[0][0]) Then ControlSetText($h,"",$aButtons[0][1], $aButtons[0][0]) If Not (ControlGetText($h,"",$aButtons[1][1]) = $aButtons[1][0]) Then ControlSetText($h,"",$aButtons[1][1], $aButtons[1][0]) WEnd EndFunc ;==>Example adlibregister route: Global $iCounter = 0 Global $sButton1Prefix = "Button1Text" Global $sButton2Prefix = "Button2Text" Global $aButtons[2][2]=[[$sButton1Prefix & $iCounter,""],[$sButton2Prefix & $iCounter,""]] #include <GUIConstantsEx.au3> AdlibRegister("changebuttonArrayText",5000) AdlibRegister("checkbuttonTextagainstArray",200) Example() Func Example() Local $msg Global $h = GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $aButtons[0][1] = GUICtrlCreateButton($aButtons[0][0], 10, 30, 100) $aButtons[1][1] = GUICtrlCreateButton($aButtons[1][0], 0, -1) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd EndFunc ;==>Example Func changebuttonArrayText() $iCounter+=1 ; something chnages the array...just manually doing so now $aButtons[0][0] = $sButton1Prefix & $iCounter $aButtons[1][0] = $sButton2Prefix & $iCounter EndFunc Func checkbuttonTextagainstArray() ; something chnages the array...just manually doing so now If Not (ControlGetText($h,"",$aButtons[0][1]) = $aButtons[0][0]) Then ControlSetText($h,"",$aButtons[0][1], $aButtons[0][0]) If Not (ControlGetText($h,"",$aButtons[1][1]) = $aButtons[1][0]) Then ControlSetText($h,"",$aButtons[1][1], $aButtons[1][0]) EndFunc
    1 point
  2. The best way would be to schedule a task for the $sNewDate. The scheduled task cmd can be a one-liner, like: consolewrite(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"') note: grab the output of the consolewrite for the actual task command. That would use 0 cpu/ram
    1 point
  3. JohnOne

    if , else problem

    If the variable has a value of 0 or == 0 then it is false, if it has any other value it is true. It's the same as... If True Then... You don't need if True = True Then...
    1 point
  4. Inverted

    if , else problem

    $isHidden = False HotKeySet("!x", "msn") Func msn() If $isHidden Then $isHidden = False WinSetState("Calculator", "",@SW_SHOW) Else $isHidden = True WinSetState("Calculator", "",@SW_HIDE) EndIf EndFunc While 1 Sleep(1000) WEnd I tested that with Calculator and it works Maybe you'd also want to do an WinActivate to bring it to front.
    1 point
  5. http://www.debugbar.com/ ?
    1 point
  6. trancexx

    AutoIt v3.3.11.3 Beta

    Compound assignment operators modify the value of a variable by performing an operation on it, they don't return value. When you put expression in parentheses you ask for its value: $x = 3 $b = 2 ($b = -1) ConsoleWrite($b & @CRLF) ...That code is equivalent to: $x = 3 $b = 2 (False) ConsoleWrite($b & @CRLF) Your $iDir *= -1 doesn't yield value and therefore can't be enclosed in parentheses. Some languages work differently.
    1 point
  7. JohnOne

    PixelGetColor problem

    Look at setting pixelcoordmode as well as mousecoordmode.
    1 point
  8. This is an old thread, but it's also one of the first Google results when searching for "autoit get IP," so I thought I'd chime in. _GetIP() will return the external WAN IP address of a device. For the local IP, follow Manish's advice.
    1 point
  9. Try this: #include <IE.au3> $oIE = _IECreate("about:blank", 0, 0) Sleep(1000) _IEAction($oIE, "visible")
    1 point
  10. fuck you if i see you i will fuck you fuck off WTF
    1 point
×
×
  • Create New...