Jump to content

Shane0000

Active Members
  • Posts

    143
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Shane0000's Achievements

  1. You can tell ie to not wait with _IENavigate: _IENavigate ( ByRef $oObject, $sUrl [, $fWait = 1] )
  2. $url = "blablabla.com" $oIE = _IECreate($url) $html = _IEDocReadHTML($oIE) ; get the first page sleep(1000) $res1 = StringRegExp($Html, '(?is)td\h*class="align-c\h*(?:small|big)">([^<]+)', 3) sleep(2000) Wile 1 _IEAction($oIE, "refresh") sleep(1000) $html = _IEDocReadHTML($oIE) ; get the new page $res2 = StringRegExp($Html, '(?is)td\h*class="align-c\h*(?:small|big)">([^<]+)', 3) If $res1[0] <> $res2[1] Then ; do the comparison   EndIf $Res1 = $Res2 Wend Is this the goal ? Should be the same as ""res1[0] with res2[0]".."res2[0] with res3[0]"..."res3[0] with res4[0]"...etc (endless looping) ?"
  3. #include <IE.au3> $oIE = False $sURL = "www.autoit.com/" while 1     If Not(IsObj($oIE)) Then         $oIE = _IEAttach($sURL,"url")         If @error Then             $oIE = _IECreate($sURL)             If @error Then                 ConsoleWrite(@CRLF & "error")             EndIf         EndIf     EndIf     ConsoleWrite(@CRLF & $oIE.Document.Title) wendDoes this work?
  4. Global $Paused = False, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") While 1 Sleep(100) Select Case $Runner And Not($Paused) ConsoleWrite("Running" & @CRLF & "$Runner: " & $Runner & @CRLF & _ "$Paused: " & $Paused & @CRLF) Case Not($Runner) Or $Paused ConsoleWrite("Paused" & @CRLF & "$Runner: " & $Runner & @CRLF & _ "$Paused: " & $Paused & @CRLF) EndSelect WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused ToolTip("$Paused: " & $Paused) EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Runner = Not $Runner EndFuncIs this the goal?
  5. This works for me: Local $sUserName = "xxxx" Local $sPassword = "xxxx" Local $sHostFile = "C:\Windows\System32\drivers\etc\hosts" RunAs($sUserName,@computername,$sPassword,0,"attrib -s -h -r " & $sHostFile) ;RunAs($sUserName,@computername,$sPassword,0,"echo xxx.xxx.xxx.xxx www.google.com" & @CRLF) $hFile = FileOpen($sHostFile, $FO_APPEND) FileWrite($hFile,"echo xxx.xxx.xxx.xxx www.google.com" & @CRLF) FileClose($hFile) Run("Notepad.exe " & $sHostFile) RunAs($sUserName,@computername,$sPassword,0,"attrib +s +h +r " & $sHostFile)
  6. thts not a joke ,its the actual answer ..... There are a lot of problems in your code. firstly, variables are constructed as such $varname, your code has $ varname (space between $ and varname) Secondly I dont think your pause function is doing anything, "$ Not $ Pause Pause =" is not a valid syntax try the suggested code above out and see how it works when ran HotKeySet("{F9}", "display") $pause=True While 1 if not $pause then main() sleep(5) WEnd func display() Switch $pause Case True $pause=False case False $pause=True EndSwitch EndFunc func main() ; YOUR CODE GOES HERE EndFunc
  7. this random shift is in Send and Control Send. I use a loop with ControlSetText() to make sure the edit box gets whats coming to it in a proper fashion $iAttempts = 0 While Not(ControlGetText($hWnd, '', 'Edit1') == $sFileName ) Sleep(250) $iAttempts += 1 ControlSetText($hWnd, '', 'Edit1', $sFileName) If @error Then ConsoleWrite(@ScriptLineNumber & ':' & @error & @TAB & @extended & @CRLF) If $iAttempts >= $iRetry Then SetError(2,1,-1) EndIf WEnd
  8. TimerInit() The link has an example of how to use timerdiff() to retrieve time since timer was initialized
  9. Out of curiosity, What was wrong with the code above? I was able to write an example that converted a string to \u codes. The function posted above converts 1 character at a time. was the encoding backwards? \u codes -> ascii instead of ascii -> \ucodes
  10. Also I dont think {Paste} is a valid keyword, Here is some information on passing control characters and such: https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
  11. sorry edited my OP to a tested method #include <Excel.au3> Run(@ComSpec & " /k cd c:\Users\exam\Desktop\appfolder\", "c:\", @SW_SHOW) ;Opens DOS to the folder where the app is WinActivate("Administrator: C:\Windows\system32\cmd.exe") ClipPut("Test text") WinActivate("Administrator: C:\Windows\system32\cmd.exe") ;ponits focus back to DOS WinWaitActive("Administrator: C:\Windows\system32\cmd.exe") ;activates DOS window for entry Send(ClipGet())
  12. Try Send(ClipGet())This should type out what is in the clipboard
×
×
  • Create New...