Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/04/2017 in all areas

  1. Edit 2017/01/31 : Added functions _Printmgr_AddLPRPort and _Printmgr_RemoveLPRPort Edit 2017/04/02 : Added functions _Printmgr_EnumPorts, _Printmgr_PortExists, _Printmgr_PrinterSetDriver and _Printmgr_PrinterSetPort . Special thanks to @Danyfirex for his contribution with EnumPorts.
    1 point
  2. Sorry, I was looking at this code: $sHost = StringRegExpReplace($sHeader, '(?is).*Host:\s(.*?)\r\n.*', '\1') $sHost = StringRegExpReplace($sHost, '(:.*)', '') I just realised that it is not parsing the JS . And sorry again, I will mind my own business from now on.
    1 point
  3. careca

    Loop getting stuck

    #include <File.au3> #include <Array.au3> Local $debug = True Local Const $Map_Settings = @ScriptDir & '\Map Settings.log' Global $True = "True" Global $False = "False" $handle_read = FileOpen($Map_Settings) Local $iCountLines = _FileCountLines($Map_Settings) While 1 For $l = 1 to $iCountLines $line_read = FileReadLine($handle_read) If @error Then ExitLoop If $debug Then ConsoleWrite('Read Line: ' & $line_read & @CRLF) If StringInStr($line_read, $True, 2, 1) Then ConsoleWrite('Result - '& $True &' - '&@MSEC&@CRLF) ;RunWait(@AutoItExe & ' "' & @ScriptDir & '\Directories\Scripts\[0] Monitor Log\Monitor.exe"') Monitor($True) ExitLoop EndIf If StringInStr($line_read, $False, 2, 1) Then ;RunWait(@AutoItExe & ' "' & @ScriptDir & '\E3.exe"') E3EXE($False) ExitLoop EndIf Next Sleep(100) WEnd Func Monitor($True) ConsoleWrite(' - '& $True &' - '&@MSEC&@CRLF) EndFunc Func E3EXE($False) ConsoleWrite(' - '& $False &' - '&@MSEC&@CRLF) EndFunc Line-by-line and functions.
    1 point
  4. Subz

    Loop getting stuck

    This is what I meant by putting it into an Array, unfortunately I'm only guessing what the Search Criteria is and also the command line PS: Why do you use @AutoItExe in your command lines since the scripts are already compiled as .exe? Local $debug = True #include <Array.au3> Global $aSearch[4][3] $aSearch[0][0] = 3 ;~ Search Explorer Criteria $aSearch[1][0] = 'Explorer=true' ;~ Result for Search Explorer Critera initially set to false $aSearch[1][1] = False ;~ ArcGIS Explorer Commandline $aSearch[1][2] = @AutoItExe & ' "' & @ScriptDir & '\E3.exe"' ;~ Search Settings Criteria $aSearch[2][0] = 'Settings=true' ;~ Result for Search Settings Critera initially set to false $aSearch[2][1] = False ;~ ArcGIS Settings Commandline $aSearch[2][2] = @AutoItExe & ' "' & @ScriptDir & '\Settings.exe"' ;~ Search Monitor Criteria $aSearch[3][0] = 'Monitor=true' ;~ Result for Search Monitor Critera initially set to false $aSearch[3][1] = False ;~ ArcGIS Monitor Commandline $aSearch[3][2] = @AutoItExe & ' "' & @ScriptDir & '\Directories\Scripts\[0] Monitor Log\Monitor.exe"' For $x = 1 To $aSearch[0][0] $aSearch[$x][1] = _ReadLogFile($aSearch[$x][0]) ;~ Uncomment the line below to Run the executable ;~ If $aSearch[$x][1] = True Then RunWait($aSearch[$x][2]) Next _ArrayDisplay($aSearch) Func _ReadLogFile($sSearch) Local $line_read Local $Map_Settings = @ScriptDir & '\Map Settings.log' Local $handle_read = FileOpen($Map_Settings, 0) While 1 ; read each line from a file $line_read = FileReadLine($handle_read) ; exit the loop if end of file If @error Then ExitLoop If $debug Then ConsoleWrite('Read Line: ' & $line_read & @CRLF) If StringInStr($line_read, $sSearch) Then Return True WEnd ;~ $sSearch was not found Return False EndFunc
    1 point
×
×
  • Create New...