Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/2020 in all areas

  1. Nice misdirection with the “post screenshot in a different language” bit And to think I was this close from switching my default language from bland English to an to an exciting, if unfamiliar one just to give you some lingual diversity. I would have but I was worried about logging back in in Afrakan...
    1 point
  2. Zedna

    convert tabs to spaces

    Speed optimization of latest Nine's code: In StringInStr() and StringReplace() use CaseSense=1, this is MUCH faster orig: Func _TabsToSpaces($sString, $iTabLen = 8) Local $iMod, $iSpaceLeft Local $iTabPos = StringInStr($sString, @TAB) While $iTabPos $iMod = Mod($iTabPos, $iTabLen) $iSpaceLeft = $iMod ? $iTabLen - $iMod : 0 $sString = StringReplace($sString, Chr(9), _StringRepeat(" ", $iSpaceLeft + 1), 1) $iTabPos = StringInStr($sString, @TAB) WEnd Return $sString EndFunc ;==>_TabsToSpaces optimised: Func _TabsToSpaces($sString, $iTabLen = 8) Local $iMod, $iSpaceLeft Local $iTabPos = StringInStr($sString, @TAB, 1) While $iTabPos $iMod = Mod($iTabPos, $iTabLen) $iSpaceLeft = $iMod ? $iTabLen - $iMod : 0 $sString = StringReplace($sString, Chr(9), _StringRepeat(" ", $iSpaceLeft + 1), 1, 1) $iTabPos = StringInStr($sString, @TAB, 1) WEnd Return $sString EndFunc ;==>_TabsToSpaces
    1 point
  3. 1 point
  4. Hey, You need to find out the start time and calculate elapsed time every now often, and put that in an if statement. I don't know the exact AutoIt functions, so please search for them, but the algortihm would look something like: While 1 Opt("PixelCoordMode", 1) $DetectarBoya = PixelSearch(52,220,54,223,0xE7EAEA,10,1) Local $iStartTime = Get Current Time Do $DetectarBoya = PixelSearch(52,220,54,223,0xE7EAEA,10,1) Local $iCheckTime = Get Current Time Until @error Or $iCheckTime-$iStartTime >= 60000 WEnd Just make sure the time format from the time function and condition (milliseconds in your case) is same
    1 point
  5. Nine

    convert tabs to spaces

    497 ms : #include <String.au3> #include <File.au3> Local $hTimer = TimerInit() Local $aFileLines _FileReadToArray("Temp\AutoIt3Wrapper.au3",$aFileLines) if @error Then Exit MsgBox ($MB_SYSTEMMODAL,"",@error) For $i = 1 to $aFileLines[0] $aFileLines[$i] = _TabsToSpaces($aFileLines[$i]) Next _FileWriteFromArray("Temp\AutoIt3Wrapper New.au3",$aFileLines,1) MsgBox ($MB_SYSTEMMODAL,"",TimerDiff($hTimer)) Func _TabsToSpaces($sString, $iTabLen = 8) Local $iMod, $iSpaceLeft Local $iTabPos = StringInStr($sString, @TAB) While $iTabPos $iMod = Mod($iTabPos, $iTabLen) $iSpaceLeft = $iMod ? $iTabLen - $iMod : 0 $sString = StringReplace($sString, Chr(9), _StringRepeat(" ", $iSpaceLeft + 1), 1) $iTabPos = StringInStr($sString, @TAB) WEnd Return $sString EndFunc ;==>_TabsToSpaces
    1 point
  6. Thank you for your interest. I would like to use such a tool to be able to make screenshots of pages (images) that are available via archive.org. At this moment I have to do this work step by step manually. Maybe the one or other is interested too? A few lines of code that could save time. Thank you and best wishes Undekaeder Supplement: Find my solution in the first post
    0 points
×
×
  • Create New...