Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. If the Mod team is going to support trolling then that's the Mod team's prerogative. I asked my question according to your rules, if you can't provide the answer and you are unwilling to conform to your own rules, fine, stop wasting my time. Anyone not commenting for the purposes of answering the OP's question is a troll. They are in violation of the forum rules you purport to police. Follow your own rules and police the threads properly, or end this charade. I answered the question: NOTEPAD. The script should send the keystrokes and behavior as outlined to NOTEPAD.
  3. Today
  4. kirb, Pull the other one! Now give us a sensible response please. M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out.
  5. kirb, That type of syntax has been in use for at least the past 35 years to indicate optional parameters and default values - even my old DOS programs written in Assembler used it! And there are separate brackets because in AutoIt you must supply a value for optional parameters (even if that is the default value) when you are going to use non-default parameters later in the call. All this is clearly explained in the Help file: https://www.autoitscript.com/autoit3/docs/function_notes.htm Now, regarding your ad hominen attack on one of our forum's MVPs, I find it well out of line for a complete newbie to post such a diatribe. Please adjust your attitude or your stay here will not be long. Consider this a formal warning. M23
  6. And yet you spend your free time trolling the help forums of ancient technology. If you have 40 years of anything, why don't you prove it and answer the question? You can't even write English. Maybe start there. Otherwise I have no use for you, this after-all a place where you put your platitudes aside and work towards answering 'other' peoples questions. Or is the forum dead and I am wasting my time? Perhaps your pitiful career can answer at least one question for me. Regardless I look forward to listing your various accomplishments, knowing you feel the need to hijack every discussion to prove yourself to every stranger you come across on the internet.
  7. You're thinking in AHK, but now you're in AutoIt. But first of all, for what application is this aimed for ? Looks to me for a game, right ?
  8. Ok - I see. This feature is already requested Implement hovers for user-created functions & variables · Issue #201 · loganch/AutoIt-VSCode · GitHub
  9. the icon's $SS_NOTIFY style is responsible for this. I don't know how this can change Edit: I found another way Special Edition: ; https://www.autoitscript.com/forum/topic/211721-round-buttons/ ;---------------------------------------------------------------------------------------- ; Title...........: RoundButtonsSpecial.au3 ; Description.....: collection of round buttons - Special Edition ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $MyGui, $aBtn[7][2] Example() ;---------------------------------------------------------------------------------------- Func Example() $MyGui = GUICreate(" My GUI Icons", 300, 500) $aBtn[0][0] = 6 ; cnt of buttons $aBtn[1][1] = "red" $aBtn[1][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[1][1] & "_normal.ico", 0, 20, 20, 64, 64) $aBtn[2][1] = "yellow" $aBtn[2][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[2][1] & "_normal.ico", 0, 20, 100, 64, 64) $aBtn[3][1] = "green" $aBtn[3][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[3][1] & "_normal.ico", 0, 20, 180, 64, 64) $aBtn[4][1] = "turquoise" $aBtn[4][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[4][1] & "_normal.ico", 0, 20, 260, 64, 64) $aBtn[5][1] = "cyan" $aBtn[5][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[5][1] & "_normal.ico", 0, 20, 340, 64, 64) $aBtn[6][1] = "magenta" $aBtn[6][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[6][1] & "_normal.ico", 0, 20, 420, 64, 64) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch _IsOver() WEnd GUIDelete() EndFunc ;==>Example ;---------------------------------------------------------------------------------------- Func _IsOver() Local Static $iActive, $iClicked = 0 Local $aActive = GUIGetCursorInfo($MyGui) If $aActive[2] And $iClicked = 1 Then Return If $iActive <> $aActive[4] Then $iActive = $aActive[4] For $i = 1 To $aBtn[0][0] If $aBtn[$i][0] = $aActive[4] Then GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_hover.ico") Else GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_normal.ico") EndIf Next EndIf If $aActive[2] Or $iClicked = 1 Then For $i = 1 To $aBtn[0][0] If $aBtn[$i][0] = $aActive[4] Then If $iClicked = 0 Then GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_click.ico") $iClicked = 1 Else GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_hover.ico") $iClicked = 0 _ButtonCaller($aBtn[$i][0]) EndIf EndIf Next EndIf EndFunc ;==>_IsOver ;---------------------------------------------------------------------------------------- Func _ButtonCaller($Btn) Switch $Btn Case $aBtn[1][0] ConsoleWrite($aBtn[1][1] & @CRLF) Case $aBtn[2][0] ;"yellow" ConsoleWrite($aBtn[2][1] & @CRLF) Case $aBtn[3][0] ;"green" ConsoleWrite($aBtn[3][1] & @CRLF) Case $aBtn[4][0] ;"turquoise" ConsoleWrite($aBtn[4][1] & @CRLF) Case $aBtn[5][0] ;"cyan" ConsoleWrite($aBtn[5][1] & @CRLF) Case $aBtn[6][0] ;"magenta" ConsoleWrite($aBtn[6][1] & @CRLF) EndSwitch EndFunc ;----------------------------------------------------------------------------------------
  10. Edited with added my search image script and source code
  11. Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Moderation Team
  12. Hello, I have one gui and i search 2 images. My problem is if i want stop a soft i need wait end search image. Local $btnback = _ImageSearch("IMG/INTERFACE/BtnClose.png", 1, 80) If $showGUI <> 0 Then While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $closebtn Exit EndSwitch Local $btnback = _WaitForImageSearch("IMG/INTERFACE/BtnBack.png", 25, 1, 110, 0) If IsArray($btnback) Then Sleep(300) MouseMove($btnback[0], $btnback[1]) ;MouseDown("left") ;Sleep(100) ;MouseUp('left') EndIf $minimiseMenu = _WaitForImageSearch("IMG/INTERFACE/minimisGUI.jpg", 25, 1, 110, 0) If IsArray($minimiseMenu) Then Sleep(300) MouseMove($minimiseMenu[0], $minimiseMenu[1]) MouseDown("left") Sleep(100) MouseUp('left') EndIf Wend EndIf My code is here. If i press boutton close on my GUI i need wait a searshing image time end. Can you help me please . TY My imagesearch script is : If Not FileExists("ImageSearch\dll\") Then DirCreate("ImageSearch\dll\") ; This script's functionality depends on these DLLs being present in the script's path #Region Required DLLs If Not FileExists("ImageSearch\dll\ImageSearchDLLx32.dll") Then FileInstall("ImageSearch\dll\ImageSearchDLLx32.dll", "ImageSearch\dll\ImageSearchDLLx32.dll") If Not FileExists("ImageSearch\dll\ImageSearchDLLx64.dll") Then FileInstall("ImageSearch\dll\ImageSearchDLLx64.dll", "ImageSearch\dll\ImageSearchDLLx64.dll") ; Microsoft Visual C++ Redistributable x32 If Not FileExists("ImageSearch\dll\msvcr110.dll") Then FileInstall("ImageSearch\dll\msvcr110.dll", "ImageSearch\dll\msvcr110.dll") ; Microsoft Visual C++ Redistributable x64 If Not FileExists("ImageSearch\dll\msvcr110d.dll") Then FileInstall("ImageSearch\dll\msvcr110d.dll", "ImageSearch\dll\msvcr110d.dll") #EndRegion ; When working with multiple monitors, we need to determine absolute desktop dimensions manually, so we can escape the boundaries of the primary monitor ; Ref: https://msdn.microsoft.com/en-us/library/ms724385(v=vs.85).aspx Global $desktopLeft = _WinAPI_GetSystemMetrics(76) Global $desktopTop = _WinAPI_GetSystemMetrics(77) Global $desktopWidth = _WinAPI_GetSystemMetrics(78) Global $desktopHeight = _WinAPI_GetSystemMetrics(79) Global $desktopRight = $desktopLeft + $desktopWidth Global $desktopBottom = $desktopTop + $desktopHeight ; Will become the Handle returned by DllOpen() that will be referenced in the _ImageSearchRegion() function Local $hImageSearchDLL = -1 #Region ImageSearch Startup/Shutdown Func _ImageSearchStartup() _WinAPI_Wow64EnableWow64FsRedirection(True) ; Check OS and AutoIt architectures ; @OSArch - Returns one of the following: "X86", "IA64", "X64" - this is the architecture type of the currently running operating system ; @AutoItX64 - Returns 1 if the script is running under the native x64 version of AutoIt If @OSArch = "X86" Or @AutoItX64 = 0 Then cr("@OSArch=" & @OSArch & " | " & "@AutoItX64=" & @AutoItX64 & " | " & "Using x32 ImageSearch DLL") $hImageSearchDLL = DllOpen("ImageSearch\dll\ImageSearchDLLx32.dll") If $hImageSearchDLL = -1 Then Return "DllOpen Error: " & @error ElseIf @OSArch = "X64" And @AutoItX64 = 1 Then cr("@OSArch=" & @OSArch & " | " & "@AutoItX64=" & @AutoItX64 & " | " & "Using x64 ImageSearch DLL") $hImageSearchDLL = DllOpen("ImageSearch\dll\ImageSearchDLLx64.dll") If $hImageSearchDLL = -1 Then Return "DllOpen Error: " & @error Else Return "Inconsistent or incompatible Script/Windows/CPU Architecture" EndIf Return True EndFunc ; _ImageSearchStartup Func _ImageSearchShutdown() DllClose($hImageSearchDLL) _WinAPI_Wow64EnableWow64FsRedirection(False) cr("_ImageSearchShutdown() completed") Return True EndFunc ; _ImageSearchShutdown #EndRegion ImageSearch Startup/Shutdown #Region ImageSearch UDF ;=============================================================================== ; Description: Find the position of an image in a specified area ; Syntax: _ImageSearchArea ( findImage, resultPosition, left, top, right, bottom [, tolerance = 0 [, $transparency = 0]] ) ; Parameter(s): ; $findImage ; Path to image to locate. ; $resultPosition ; Set where the returned x,y location of the image is. ; 0 = top left of image, 1 = center of image ; $left, $top, $right, $bottom ; Bounding coordinates of the desired search area. ; $tolerance - [OPTIONAL], default = 0 ; 0 = no tolerance, valid range is 0-255. Needed when colors of ; image differ from screen. e.g GIF ; $transparency - [OPTIONAL], default = 0 ; TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of the color ; to be used as transparency. ; ; Return Value(s): On Success - Returns [x,y] array, location of found image ; On Failure - Returns False ;=============================================================================== Func _ImageSearchArea($findImage, $resultPosition, $left, $top, $right, $bottom, $tolerance = 0, $transparency = 0) If Not FileExists($findImage) Then Return False If $tolerance < 0 Or $tolerance > 255 Then $tolerance = 0 If $hImageSearchDLL = -1 Then _ImageSearchStartup() If $transparency <> 0 Then $findImage = "*Trans" & $transparency & " " & $findImage If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage Local $dllResult = DllCall($hImageSearchDLL, "str", "ImageSearch", "int", $left, "int", $top, "int", $right, "int", $bottom, "str", $findImage) If @error Then Return "DllCall Error: " & @error If $dllResult = "0" Or Not IsArray($dllResult) Or $dllResult[0] = "0" Then Return False Local $array = StringSplit($dllResult[0], "|") If (UBound($array) >= 4) Then Local $result[2] ; Get the x,y location of the match $result[0] = Int(Number($array[2])) $result[1] = Int(Number($array[3])) If $resultPosition = 1 Then ; Account for the size of the image to compute the center of search $result[0] = $result[0] + Int(Number($array[4]) / 2) $result[1] = $result[1] + Int(Number($array[5]) / 2) EndIf Return $result EndIf EndFunc ; _ImageSearchArea ;=============================================================================== ; Description: Find the position of an image in a specified window, or the entire screen ; Syntax: _ImageSearch ( findImage, resultPosition [, tolerance = 0 [, $transparency = 0 [, hWindow = 0]]] ) ; Parameter(s): ; $findImage ; Path to image to locate. ; $resultPosition ; Set where the returned x,y location of the image is. ; 0 = top left of image, 1 = center of image ; $tolerance - [OPTIONAL], default = 0 ; 0 = no tolerance, valid range is 0-255. Needed when colors of ; image differ from screen. e.g GIF ; $transparency - [OPTIONAL], default = 0 ; TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of the color ; to be used as transparency. ; $hWindow - [OPTIONAL], default = 0 ; Handle to the window in which we're searching. ; ; Return Value(s): On Success - Returns [x,y] array, location of found image ; On Failure - Returns False ;=============================================================================== Func _ImageSearch($findImage, $resultPosition, $tolerance = 0, $transparency = 0, $hWindow = 0) ; Try to get the position of the window handle, success will return an array Local $winPos = WinGetPos($hWindow) ; If we have a window position array, use its boundaries for the search If IsArray($winPos) Then Return _ImageSearchArea($findImage, $resultPosition, $winPos[0], $winPos[1], $winPos[0]+$winPos[2], $winPos[1]+$winPos[3], $tolerance, $transparency) Else ; Otherwise use the entire screen Return _ImageSearchArea($findImage, $resultPosition, $desktopLeft, $desktopTop, $desktopWidth, $desktopHeight, $tolerance, $transparency) EndIf EndFunc ; _ImageSearch ;=============================================================================== ; Description: Wait for a specified number of seconds for an image to appear ; Syntax: _WaitForImageSearch ( findImage, resultPosition [, tolerance = 0 [, $transparency = 0 [, hWindow = 0]]] ) ; Parameter(s): ; $waitSecs ; Seconds to try and find the image. ; $findImage ; Path to image to locate. ; $resultPosition ; Set where the returned x,y location of the image is. ; 0 = top left of image, 1 = center of image ; $tolerance - [OPTIONAL], default = 0 ; 0 = no tolerance, valid range is 0-255. Needed when colors of ; image differ from screen. e.g GIF ; $transparency - [OPTIONAL], default = 0 ; TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of the color ; to be used as transparency. ; $hWindow - [OPTIONAL], default = 0 ; Handle to the window in which we're searching. ; ; Return Value(s): On Success - Returns [x,y] array, location of found image ; On Failure - Returns False ;=============================================================================== Func _WaitForImageSearch($findImage, $waitSecs, $resultPosition, $tolerance = 0, $transparency = 0, $hWindow = 0) $waitSecs = $waitSecs * 1000 Local $startTime = TimerInit() While TimerDiff($startTime) < $waitSecs Sleep(100) Local $result = _ImageSearch($findImage, $resultPosition, $tolerance, $transparency, $hWindow) If IsArray($result) Then Return $result EndIf WEnd Return False EndFunc ; _WaitForImageSearch ;=============================================================================== ; Description: Wait for a specified number of seconds for any of a set of images to appear ; Syntax: _WaitForImagesSearch ( waitSecs, findImage, resultPosition [, tolerance = 0 [, $transparency = 0 [, hWindow = 0]]] ) ; Parameter(s): ; $waitSecs ; Seconds to try and find the image. ; $findImage ; The ARRAY of paths to images to locate. ; ARRAY[0] is set to the number of images to loop through. ; ARRAY[1] is the first image. ; $resultPosition ; Set where the returned x,y location of the image is. ; 0 = top left of image, 1 = center of image ; $tolerance - [OPTIONAL], default = 0 ; 0 = no tolerance, valid range is 0-255. Needed when colors of ; image differ from screen. e.g GIF ; $transparency - [OPTIONAL], default = 0 ; TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of the color ; to be used as transparency. ; $hWindow - [OPTIONAL], default = 0 ; Handle to the window in which we're searching. ; ; Return Value(s): On Success - Returns the index of the successful find, starting at 1 ; On Failure - Returns False ;=============================================================================== Func _WaitForImagesSearch($findImage, $waitSecs, $resultPosition, $tolerance = 0, $transparency = 0, $hWindow = 0) $waitSecs = $waitSecs * 1000 Local $startTime = TimerInit() While TimerDiff($startTime) < $waitSecs For $i = 1 To $findImage[0] Sleep(100) Local $result = _ImageSearch($findImage[$i], $resultPosition, $tolerance, $transparency, $hWindow) If IsArray($result) Then Return $i EndIf Next WEnd Return False EndFunc ; _WaitForImagesSearch #EndRegion ImageSearch UDF #Region Custom ConsoleWrite/debug Function Func cr($text = "", $addCR = 1, $printTime = True) ; Print to console Local Static $sToolTip If Not @Compiled Then If $printTime Then ConsoleWrite("+>" & @HOUR & ":" & @MIN & ":" & @SEC & " ") ConsoleWrite($text) If $addCR >= 1 Then ConsoleWrite(@CR) If $addCR = 2 Then ConsoleWrite(@CR) Else If $printTime Then $sToolTip &= "+>" & @HOUR & ":" & @MIN & ":" & @SEC & " " $sToolTip &= $text If $addCR >= 1 Then $sToolTip &= @CR If $addCR = 2 Then $sToolTip &= @CR ToolTip($sToolTip) EndIf Return $text EndFunc ; cr #EndRegion Custom ConsoleWrite/debug Function
  13. I need a script equivalent to the following in AHK *r::{     loop{         send "e"         sleep 2030         if not GetKeyState("r", "P"){             break         }     } } Basically you press "r" or "shift+r" and it sends "e", waits 2s then if you are pressing the "r" button at any point leading into the end of this 2s interval it repeats the behaviour. The 2s intervals need to be respected, so you should never be able to send "e" more than once every 2s. i.e. e...2s...e....2s....e.....5s...e....2s.....e....4s....e I have the following: ;#RequireAdmin  #include <MsgBoxConstants.au3> #include <Misc.au3> HotKeySet("{f4}", "fnTerminate") HotKeySet("{f3}", "fnPause") HotKeySet("r", "fnR") HotKeySet("+r", "fnR") func fnTerminate()     exit endfunc Func fnPause()     $g_bPaused = Not $g_bPaused     While $g_bPaused         Sleep(200)         ToolTip('Script is "Paused"', 0, 0)     WEnd     ToolTip("") EndFunc  Func fnR()     while 1         send("e")         Sleep(2000)         if _IsPressed("52")=false then             ExitLoop         endif     wend EndFunc while 1 sleep(100) wend Your forum syntaxer didn't like the comments so I took them out. The pause function doesn't pause/suspend anything (I thought it was supposed to work by getting stuck in the loop but the other hotkeys work fine meaning the main loop never stoppped), and the loop within fnR() is just plain broken. The behaviour in the fnR() makes no sense whatsoever to me: Take just a simplified form of the sleep() function....why this behaviour? How is this actually running? It seems to create infinite keypresses of "r"->"e" but only 1 instance of the code in fnR() is run. Func fnR()     send("e") ;works     sleep(2000) ;DOESNT WORK Func fnR()     sleep(2000);works     send("e");works In AHK there is only 1 instance. r::send("e") sleep(2000) would literally mean I can only send the letter "e" once every 2s no matter how many times I tap/hold So I'm clearly not understanding how this process even works. I need to be able to setup loops in my hotkey code, some kind of ifkeypressed() check function, and have duplicates of the code running for separate keys....so q->w like r->e (without any timers/loops freezing up when q and r are overlappingly active). And the ability to use ctrl/shift as hotkeys....although the doc said this isn't allowed 'because they are modifier keys!'....I find it hard to believe there is no workaround there, they work in AHK... the fact they are modifier keys doesn't exclude them from functioning as hotkeys. If the program has an outright limitation it should say so clearly. There is no reload key like in AHK and the code for that I found online is outright broken, it'll work once initially if ur lucky. The only other thing I can think of is having a console/text-editor open(note ideal) and controlsending to it in the background, similar to how they showed u can send words offscreen to notepad.     If @Compiled Then         ShellExecute(@ScriptFullPath)     Else         ShellExecute(@AutoItExe, @ScriptFullPath)     EndIf The only examples I've found for hotkeys are basic rebinds (make the "a" key work like the "b" key), and behavior related to pressing buttons on a generated GUI. The only info found on the main loop is that 'it keeps the script running' and could use a sleep of 50 to takeup less resources....that's great, but I don't understand how the runtime+sleepdelay of that mainloop interacts with the hotkeys and any loops in the hotkey etc.
  14. Very nice. Do place the example in the zip for those that are lazy ( not me ) And a request would be that the action is on button release ( up ) instead of down Again, quite nice. Thanks for sharing.
  15. collection of round buttons ; https://www.autoitscript.com/forum/topic/211721-round-buttons/ ;---------------------------------------------------------------------------------------- ; Title...........: RoundButtons.au3 ; Description.....: collection of round buttons ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $MyGui, $aBtn[7][2] Example() Func Example() $MyGui = GUICreate(" My GUI Icons", 300, 500) $aBtn[0][0] = 6 ; cnt of buttons $aBtn[1][1] = "red" $aBtn[1][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[1][1] & "_normal.ico", 0, 20, 20, 64, 64, $SS_NOTIFY) $aBtn[2][1] = "yellow" $aBtn[2][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[2][1] & "_normal.ico", 0, 20, 100, 64, 64, $SS_NOTIFY) $aBtn[3][1] = "green" $aBtn[3][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[3][1] & "_normal.ico", 0, 20, 180, 64, 64, $SS_NOTIFY) $aBtn[4][1] = "turquoise" $aBtn[4][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[4][1] & "_normal.ico", 0, 20, 260, 64, 64, $SS_NOTIFY) $aBtn[5][1] = "cyan" $aBtn[5][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[5][1] & "_normal.ico", 0, 20, 340, 64, 64, $SS_NOTIFY) $aBtn[6][1] = "magenta" $aBtn[6][0] = GUICtrlCreateIcon(@ScriptDir & "\Buttons\" & $aBtn[6][1] & "_normal.ico", 0, 20, 420, 64, 64, $SS_NOTIFY) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $aBtn[1][0] ConsoleWrite($aBtn[1][1] & @CRLF) Case $aBtn[2][0] ConsoleWrite($aBtn[2][1] & @CRLF) Case $aBtn[3][0] ConsoleWrite($aBtn[3][1] & @CRLF) Case $aBtn[4][0] ConsoleWrite($aBtn[4][1] & @CRLF) Case $aBtn[5][0] ConsoleWrite($aBtn[5][1] & @CRLF) Case $aBtn[6][0] ConsoleWrite($aBtn[6][1] & @CRLF) EndSwitch _IsOver() WEnd GUIDelete() EndFunc ;==>Example Func _IsOver() Local Static $iActive, $iClicked = 0 Local $aActive = GUIGetCursorInfo($MyGui) If $aActive[2] And $iClicked = 1 Then Return If $iActive <> $aActive[4] Then $iActive = $aActive[4] For $i = 1 To $aBtn[0][0] If $aBtn[$i][0] = $aActive[4] Then GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_hover.ico") Else GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_normal.ico") EndIf Next EndIf If $aActive[2] Or $iClicked = 1 Then For $i = 1 To $aBtn[0][0] If $aBtn[$i][0] = $aActive[4] Then If $iClicked = 0 Then GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_click.ico") $iClicked = 1 Else GUICtrlSetImage($aBtn[$i][0], @ScriptDir & "\Buttons\" & $aBtn[$i][1] & "_hover.ico") $iClicked = 0 EndIf EndIf Next EndIf EndFunc ;==>_IsOver Extract buttons folder in @ScriptDir Buttons.zip Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
  16. Yesterday
  17. There is no answer to that question, as it is impossible!. an utf8 without BOM encoded file will be read, and an encoding is assigned depending on its content. When you want to force the file encoding, you need to make it utf8 with BOM. By the way: all ASCII high characters have their Unicode version too, which should be used instead when you want it to show as utf8.
  18. The thing is that removing something from the problematic script could correct the issue and the part that is removed contains normal ASCII characters. The strange thing is that I had no issues with x86 version of the script until yesterday. The script I'm using has worked for many years without issues. What would be the downside if my script contained "High ASCII" character and I used UTF-8 encoding?
  19. And it indeed does. Even on Win 11. Thank you! Even though it reacts for every application, at least now I don't need to worry about keep track if application was closed or opened second instance. My main goal to reduce CPU usage is definitely achieved. Thank you all for the help!
  20. That means that the content you paste contains a "High ASCII" character hence SciTE will revert to Ascii (code page property).
  21. Why is a comma between file path and filename? RunWait($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index), "\setup.exe") should be RunWait($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index) & "\setup.exe") Or RunWait("setup.exe", $sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index)) Or if you want to check if setup.exe exists before running $sSetupPath = $sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index) & "\setup.exe" If FileExists($sSetupPath) Then RunWait($sSetupPath) Please read the documentation of the function that you use.
  22. Hmm... [\\\^] will only look for back slash and "to the power of" ^ ... both codes I provided in my last post are correct (for all my different testing), but the operator regex is [\*/^]
  23. I have tested a new regular expression "(\d+\h*[\\\^]\h*\d+)" Working good
  24. Dear Andreik i need some help, For example after this command: DirCopy($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index), $sDestinationDir, 1) I would like to add: RunWait($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index), "\setup.exe") But it doesn't work Setup.exe is an simple sfx archive (sometimes will be usefull to apply some registry keys, .bat scripts and so on... ) We may use this RunWait( "checked folder", "\setup.exe") for each checked folder even setup.exe doesn't exist into folder. if there is no setup, the script will continue without questions.. How can we find the checked folder when we use RunWait command ? Hope you understand my reach English Thank you
  25. Thank you for the reply. I have installed the latest SciTE (4.4.6) as I mentioned earlier. I added those values to SciTEUser.properties, made a new file, and copied the content to the new file. The Encoding under File menu reverts to "Code Page Property" if I close and open the file. The positive change is that the German characters are displayed correctly (I think because we set the codepage to 65001).
  1. Load more activity
×
×
  • Create New...