Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/03/2018 in all areas

  1. BrewManNH

    do until why not exit ?

    A Do loop will always execute at least once because the test is at the end of the loop. A While loop can execute zero times if the condition is met, because it's tested at the beginning of the loop.
    1 point
  2. Danp2

    do until why not exit ?

    It's only doing what you've told it to do. You should look into using a single call to _ArrayDelete instead of looping, like this -- For $i = 0 To UBound($aLText) - 1 If StringInStr($aLText[$i], $match) Then $sRange = String($i) & "-" & String($to) _ArrayDelete($aLTextClone, $sRange) ExitLoop EndIf Next and maybe even replace the For loop with a single call to _ArraySearch.
    1 point
  3. A note for SQLite users who wonder: the dev team of SQLite is in the process of offering windowing functions. They are part of the current draft release: http://www.sqlite.org/draft/releaselog/3_25_0.html But don't forget this is just draft, subject to changes.
    1 point
  4. Gianni

    Reporting Error Message

    ... maybe here (https://www.autoitscript.com/forum/topic/194873-wsa-error-to-text/) you can get more details when $error > 2 ...
    1 point
  5. @PunkoHead Try adding the following to your existing desired capabilities -- "pageLoadStrategy":"none"
    1 point
  6. Solved. In case anyone else needs this, I found an old script called "MouseClickPlus.au3" in another thread and was able to modify it to include two different coordinates, a starting coordinate and a final coordinate, and thus performing a drag. It does this through user32.dll calls. Here's what the modified script looks like: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.8.1 Author: someone Script Function: MouseClickPlus #ce ---------------------------------------------------------------------------- Func _MouseClickPlus($Window, $Button="left", $X1=0, $Y1=0, $X2=0, $Y2=0, $Clicks=1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X1 = 0 OR $Y1 = 0 Then $MouseCoord = MouseGetPos() $X1 = $MouseCoord[0] $Y1 = $MouseCoord[1] EndIf For $i = 1 to $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X2, $Y2)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X2, $Y2)) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc
    1 point
  7. ripdad

    MiniSMART v0.2

    I couldn't resist making a S.M.A.R.T. script using WMIC. It gave me something to do over the holidays. 1) This will only give SMART data for the main drive. (ie: C:\) 2) It will most likely Not give data on Raided or USB drives. 3) It only shows pertinent data columns and ignores all others. 4) It should be good enough for a quick glance and an example how to parse WMIC output. Download: _MiniSmart v0.2.au3
    1 point
  8. ripdad

    MiniSMART v0.2

    Looks good. Thanks for the feedback.
    1 point
  9. czardas

    check array empty

    No it does not work well. To test the first element, you could use: If $aArray[0] == "" Then MsgBox(0, "Contents", "nothing") To test if the array actually contains elements, you should use: If UBound($aArray) = 0 Then MsgBox(0, "Contents", "zero elements") These examples will only work with 1D arrays.
    1 point
  10. arryo, You might find this a bit quicker if your file is very large: $file = FileOpen("test.txt", 0) $read = FileRead($file) If @error = -1 Then MsgBox(0, "Error", "File not read") Exit Else MsgBox(0, "Read", $read) If StringRegExp($read, "Markus") Then MsgBox(0, "Oops", "Match") Else MsgBox(0, "Oops", "No match") EndIf EndIf FileClose($file)Although it does not give you the position. M23
    1 point
  11. Valuater

    Autoit Wrappers

    ; Reduce memory usage ; Author wOuter ( mostly ) Func _ReduceMemory($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc;==> _ReduceMemory()
    1 point
×
×
  • Create New...