Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/02/2012 in all areas

  1. Unfortunately you'll have to wait for someone much more intelligent than I to wander by. StringRegExp make my eyes bleed
    1 point
  2. Hi, Crazyace, are you talking grabbing the output from a cmd window? If so, something like this may help: #include <Constants.au3> $net = Run(@ComSpec & " /c ping 192.168.1.1", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($net) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend
    1 point
  3. Try this, I don't have the information for your $versL so I commented it out, but it should work as written to demonstrate how to see that the radio button was clicked. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> EBMAIN() Func EBMAIN() Local $main GUICreate("My GUI", 600, 400) GUICtrlCreateGroup("Path", 20, 14, 160, 90) $assR = GUICtrlCreateRadio("Test Assigned", 24, 30, 150, 20) $appR = GUICtrlCreateRadio("Testing Approved", 24, 50, 150, 20) $mapB = GUICtrlCreateButton("Map", 20, 200, 100, 35) GUISetState(@SW_SHOW) While 1 $main = GUIGetMsg() Switch $main Case $GUI_EVENT_CLOSE Exit Case $mapB If GUICtrlRead($assR) = 1 Then ; guictrl read displays test assigned MsgBox(0, "Button clicked", "radio button = " & GUICtrlRead($assR, 1)) ElseIf GUICtrlRead($appR) = 1 Then ; why is this returning 5? MsgBox(0, "button clicked", "radio button = " & GUICtrlRead($appR, 1)) Else MsgBox(0, "try again", "try again!") EndIf Case $assR MsgBox(64, "", "Test Assigned clicked") ;~ GUICtrlSetData($versL, "12.0|11.1|11.0|10.8|10.7|10.6|10.5|10.4|10.3|10.2|10.1|10.0") Case $appR MsgBox(64, "", "Testing Approved clicked") EndSwitch WEnd GUIDelete() EndFunc ;==>EBMAIN
    1 point
  4. Be honest, are you making a game-bot. If yes, then u have bumped at the wrong place!!! If not, what is this 'Fairyland' that you are referring to? The mods have a good vision... you have been warned! You are asking for help in example scripts section, instead of General Help and Support Regards
    1 point
  5. Thanks for your support !
    1 point
  6. This is code to click button in IE but I don't know how to click a button in firefox ? #include $oIE = _IECreate("http://www.autoitscript.com") $sMyString = "Contact";Your link text $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next Can you help me, please ?
    1 point
  7. For Internet Explorer, there's the IE.au3 UDF, part of native AutoIt. There's a for Firefox.
    1 point
  8. Great UDF congratulations
    1 point
  9. I don't know why I can't edit posts after I reloggedin. I had another little idea optimizing the last tiny bit of speed... >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\user\BWI\AutoIt\numbers.au3" ----------SHORT TEST---------- Generating random numbers...Done ! Doing test A...Done ! Result : 0.24618 sec(s) Doing test B...Done ! Result : 0.12587 sec(s) Doing test C...Done ! Result : 0.06766 sec(s) ----------LONG TEST---------- Generating random numbers...Done ! Doing test A...Done ! Result : 7.46660 sec(s) Doing test B...Done ! Result : 3.72427 sec(s) Doing test C...Done ! Result : 2.36960 sec(s) >Exit code: 0 Time: 15.797 Only posting my optimizations... For full code snip it from my previous post. I added the default value at index 0. This saves a subtraction by 1 every time. Then I just changed the global Array to have mixed content (strings and integers) which will save another comparison everytime and allows to return the result immediately. I know one shouldn't do this, but for the result is static it doesn't mess anything. There are 59 spaces in my array by the way. This optimization saves a peek over a third (36,3%) instead of a fourth compared to my nested switch-blocks before and a peek over two thirds (68,2%) compared to the linear switch-block of Valuater and FireFox. Global $a_Keys[166] = [-1, "LeftMouse", "RightMouse", -1, "MiddleMouse", "X1Mouse", "X2Mouse", -1, _ "BACKSPACE", "TAB", -1, -1, "CLEAR", "ENTER", -1, -1, "SHIFT", "CTRL", "ALT", "PAUSE", _ "CAPSLOCK", -1, -1, -1, -1, -1, -1, "ESC", -1, -1, -1, -1, "SPACEBAR", "PAGE UP", "PAGE DOWN", _ "END", "HOME", "LEFT", "UP", "RIGHT", "DOWN", "SELECT", "PRINT", "EXECUTE", "PRINT SCREEN", _ "INS", "DEL", -1, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", -1, -1, -1, -1, -1, -1, _ -1, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", _ "S", "T", "U", "V", "W", "X", "Y", "Z", "LWin", "RWin", -1, -1, -1, "0'", "1'", "2'", "3'", _ "4'", "5'", "6'", "7'", "8'", "9'", "Multiply", "Add", "Separator", "Subtract", "Decimal", _ "Divide", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", _ -1, -1, "F16", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "NUM LOCK", _ "SCROLL LOCK", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "LSHIFT", "RSHIFT", _ "LCTRL", "RCTRL", "LMENU", "RMENU"] ; #FUNCTION# =================================================================== ; Name : __GetKeyByHex_ArrayBased_Samoth2 ; Description: Returns Aplha key for specified key ; Parameter(s): None ; Requirement(s): None ; Return Value(s): On Success - Returns Key ; On Failure - Returns -1 ; Author(s): Samoth ; Note(s): Thanks Valuater... 8) ;=============================================================================== Func __GetKeyByHex_ArrayBased_Samoth2($iKeyIn = 0) $iKeyIn = Dec($iKeyIn) If $iKeyIn > 165 Then Return -1 Return $a_Keys[$iKeyIn] EndFunc ;==>__GetKeyByHex_ArrayBased_Samoth2
    1 point
×
×
  • Create New...