Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Indeed. It also uses ffmpeg.exe but it's not relevant for this issue. The issue happens with basically all files from bandcamp. Thank you! The Future Sound Of London - Environment 6.5 - 01 Axis of Rotation.mp3 chaika.zip
  3. Today
  4. Hi, Very nice UDF. One impovement can be to add the description to the service as an option. https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc742069(v=ws.11) Thanks anyway !
  5. It is a problem with the service trying to be launched, and the current lack of error checking, for such an important part experience, I'm looking into improving this The script for the taadd API calls a function that is responsible for sending the subscribe request to the process and launching the service if not available, here https://github.com/genius257/Manga/blob/main/www/api/taadd.au3#L35 The function is called, when you navigate to the subscription request page, via the subscribe link on a manga. The subscribe function is defined here: https://github.com/genius257/Manga/blob/main/mangaSvc/api.au3#L26
  6. Hi @Gianni 🙂, AutoItObject_Internal is much slower than AutoitObject. An issue regarding speed exists on github: https://github.com/genius257/AutoItObject-Internal/issues/10
  7. It looks like replacing the costly StringStripWS() with StringIsSpace() the function performs much better: Func _strip_Andreik(ByRef $aData, $iStart = 0) If Not IsArray($aData) Then Return SetError(1, 0, False) Local $iElements = UBound($aData) If $iStart >= $iElements Then Return SetError(2, 0, False) Local $sResult For $Index = $iStart To $iElements - 1 $sResult &= (StringIsSpace($aData[$Index]) ? $aData[$Index] & '|' : '') Next Return StringSplit(StringTrimRight($sResult, 1), '|', 2) EndFunc Totally forgot about this function. Thanks @AspirinJunkie.
  8. The tests previously conducted to assess the performance of the UDFs AutoItObject.au3 and AutoItObject_Internal.au3 under various conditions have highlighted discernible differences, albeit subtle. The analysis of the collected data underscores the slight preference in terms of speed for AutoItObject.au3. While this difference may not be considerable, it remains non-negligible in certain usage contexts. It is important to note that each UDF has its own advantages and disadvantages, which can influence their selection depending on the specific project requirements. The comparative table provided by @genius257 while informative, may spark debates and additional nuances regarding the evaluation of the performance and features of each UDF. Unfortunately, I no longer have the test code available.
  9. I have added a function and packed the whole thing into a speed comparison: #include <Array.au3> Global Const $aArrayRaw = Get_Array() Global $f_DecimalPlaces = 1 Global $iT, $a_Results[0][3] Func Get_Array() Local $aArray[1e6] For $i = 0 To UBound($aArray) - 1 $aArray[$i] = Random(0,2,1) = 2 ? " " : "x" Next Return $aArray EndFunc ;==>Get_Array ; the first measurement $aArray = $aArrayRaw ReDim $a_Results[UBound($a_Results) + 1][3] $a_Results[UBound($a_Results) - 1][0] = "Andreik" $iT = TimerInit() $aArray = _strip_Andreik($aArray) $iT = TimerDiff($iT) $a_Results[UBound($a_Results) - 1][1] = ($iT) ; the second measurement $aArray = $aArrayRaw ReDim $a_Results[UBound($a_Results) + 1][3] $a_Results[UBound($a_Results) - 1][0] = "SmOke_N" $iT = TimerInit() $aArray = _strip_SmOke_N($aArray) $iT = TimerDiff($iT) $a_Results[UBound($a_Results) - 1][1] = ($iT) ; the third measurement $aArray = $aArrayRaw ReDim $a_Results[UBound($a_Results) + 1][3] $a_Results[UBound($a_Results) - 1][0] = "Nine 1" $iT = TimerInit() $aArray = _stripNine1($aArray) $iT = TimerDiff($iT) $a_Results[UBound($a_Results) - 1][1] = ($iT) ; the fourth measurement $aArray = $aArrayRaw ReDim $a_Results[UBound($a_Results) + 1][3] $a_Results[UBound($a_Results) - 1][0] = "Nine 2" $iT = TimerInit() $aArray = _stripNine2($aArray) $iT = TimerDiff($iT) $a_Results[UBound($a_Results) - 1][1] = ($iT) ; the fifth measurement $aArray = $aArrayRaw ReDim $a_Results[UBound($a_Results) + 1][3] $a_Results[UBound($a_Results) - 1][0] = "AspirinJunkie" $iT = TimerInit() _strip_AspirinJunkie($aArray) $iT = TimerDiff($iT) $a_Results[UBound($a_Results) - 1][1] = ($iT) ; calculate results and print them out _ArraySort($a_Results, 0, 0, 0, 1) For $i = 0 To UBound($a_Results) - 1 $a_Results[$i][2] = Round($a_Results[$i][1] / $a_Results[0][1], 2) $a_Results[$i][1] = Round($a_Results[$i][1], $f_DecimalPlaces) Next _ArrayDisplay($a_Results, "Measurement Results", "", 16 + 64, Default, "name|time [ms]|factor") Func _strip_Andreik(ByRef $aData, $iStart = 0) If Not IsArray($aData) Then Return SetError(1, 0, False) Local $iElements = UBound($aData) If $iStart >= $iElements Then Return SetError(2, 0, False) Local $sResult For $Index = $iStart To $iElements - 1 $sResult &= (StringStripWS($aData[$Index], 8) ? $aData[$Index] & '|' : '') Next Return StringSplit(StringTrimRight($sResult, 1), '|', 2) EndFunc Func _stripNine1(ByRef $array, $iStart = 0) Local $sArray = StringRegExpReplace(_ArrayToString($array, Default, $iStart), "\|\s*$|(?<=\|)\s*\|", "") Return StringSplit(($iStart ? _ArrayToString($array, Default, 0, $iStart - 1) & "|" : "") & $sArray, "|", $STR_NOCOUNT) EndFunc Func _stripNine2(ByRef $array, $iStart = 0) Local $aTemp = _ArrayFindAll($array, "^\s*$", $iStart, Default, 0, 3) _ArrayInsert($aTemp, 0, UBound($aTemp)) _ArrayDelete($array, $aTemp) Return $array EndFunc ; $bNoWS = White spaces only count as empty element, true by default Func _strip_SmOke_N(ByRef $aArgs, $iStart = 0, $bNoWS = True) If UBound($aArgs, 2) Then Return SetError(1, 0, 0) ; out of bounds If $iStart = Default Or $iStart == -1 Then $iStart = 0 If $bNoWS = Default Or $bNoWS == -1 Then $bNoWS = True Local $iUB = UBound($aArgs) ; catch start out of bounds If $iStart < 0 Or $iStart > $iUB - 1 Then Return SetError(2, 0, 0) Local $aRet[$iUB] Local $iEnum = 0 ; build array without concatenation For $i = $iStart To $iUB - 1 If StringLen($aArgs[$i]) == 0 Then ContinueLoop If $bNoWS Then If StringRegExp($aArgs[$i], "(?m)^\s+$") Then ContinueLoop EndIf $aRet[$iEnum] = $aArgs[$i] $iEnum += 1 Next If $iEnum = 0 Then ; nothing found, but rather than return a false ; set error and return array where user can do what they want with it Return SetError(2, 0, $aArgs) EndIf ; resize return array ReDim $aRet[$iEnum] ; return extended as the ubound of new array Return SetExtended($iEnum, $aRet) EndFunc Func _strip_AspirinJunkie(ByRef $A, $iStart = 0, $iEnd = UBound($A) - 1) Local $x = 0 For $i = $iStart To $iEnd If StringIsSpace($A[$i]) Then ContinueLoop $A[$x] = $A[$i] $x += 1 Next Redim $A[$x] EndFunc Nine`s first function performs best, but would still have to be adapted to certain special cases for which it currently does not work, depending on the type of data: 1. if first array element is empty it`s still in the array 2. only line breaks are not recognized as empty strings (which may be correct depending on the context) and 3. if pipes ("|") occur in the strings.
  10. For comparative testing purposes I tried to translate the script created by @Numeric1 at this link which uses AutoitObject, so as to use AutoItObject_Internal.au3 by @genius257 instead. (The latter does not require additional DLLs.). Maybe it seems a little slower and slightly less responsive (?) P.S. I created a new thread just to not hijack @Numeric1's original thread. (any improvements and corrections relating to the translation of the listing are welcome) ; =============================================================================================================================== ; original script created by @Numeric1 at the link below ; https://www.autoitscript.com/forum/topic/211824-ping-pong-game-with-autoitobject/ ; =============================================================================================================================== ; Game Overview: ; - The game consists of a paddle and a ball. ; - The player controls the paddle using the left and right arrow keys. ; - The objective is to bounce the ball off the paddle and prevent it from hitting the bottom edge of the window. ; - If the ball hits the bottom edge, the game ends. ; - As the game progresses, the speed of the ball increases periodically, making it more challenging. ; Controls: ; - Left Arrow Key: Move the paddle to the left. ; - Right Arrow Key: Move the paddle to the right. ; - S Key: Pause the game. ; - When the game is paused, press Left or Right arrow key to resume. ; Enjoy playing Ping Pong! ; =============================================================================================================================== #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> ; #include "AutoItObject.au3" #include "AutoItObject_Internal.au3" ; <-- https://www.autoitscript.com/forum/topic/185720-autoitobject-pure-autoit #include <Misc.au3> Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") _GDIPlus_Startup() Const $COLOR_RED = 0xFFFF0000 Const $COLOR_GREEN = 0xFF00FF00 Func Ball($x = 0, $y = 0, $size = 5) Local $cBall = IDispatch() ; _AutoItObject_Class() With $cBall .dx = 10 .dy = -10 .size = $size .X = $x .Y = $y .__defineGetter("move", _move) EndWith Return $cBall ; .Object EndFunc ;==>Ball Func Paddle($x = 0, $size = 5) Local $cPaddle = IDispatch() ; _AutoItObject_Class() With $cPaddle .X = $x .size = $size .dx = 20 .__defineGetter("moveLeft", _moveLeft) .__defineGetter("moveRight", _moveRight) EndWith Return $cPaddle ; .Object EndFunc ;==>Paddle Func _moveLeft($this) $this.parent.X -= $this.parent.dx If $this.parent.X < 0 Then $this.parent.X = 0 EndFunc ;==>_moveLeft Func _moveRight($this) ; , $maxX) Local $maxX = $this.arguments.values[0] Local $paddleWidth = $this.parent.size If $this.parent.X + $this.parent.dx + $paddleWidth <= $maxX Then $this.parent.X += $this.parent.dx Else $this.parent.X = $maxX - $paddleWidth EndIf EndFunc ;==>_moveRight Func GamePanel() Local $hGUI = GUICreate("Ping Pong", 400, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) GUISetBkColor(0x000000) GUISetState() Local $aClient = WinGetClientSize($hGUI) If @error Then Return SetError(1, 0, 0) Local $iWidth = $aClient[0] Local $iHeight = $aClient[1] Local $aGDIMap[5] $aGDIMap[0] = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aGDIMap[1] = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $aGDIMap[0]) $aGDIMap[2] = _GDIPlus_ImageGetGraphicsContext($aGDIMap[1]) $aGDIMap[3] = _GDIPlus_BrushCreateSolid($COLOR_RED) $aGDIMap[4] = _GDIPlus_HatchBrushCreate(4, $COLOR_GREEN) Local $Ball = Ball(40, 40) Local $paddleX = Paddle(150, 100) Local $cGamePanel = IDispatch() ; _AutoItObject_Class() With $cGamePanel .iWidth = $iWidth .iHeight = $iHeight .ball = $Ball .paddle = $paddleX .map = $aGDIMap .speedLevel = 100 .__defineGetter("move", _move) .__defineGetter("drawStage", _drawStage) .__defineGetter("cleanUpResources", _cleanUpResources) .__destructor(_cleanUpResources) .__defineGetter("runGameLoop", _runGameLoop) EndWith Return $cGamePanel ; .Object EndFunc ;==>GamePanel Func _move($this) Local $x = $this.parent.ball.X Local $y = $this.parent.ball.Y Local $dx = $this.parent.ball.dx Local $dy = $this.parent.ball.dy Local $Width = $this.parent.iWidth Local $Height = $this.parent.iHeight Local $BallSize = $this.parent.ball.size If $y + $dy >= ($Height - 40) And $x + $BallSize >= $this.parent.paddle.X And $x <= $this.parent.paddle.X + $this.parent.paddle.size Then $dy *= -1 EndIf If $y + $dy <= 0 Then $dy = Abs($dy) EndIf If $y + $dy >= $Height - $BallSize Then MsgBox(0, "Game Over", "You missed the ball! Game Over!") Exit EndIf If $x + $dx <= 0 Then $dx = Abs($dx) EndIf If $x + $dx >= $Width - $BallSize Then $dx = -Abs($dx) EndIf $x += $dx $y += $dy $this.parent.ball.dx = $dx $this.parent.ball.dy = $dy $this.parent.ball.X = $x $this.parent.ball.Y = $y $this.parent.drawStage() EndFunc ;==>_move Func _drawStage($this) Local $hGraphics = $this.parent.map[0] Local $hBitmap = $this.parent.map[1] Local $hGraphicsCtxt = $this.parent.map[2] Local $iX = $this.parent.ball.X Local $iY = $this.parent.ball.Y Local $iRadius = $this.parent.ball.size Local $padX = $this.parent.paddle.X Local $padH = $this.parent.iHeight - 40 _GDIPlus_GraphicsClear($hGraphicsCtxt, 0xFF000000) _GDIPlus_GraphicsFillEllipse($hGraphicsCtxt, $iX - $iRadius, $iY - $iRadius, $iRadius * 2, $iRadius * 2, $this.parent.map[3]) _GDIPlus_GraphicsFillRect($hGraphicsCtxt, $padX, $padH, $this.parent.paddle.size, 10, $this.parent.map[4]) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $this.parent.iWidth, $this.parent.iHeight) EndFunc ;==>_drawStage Func _cleanUpResources($this) ConsoleWrite("clean up ressources...." & @CRLF) Local $map = $this.parent.map _GDIPlus_GraphicsDispose($map[0]) _GDIPlus_BitmapDispose($map[1]) _GDIPlus_GraphicsDispose($map[2]) _GDIPlus_BrushDispose($map[3]) $this.parent.map = 0 _GDIPlus_Shutdown() EndFunc ;==>_cleanUpResources Func _runGameLoop($this) Local $speedUpTime = 5000 Local $lastMoveTime = TimerInit() Local $maxX = $this.parent.iWidth While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop If _IsPressed(25) Then $this.parent.paddle.moveLeft() If _IsPressed(27) Then $this.parent.paddle.moveRight($maxX) If _IsPressed(53) Then While 1 If _IsPressed(25) Or _IsPressed(27) Then ExitLoop Sleep(100) WEnd EndIf If TimerDiff($lastMoveTime) >= $speedUpTime Then $this.parent.speedLevel -= 5 If $this.parent.speedLevel < 0 Then $this.parent.speedLevel = 0 $lastMoveTime = TimerInit() EndIf $this.parent.move() Sleep($this.parent.speedLevel) WEnd EndFunc ;==>_runGameLoop Func _ErrFunc($oError) ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc ;================================================ Global $game = GamePanel() $game.runGameLoop() ConsoleWrite("------> the end <-------" & @CRLF) ; $game = 0 ;=================================================
  11. Yesterday
  12. Yes, why not? Whatever makes the game interesting and entertaining.
  13. I have taken note of your valuable suggestion. What do you think about this idea? : instead of making poisoned food appear, I thought about making a speed reducer appear to give the player more luck. What do you think ?
  14. Redim it's quite expensive with large arrays. With few indices every version is more than enough.
  15. Those 2 seems faster : Func StripEmpty2(ByRef $array, $iStart = 0) Local $sArray = StringRegExpReplace(_ArrayToString($array, Default, $iStart), ""\|\s*$|(?<=\|)\s*\|"", "") Return StringSplit(($iStart ? _ArrayToString($array, Default, 0, $iStart - 1) & "|" : "") & $sArray, "|", $STR_NOCOUNT) EndFunc Func StripEmpty3(ByRef $array, $iStart = 0) Local $aTemp = _ArrayFindAll($array, "^\s*$", $iStart, Default, 0, 3) _ArrayInsert($aTemp, 0, UBound($aTemp)) _ArrayDelete($array, $aTemp) Return $array EndFunc
  16. That's pretty interesting. The regex overhead is the only thing that I can think of for that with a single redim. If I'm being honest, I didn't even see your post before I posted. And was to tired to test yours out once I posted lol. But proofs in the pudding so to speak.
  17. Hi @laohacbancho37, could you please create a new Thread for your question? Because I believe there could be more suggestions, questions and so on around your question. This would be helpful to you and other people too, am sure 🤝 . Thanks. Best regards Sven
  18. Hi @FrancoBordin, what do you want to achieve? Which header information are you interested in and why? Maybe there are other approaches then WebDriver 🤔 . Best regards Sven
  19. Doesn't seem to be faster not even with 1 million of records. #include <Array.au3> $iLen = 1 For $Index = 1 To 6 $iLen *= 10 $aData = BuildArray($iLen) ConsoleWrite('Records in array: ' & $iLen & @CRLF) ConsoleWrite('Empty records: ' & @extended & @CRLF) $iTimer = TimerInit() $aNew1 = StripEmptyRecords($aData, 0) ConsoleWrite(Round(TimerDiff($iTimer), 2) & ' ms' & @TAB) ConsoleWrite('Records: ' & UBound($aNew1) & @CRLF) $iTimer = TimerInit() $aNew2 = _StripEmptyElements($aData) ConsoleWrite(Round(TimerDiff($iTimer), 2) & ' ms' & @TAB) ConsoleWrite('Records: ' & UBound($aNew2) & @CRLF) ConsoleWrite(@CRLF) Next Func BuildArray($iLen) Local $aData[$iLen] Local $sData, $iEmpty = 0 For $Index = 0 To $iLen - 1 $sData = (Random(1, 10, 1) = 5 ? '' : RandomString(Random(10, 50, 1))) $aData[$Index] = $sData If Not $sData Then $iEmpty += 1 Next Return SetError(0, $iEmpty, $aData) EndFunc Func RandomString($iLen) Local Static $aChars = StringSplit('abcdefghijklmnopqrstuvwxyz', '') Local $sString For $Index = 1 To $iLen $sString &= $aChars[Random(1, $aChars[0], 1)] Next Return $sString EndFunc Func StripEmptyRecords(ByRef $aData, $iStart) If Not IsArray($aData) Then Return SetError(1, 0, False) Local $iElements = UBound($aData) If $iStart >= $iElements Then Return SetError(1, 0, False) Local $sResult For $Index = $iStart To $iElements - 1 $sResult &= (StringStripWS($aData[$Index], 8) ? $aData[$Index] & '|' : '') Next Return StringSplit(StringTrimRight($sResult, 1), '|', 2) EndFunc Func _StripEmptyElements(ByRef $aArgs, $iStart = 0, $bNoWS = True) If UBound($aArgs, 2) Then Return SetError(1, 0, 0) ; out of bounds If $iStart = Default Or $iStart == -1 Then $iStart = 0 If $bNoWS = Default Or $bNoWS == -1 Then $bNoWS = True Local $iUB = UBound($aArgs) ; catch start out of bounds If $iStart < 0 Or $iStart > $iUB - 1 Then Return SetError(2, 0, 0) Local $aRet[$iUB] Local $iEnum = 0 ; build array without concatenation For $i = $iStart To $iUB - 1 If StringLen($aArgs[$i]) == 0 Then ContinueLoop If $bNoWS Then If StringRegExp($aArgs[$i], "(?m)^\s+$") Then ContinueLoop EndIf $aRet[$iEnum] = $aArgs[$i] $iEnum += 1 Next If $iEnum = 0 Then ; nothing found, but rather than return a false ; set error and return array where user can do what they want with it Return SetError(2, 0, $aArgs) EndIf ; resize return array ReDim $aRet[$iEnum] ; return extended as the ubound of new array Return SetExtended($iEnum, $aRet) EndFunc Results:
  20. Doing it without concatenation may be faster for larger arrays. Based on what you're showing, you could do a simple for/next loop with a blank ret array or you could put in the bells and whistles to catch some errors like so: #include <Array.au3> Global $array = Get_Array() _ArrayDisplay($array) $array = _StripEmptyElements($array) _ArrayDisplay($array) Func Get_Array() Local $array[7] $array[0] = "12345" $array[1] = "01621" $array[2] = "xyz" $array[3] = "abc@defg.com" $array[4] = " john smith" $array[5] = " sally turner " $array[5] = " " & @CRLF & " " $array[6] = "zxy" Return $array EndFunc ;==>Get_Array ; $bNoWS = White spaces only count as empty element, true by default Func _StripEmptyElements(ByRef $aArgs, $iStart = 0, $bNoWS = True) If UBound($aArgs, 2) Then Return SetError(1, 0, 0) ; out of bounds If $iStart = Default Or $iStart == -1 Then $iStart = 0 If $bNoWS = Default Or $bNoWS == -1 Then $bNoWS = True Local $iUB = UBound($aArgs) ; catch start out of bounds If $iStart < 0 Or $iStart > $iUB - 1 Then Return SetError(2, 0, 0) Local $aRet[$iUB] Local $iEnum = 0 ; build array without concatenation For $i = $iStart To $iUB - 1 If StringLen($aArgs[$i]) == 0 Then ContinueLoop If $bNoWS Then If StringRegExp($aArgs[$i], "(?m)^\s+$") Then ContinueLoop EndIf $aRet[$iEnum] = $aArgs[$i] $iEnum += 1 Next If $iEnum = 0 Then ; nothing found, but rather than return a false ; set error and return array where user can do what they want with it Return SetError(2, 0, $aArgs) EndIf ; resize return array ReDim $aRet[$iEnum] ; return extended as the ubound of new array Return SetExtended($iEnum, $aRet) EndFunc
  21. Since _ArrayToString() already traverse the entire array you can do it by yourself and meanwhile keep just non empty data: #include <Array.au3> $array = Get_Array() _ArrayDisplay($array) $array = StripEmptyRecords($array, 0) _ArrayDisplay($array) Func Get_Array() Local $array[7] $array[0] = "12345" $array[1] = "01621" $array[2] = "xyz" $array[3] = "abc@defg.com" $array[4] = " john smith" $array[5] = " sally turner " $array[5] = " " $array[6] = "zxy" Return $array EndFunc ;==>Get_Array Func StripEmptyRecords(ByRef $aData, $iStart) If Not IsArray($aData) Then Return SetError(1, 0, False) Local $iElements = UBound($aData) If $iStart >= $iElements Then Return SetError(2, 0, False) Local $sResult For $Index = $iStart To $iElements - 1 $sResult &= (StringStripWS($aData[$Index], 8) ? $aData[$Index] & '|' : '') Next Return StringSplit(StringTrimRight($sResult, 1), '|', 2) EndFunc
  22. Here is what I am using but maybe it can be done faster within this line and not have to go through the loop to test for empty values? Thanks in advance! $tmp_array = StringRegExpReplace($tmp_array, "\|\|+", "|") $array = Get_Array() _ArrayDisplay($array) $array = StripEmptyRecords($array, 0) _ArrayDisplay($array) Func Get_Array() Local $array[7] $array[0] = "12345" $array[1] = "01621" $array[2] = "xyz" $array[3] = "abc@defg.com" $array[4] = " john smith" $array[5] = " sally turner " $array[5] = " " $array[6] = "zxy" Return $array EndFunc ;==>Get_Array Func StripEmptyRecords($array, $start_row) $tmp_array = _ArrayToString($array, "|", $start_row) $tmp_array = StringStripCR($tmp_array) $tmp_array = StringRegExpReplace($tmp_array, "\|\|+", "|") If StringRight($tmp_array, 1) = "|" Then $tmp_array = StringTrimRight($tmp_array, 1) EndIf If StringLeft($tmp_array, 1) = "|" Then $tmp_array = StringTrimLeft($tmp_array, 1) EndIf $final_array = StringSplit($tmp_array, "|", 2) For $x = UBound($final_array) - 1 To 0 Step -1 If StringStripWS($final_array[$x], 8) = "" Then _ArrayDelete($final_array, $x) EndIf Next Return $final_array EndFunc ;==>StripEmptyRecords
  23. When the snake is long enough the chance of food being spawn under the snake it's pretty high. It would be a good idea to check if the location where the food is spawn it's an empty space. Also it's very hard to eat a poison food (even if you want) if it's randomly spawn and the duration of being displayed it's so short. It would be more interesting if the food stays longer or if the poison food it's spawned in the proximity of the snake.
  24. Try this: $hWin = WinWait('Teradata SQL Assistant') If IsHWnd($hWin) Then ControlClick($hWin, '', '[REGEXPCLASS:(?i)WindowsForms\d+\.Window\.\d+\.app\.\d+\.[a-z0-9_]+_ad1; INSTANCE:30]')
  25. Streamlined : #include "C:\Apps\AutoIt\JSON\json.au3" #include <Array.au3> $object = json_decode(FileRead("Test.json")) ;for local testing $Coins = json_get($object, '.data') Local $Chart[UBound($Coins)][2] for $i = 0 to UBound($Coins) -1 $Chart[$i][0] = json_get($object, '.data[' & $i & '].name' ) $Chart[$i][1] = Number(json_get($object, '.data[' & $i & '].quote.USD.percent_change_1h'), 3) Next _ArraySort($Chart, 3, Default, Default, 1) _ArrayDisplay($Chart)
  26. Amazing thank you @water thank you @ioa747
  1. Load more activity
×
×
  • Create New...