Jump to content

ofLight

Active Members
  • Posts

    277
  • Joined

  • Last visited

Everything posted by ofLight

  1. Thank you Ascend4nt. That worked
  2. There are two InternetExplorer.Application objects on x64-bit systems, one for x32 bit, the other for x64. By default, the x64 bit version is launched when you call the object from IE.au3._IECreateEmbedded() . Does anyone know of an equivalent method for creating a Webbrowser object useing the x86 IE version on a x64 OS?
  3. Maybe someone could help me Identify what this issue would be called? I am falling short on my searches for related issues since im not sure exactly what to solve for .
  4. The issue I am seeing is content from one tab appearing within another tab. I know my explanation suxx, so I have posted an example of the issue. If you run this script and switch to Tab2 or 3, usually within 30sec you will begin to see content from a different tab appearing on the current tab. Any help or suggestions on a what ive got wrong here would be greatly appreciated. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <IE.au3> _BootBars() Func _BootBars() ;$username = '*****' ;$password = '*****' $path = "http://www.autoitscript.com" $iBoot_1 = "www.yahoo.com" $iBoot_2 = "www.google.com" $iBoot_3 = "www.bing.com" $iBoot_4 = "" _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () $Sub = GUICreate("BootBars", 740, 620, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 750, 560) $BB_Tab = GUICtrlCreateTab(1,1,738,618) GUICtrlCreateTabItem('Dell KVM') _IENavigate ($oIE, $path) ;$oForm = _IEFormGetObjByName ($oIE, 0) ;$oText = _IEFormElementGetObjByName ($oForm, "UsernameEdit") ;_IEFormElementSetValue ($oText, $username) ;$oText = _IEFormElementGetObjByName ($oForm, "PasswordEdit") ;_IEFormElementSetValue ($oText, $password) ;_IEFormSubmit ($oForm,0) GUICtrlCreateTabItem(' BootBar_1 ') $oIE_BB1 = _IECreateEmbedded () $GUIActiveX_1 = GUICtrlCreateObj($oIE_BB1, 10, 40, 750, 560) _IENavigate ($oIE_BB1, $iBoot_1) ;$oForm1 = _IEFormGetObjByName ($oIE_BB1, 0) ;$oText1 = _IEFormElementGetObjByName ($oForm1, "name") ;_IEFormElementSetValue ($oText1, $username) ;$oText1 = _IEFormElementGetObjByName ($oForm1, "password") ;_IEFormElementSetValue ($oText1, $password) ;_IEFormSubmit ($oForm1,0) GUICtrlCreateTabItem(' BootBar_2 ') $oIE_BB2 = _IECreateEmbedded () $GUIActiveX_2 = GUICtrlCreateObj($oIE_BB2, 10, 40, 750, 560) _IENavigate ($oIE_BB2, $iBoot_2) ;$oForm2 = _IEFormGetObjByName ($oIE_BB2, 0) ;$oText2 = _IEFormElementGetObjByName ($oForm2, "name") ;_IEFormElementSetValue ($oText2, $username) ;$oText2 = _IEFormElementGetObjByName ($oForm2, "password") ;_IEFormElementSetValue ($oText2, $password) ;_IEFormSubmit ($oForm2,0) GUICtrlCreateTabItem(' BootBar_3 ') $oIE_BB3 = _IECreateEmbedded () $GUIActiveX_3 = GUICtrlCreateObj($oIE_BB3, 10, 40, 750, 560) _IENavigate ($oIE_BB3, $iBoot_3) ;$oForm3 = _IEFormGetObjByName ($oIE_BB3, 0) ;$oText3 = _IEFormElementGetObjByName ($oForm3, "name") ;_IEFormElementSetValue ($oText3, $username) ;$oText1 = _IEFormElementGetObjByName ($oForm3, "password") ;_IEFormElementSetValue ($oText3, $password) ;_IEFormSubmit ($oForm3,0) GUICtrlCreateTabItem(' BootBar_4 ') $oIE_BB4 = _IECreateEmbedded () $GUIActiveX_4 = GUICtrlCreateObj($oIE_BB4, 10, 40, 750, 560) _IENavigate ($oIE_BB4, $iBoot_4) ;$oForm4 = _IEFormGetObjByName ($oIE_BB4, 0) ;$oText4 = _IEFormElementGetObjByName ($oForm4, "name") ;_IEFormElementSetValue ($oText4, $username) ;$oText4 = _IEFormElementGetObjByName ($oForm4, "password") ;_IEFormElementSetValue ($oText4, $password) ;_IEFormSubmit ($oForm4,0) GUICtrlCreateTabItem('') GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop sleep(10) WEnd GUIDelete($Sub) EndFunc
  5. $i = 1 Do For $j = 1 to $i Send("{DOWN}") Next $i += 1 Until $i = 4 This works aswell $i = 1 Do $sSends = '{DOWN '&$i&'}' Send($sSends) $i += 1 Until $i = 4
  6. Ironically You just missed a Zero 8 inputes to fully specify a searchbox. _PixelFindAll($pixel[, $XDist, $YDist, $sv, $SB_l, $SB_t, $SB_r, $SB_b]) #include <Array.au3> $colour = 16777118 $coord1 = _PixelFindAll($colour,0,0,0,0,0,@DesktopWidth,@DesktopHeight) If IsArray($coord1) Then _ArrayDisplay($coord1) For $i = 1 to $coord1[0][0] IniWrite(".\Pixel.ini","Main","X_PixelPos_"&$i,$coord1[$i][0]) IniWrite(".\Pixel.ini","Main","Y_PixelPos_"&$i,$coord1[$i][1]) Next Else MsgBox(0,"Error","error") EndIf Edit: forgot to test the ini write part, muh bad
  7. I agree, i hope u mean cmd not dos Somthin like this Opt("WinTitleMatchMode", 2) $Inpute = InputBox('which sensors?','input the sensor #') ControlSend("cmd.exe","","",$Inpute&"{enter}")
  8. Func _DriveMap() DriveMapDel("P:") DriveMapDel("S:") DriveMapAdd("S:", "\\share1$", 1) DriveMapAdd("P:", "\\share2$", 1) $S = DriveMapGet("S:") $P = DriveMapGet("P:") If $S = "\\share1$" Then GUICtrlSetState($PS,Chr(214)) If $P = "\\share2$" Then GUICtrlSetState($PC,Chr(214)) EndFunc ;==>_DriveMap
  9. I believe all you need to do is add this to the bottom of the _DriveMap Func. You will also need to set $P and $PC as Globals. If $P = "\\share1$" Then $PC = GUICtrlCreateLabel(Chr(214), 227, 174, 41, 17) ;the "checkmark" GUICtrlSetFont(-1, 9, 700, 4, "Symbol") GUICtrlSetColor(-1, 0x008000) EndIf GUISetState() EDIT: mu bad, was in a hurry... $P = DriveMapGet("P:") If $P = "\\share1$" Then GUICtrlSetState($PC,Chr(214))
  10. Pnot, I would need to see your full code to make an appropriate suggestion. In most cases I would make a Function that updates the checks Mapped drives and updates the GUI accordingly. Then have this function as the last part of _DriveMap().
  11. With this you should get sequences of a's if the cursor is in an editor. $begin = TimerInit() Do Send('a') Until TimerDiff($begin) > 1000
  12. This is alittle bloated for what you want, but may help. Ripped it from some code I use and threw a basic GUI in the format you showed above. #include <Array.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $array = _NicToggle('Display') _RenderGUI($array,"MYIT Support Tool") Func _RenderGUI($array,$GuiName) Local $offset1 = 0 $hGUI = GUICreate($GuiName, 500, 150) For $i = 1 to $array[0][0] GUICtrlCreateLabel($array[$i][1],26, 31+$offset1,200,17) GUICtrlCreateLabel($array[$i][3],246, 31+$offset1,70,17) GUICtrlCreateLabel($array[$i][5],346, 31+$offset1,90,17) $offset1 = $offset1+20 Next GUICtrlCreateGroup('Network Connection ID',20,15,186,$offset1+20,$BS_Center) GUICtrlCreateGroup('IP',240,15,96,$offset1+20,$BS_Center) GUICtrlCreateGroup('Gateway',340,15,96,$offset1+20,$BS_Center) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Sleep(10) ;Dont Eat my CPU WEnd EndFunc ;=============================================================================== ; ; Description: Display/Enable/Dissable any Nics via MAC/IP/Name ; ; Syntax: _NicToggle('DisAble','Local Area Connection 2') ; ; Parameter(s): $action = 'Display': Returns Array of all Nics ; 'DisAble': DisAbles specified Nic ; 'Enable': Enables specified Nic ; ; $NetName = If Enable/DisAble then Specify the Nic Name ; ; Requirement(s): None ; ; Author(s): ; ;=============================================================================== Func _NicToggle($action = 'Display',$NetName = '0') Local $output[1][6] = [['0','ID','Status','IPAddress','MACAddress','Gateway']] Local $strComputer = "." Local $objNetwork = ObjCreate("WScript.Network") $strComputer = $objNetwork.ComputerName Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration") Local $IP, $o_WMIService, $a_CollectedConnections For $objItem In $colItems $IP = $objItem.IPAddress(0) $o_WMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $a_CollectedConnections = $o_WMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", 0x20 + 0x10) For $o_ConnectionItem In $a_CollectedConnections If $o_ConnectionItem.NetConnectionID <> "" And $o_ConnectionItem.MACAddress = $objItem.MACAddress Then $skip = 0 For $i = 1 to $output[0][0] If $o_ConnectionItem.NetConnectionID = $output[$i][1] Then $skip = 1 ;Duplicate reported EndIf Next ;MsgBox(0,'$skip ='&$skip ,$o_ConnectionItem.NetConnectionID) If $skip = 0 Then ReDim $output[$output[0][0]+2][6] $output[0][0] = $output[0][0]+1 $output[$output[0][0]][1] = $o_ConnectionItem.NetConnectionID $output[$output[0][0]][2] = $o_ConnectionItem.NetConnectionStatus $output[$output[0][0]][3] = $objItem.IPAddress(0) $output[$output[0][0]][4] = $o_ConnectionItem.MACAddress $output[$output[0][0]][5] = $objItem.DefaultIPGateway(0) EndIf EndIf Next Next If $action = 'DisAble' Then if $NetName = '0' Then MsgBox(0,'CRITICAL ERROR','Must provide a name to Disable') Else If @OSVersion = 'WIN_XP' Then ;Tested: XPx86 RunWait(@ComSpec&' /c devcon.exe disable "'&String($NetName)&'"', "", @SW_HIDE) ElseIf @OSVersion = 'WIN_2008' and FileExists('X:\windows\system32') Then ;Tested: PE _Nic_NetCC($NetName, 0) ElseIf @OSVersion = 'WIN_2003' or @OSVersion = 'WIN_2008' or @OSVersion = 'WIN_VISTA' Then ;Tested: 2k3x64, _Nic_NetCC($NetName, 0) EndIf EndIf ElseIf $action = 'Enable' Then if $NetName = '0' Then MsgBox(0,'CRITICAL ERROR','Must provide a name to Enable') Else If @OSVersion = 'WIN_XP' Then ;Tested: XPx86 RunWait(@ComSpec&' /c devcon.exe enable "'&String($NetName)&'"', "", @SW_HIDE) ElseIf @OSVersion = 'WIN_2008' and FileExists('X:\windows\system32') Then ;Tested: PE _Nic_NetCC($NetName, 1) ElseIf @OSVersion = 'WIN_2003' or @OSVersion = 'WIN_2008' or @OSVersion = 'WIN_VISTA' Then ;Tested: 2k3x64, _Nic_NetCC($NetName, 1) EndIf EndIf Else ;Display Output Return $output EndIf EndFunc Func _Nic_NetCC($oLanConnection, $iFlag);0 = Disable connection, 1 = Enable connection (default) If @OSTYPE <> "WIN32_NT" Then Return SetError(1, 0, 0) ; Control OS type. If StringInStr("WIN_2000,WIN_XP,WIN_2003", @OSVersion) Then ;W2K/XP/W2K3 $Res = _Nic_NetCCWin32($oLanConnection, $iFlag, 1) Else ;Vista/W2K8 If $iFlag = 3 Then Return SetError(5, 0, 0) $Res = _Nic_NetCCWin32New($oLanConnection, $iFlag, 1) EndIf Return SetError(@error, @extended, $Res) EndFunc Func _Nic_NetCCWin32($oLanConnection, $iFlag = 1, $iFullName = 1); Only for W2K/XP/W2K3 Local $objShell, $objFolder $objShell = ObjCreate("Shell.Application") If Not IsObj($objShell) Then Return SetError(2, 0, 0) $objFolder = $objShell.NameSpace(0x31) If Not IsObj($objFolder) Then Return SetError(3, 0, 0) ; Find the collection of the network connection name. For $LanItem In $objFolder.Items If StringLower($LanItem.Name) = StringLower($oLanConnection) Then $oLanConnection = $LanItem ExitLoop EndIf Next ; If no network connection name then return error. If Not IsObj($oLanConnection) Then Return SetError(3, 0, 0) $oEnableVerb = "" $oDisableVerb = "" ; Find the state of the network connection. For $Verb In $oLanConnection.Verbs If $Verb.Name = "En&able" Then $oEnableVerb = $Verb If Not IsObj($oEnableVerb) Then Return SetError(5, 0, 0) $State = 0 EndIf If $Verb.Name = "Disa&ble" Then $oDisableVerb = $Verb If Not IsObj($oDisableVerb) Then Return SetError(5, 0, 0) $State = 1 EndIf If $Verb.Name = "Re&pair" Then $oRepairVerb = $Verb If Not IsObj($oRepairVerb) Then Return SetError(5, 0, 0) EndIf Next ; Return State If $iFlag = 4 Then Return $State ; Repair Net Connection ElseIf $iFlag = 3 And $State = 1 Then $oRepairVerb.DoIt ; Toggle Net Connection ElseIf $iFlag = 2 Then If $State = 1 Then $oDisableVerb.DoIt Else $oEnableVerb.DoIt EndIf ; Enable Net Connection ElseIf $iFlag = 1 And $State = 0 Then $oEnableVerb.DoIt ; Disable Net Connection ElseIf $iFlag = 0 And $State = 1 Then $oDisableVerb.DoIt ; Else there is an error Else Return SetError(5, 0, 0) EndIf ; Loop to wait change state (for changing state of more than one connection). $begin = TimerInit() While 1 $dif = Int(TimerDiff($begin) / 1000) If $dif > 10 Then ExitLoop ; Control the state of the NIC to exit before the end of waiting time. If $iFlag = 3 And _Nic_NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 2 And $State = 1 And _Nic_NetCCWin32($oLanConnection, 4) = 0 Then ExitLoop If $iFlag = 2 And $State = 0 And _Nic_NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 1 And _Nic_NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 0 And _Nic_NetCCWin32($oLanConnection, 4) = 0 Then ExitLoop Sleep(100) WEnd ; Set the return value of the function. $Res = _Nic_NetCCWin32($oLanConnection, 4) If $iFlag = 4 And $Res = 1 Then Sleep(3000) Return 1 ElseIf $iFlag = 1 And $Res = 0 Then Return 0 ElseIf $iFlag = 0 And $Res = 1 Then Return 0 Else Return 1 EndIf EndFunc Func _Nic_NetCCWin32New($oLanConnection, $iFlag = 1, $iFullName = 1); Only for Vista/W2K8 Local $objWMIService, $colItems, $iModState = 0 $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", 0x30) If Not IsObj($colItems) Then Return SetError(4, 0, 0) ; Change NIC state of $oLanConnection ; Check name of the connection For $objItem In $colItems If $objItem.NetConnectionID = $oLanConnection Then ; Check State. If $iFlag = 4 Then If $objItem.NetEnabled = True Then Return 1 Else Return 0 EndIf Else ; Change the State of Net Connection. ; Disable Net Connection If $iFlag = 0 And $objItem.NetEnabled = True Then $objItem.Disable ; Enable Net Connection ElseIf $iFlag = 1 And $objItem.NetEnabled = False Then $objItem.Enable ; Toggle Net Connection ElseIf $iFlag = 2 Then If $objItem.NetEnabled = True Then $objItem.Disable $State = 1 Else $objItem.Enable $State = 0 EndIf EndIf ; One change be done. $iModState = 1 EndIf ExitLoop EndIf Next ; If no connection then error. If $iModState = 0 Then Return SetError(3, 0, 0) ; Loop to wait state change. If $iFlag = 4 Then While $iFlag <> _Nic_NetCCWin32New($oLanConnection, 4) Sleep(250) WEnd Else Sleep(1000) If $iFlag = 2 Then If $State = 0 And _Nic_NetCCWin32New($oLanConnection, 4) = 1 Then Return 1 ElseIf $State = 1 And _Nic_NetCCWin32New($oLanConnection, 4) = 0 Then Return 1 Else Return 0 EndIf ElseIf $iFlag = 1 And _Nic_NetCCWin32New($oLanConnection, 4) = 1 Then Return 1 ElseIf $iFlag = 0 And _Nic_NetCCWin32New($oLanConnection, 4) = 0 Then Return 1 Else Return 0 EndIf EndIf EndFunc
  13. I dont fully understand what you are asking . I can provide basic Example Use code: #include <WinAPI.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <Array.au3> While 1 $pos = MouseGetPos() $pix = _oL_SaveScreen_ToHex($pos[0]-1,$pos[1]-1,$pos[0],$pos[1]) ;_ArrayDisplay($pix) ToolTip($pix[1][1]) Sleep(10) WEnd Func _oL_SaveScreen_ToHex($Left,$Top,$Right,$Bottom) $X = ($Right-$Left) $Y = ($Bottom-$Top) Dim $Output[($X+1)][($Y+1)] $Output[0][1] = $X ;How manny colomns $Output[1][0] = $Y ;How manny Rows $hBmp = _ScreenCapture("",$Left,$Top,$Right,$Bottom) ;$hBmp = _ScreenCapture_Capture("",$Left,$Top,$Right,$Bottom) $aSize = DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $hBmp, 'int', 0, 'ptr', 0) If $aSize[0] Then $Bits = DllStructCreate('byte[' & $aSize[0] & ']') DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $hBmp, 'int', $aSize[0], 'ptr', DllStructGetPtr($Bits)) $BitHex = Hex(DllStructGetData($Bits, 1)) EndIf _WinAPI_DeleteObject($hBmp) For $i = 1 to $X For $j = 1 to $Y $result = StringLeft($BitHex, 8) $Output[$i][$j] = $result $BitHex = StringTrimLeft($BitHex, 8) Next Next Return $Output EndFunc Func _ScreenCapture($sFileName = "", $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1) Local $iH, $iW, $hWnd, $hDDC, $hCDC, $hBMP, $aCursor, $aIcon If $iRight = -1 Then $iRight = _WinAPI_GetSystemMetrics($SM_CXSCREEN) If $iBottom = -1 Then $iBottom = _WinAPI_GetSystemMetrics($SM_CYSCREEN) If $iRight < $iLeft Then Return SetError(-1, 0, 0) If $iBottom < $iTop Then Return SetError(-2, 0, 0) $iW = $iRight - $iLeft $iH = $iBottom - $iTop $hWnd = _WinAPI_GetDesktopWindow() $hDDC = _WinAPI_GetDC($hWnd) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iW, $iH) _WinAPI_SelectObject($hCDC, $hBMP) _WinAPI_BitBlt($hCDC, 0, 0, $iW, $iH, $hDDC, $iLeft, $iTop, $SRCCOPY) _WinAPI_ReleaseDC($hWnd, $hDDC) _WinAPI_DeleteDC($hCDC) If $sFileName = "" Then Return $hBMP _ScreenCapture_SaveImage($sFileName, $hBMP) _WinAPI_DeleteObject($hBMP) EndFunc
  14. I am uncertain how to rotate a display purely using AutoIt. I have seen options for rotating a display built into both Nvidia and ATI card control panels, Although its not like a free floating rotation, its rotate by set increments.
  15. This is the method I use for pulling pixel info from Flash or Java based apps. ;================================= oL_SaveScreen_ToHex ======================= ; Function Name: __oL_SaveScreen_ToHex ; Requires: <WinAPI.au3> ; Description: ; Parameters: $Array 2 deminsional Array of Hex Colors ; ; EG: $BitHex = _ScreenCapture_ToHex($pos[0]-25,$pos[1]-25,$pos[0]+25,$pos[1]+25) ; Syntax: _oL_SaveScreen_ToHex($Left,$Top,$Right,$Bottom) ; Author(s): ofLight ; Returns: $Array[$Total_X][$Total_Y] ;================================================================================= Func _oL_SaveScreen_ToHex($Left,$Top,$Right,$Bottom) $X = ($Right-$Left) $Y = ($Bottom-$Top) Dim $Output[($X+1)][($Y+1)] $Output[0][1] = $X ;How manny colomns $Output[1][0] = $Y ;How manny Rows $hBmp = _ScreenCapture("",$Left,$Top,$Right,$Bottom) $aSize = DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $hBmp, 'int', 0, 'ptr', 0) If $aSize[0] Then $Bits = DllStructCreate('byte[' & $aSize[0] & ']') DllCall('gdi32.dll', 'int', 'GetBitmapBits', 'ptr', $hBmp, 'int', $aSize[0], 'ptr', DllStructGetPtr($Bits)) $BitHex = Hex(DllStructGetData($Bits, 1)) EndIf _WinAPI_DeleteObject($hBmp) For $i = 1 to $X For $j = 1 to $Y $result = StringLeft($BitHex, 8) $Output[$i][$j] = $result $BitHex = StringTrimLeft($BitHex, 8) Next Next Return $Output EndFunc;========================== oL_SaveScreen_ToHex =======================
  16. Example: $variable = "D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\" FileMove($variable&"index1.htm", $variable&"index1.htm",1) Example2: $title = "NewFileName" FileMove("D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\index1.htm", "D:\Documents and Settings\Taevon Jones\My Documents\One a be HyperVRE Webpages\christmas greetings\"&$title&".htm",1)
  17. you should be able to use your latter method aswell, if I am understanding the question correctly. When u first declare an array as $array[3] you need to keep in mind when later calling it the enumeration starts at 0 not 1 so... ;This will Work global $f00[4][3] $f00[0][0] = '1 of 3' $f00[0][1] = '2 of 3' $f00[0][2] = '3 of 3' MsgBox(0,'',$f00[0][2]) ;This will ERROR out global $f00[4][3] $f00[0][1] = '1 of 3' $f00[0][2] = '2 of 3' $f00[0][3] = '3 of 3' MsgBox(0,'',$f00[0][3])
  18. I would check to see if the Pause Key is already mapped in the Game. Easiest way you could check this would be to change your Hotkey from {Pause} to something Obscure like CTRL+ALT+P
  19. you can Use FileRead() and StringReplace() , Both are fast,consistant and act completely in the background. Much better than useing notepad imho
  20. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 1) GUICreate("My GUI",600,50) $id_Checkbox_01 = GUICtrlCreateCheckbox('If I am Checked, Text will be inserted into a command window as soon as it is manually started.',20,20) GUISetState(@SW_SHOW) While 1 ; Run the GUI until the dialog is closed $msg = GUIGetMsg() if ProcessExists('cmd.exe') and GUICtrlRead($id_Checkbox_01) = $GUI_CHECKED Then ControlSend('C:\WINDOWS\','','','Inserted Text') GUICtrlSetState($id_Checkbox_01,$GUI_UNCHECKED ) ; ONLY Send ONCE EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete()
  21. instead of useing ProccessWait, place something like this in your primary loop if ProcessExists() and GUICtrlRead() = $GUI_CHECKED Then
  22. #include <file.au3> _CreateTaggedKeywords() Func _CreateTaggedKeywords() Dim $aRecords $PthFile = 'C:\Documents and Settings\ofLight\Desktop\Keywords.txt' ;Full path and filename to read $outputFileName = 'C:\Documents and Settings\ofLight\Desktop\TAGGED_Keywords.txt' If Not _FileReadToArray($PthFile,$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf $file = FileOpen($outputFileName, 2) For $x = 1 to $aRecords[0] FileWriteLine($file, '<tag'&$x&'>'&$aRecords[$x]&'<tag'&$x&'/>' & @CRLF) Next FileClose($file) EndFunc
  23. Something like this I think ? Case $Buttonloadsetup $var2 = FileOpenDialog( "Choose a setup.", $MyDocsFolder, "Rfini (*.RFI)", 2) $File = FileOpen ( $var2 , 0 ) $Data = FileRead($File) FileClose ( $File );close the file GUICtrlSetData ( $Edit1 , StringMid($Data,1,StringInStr($Data,"-----end of part 1-----")) ) GUICtrlSetData ( $Edit11 , StringMid($Data,StringInStr($Data,"-----end of part 1-----")),StringInStr($Data,"-----end of part 2-----")) ) GUICtrlSetData ( $EditC , StringMid($Data,StringInStr($Data,"-----end of part 2-----")),StringInStr($Data,"-----end of part 3-----")) ) Edit: extra code was in there
  24. $var = FileOpenDialog("", @ScriptDir, "All (*.*)" ) $file = FileOpen($var, 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $chars = FileRead($file) FileClose($file) $posStart = StringInStr($chars,'<title>') $posEnd = StringInStr($chars,'</title>') If $posStart = 0 or $posEnd = 0 Then MsgBox(0,'','This File doesnt Contain a Title') Else $result = StringMid($chars,$posStart+7,$posEnd-($posStart+7)) MsgBox(0,'',$result) EndIf
  25. The autoIt Wait command is "Sleep", so it would be.... Run("notepad.exe") Sleep(20000) Send("{ENTER}")
×
×
  • Create New...