Sign in to follow this  
Followers 0
S.C.G.R.

Fullscreen Pixel Searcher

2 posts in this topic

Ive been trying to make a pixel search script. But ive ran into some problems when trying to use it in a Fullscreened window. Does anyone know how to fix this? I keep getting a "Subscript used with non-Array variable." on this line of code.

MouseMove($Coords[0], $Coords[1])

MouseMove($Coords^ ERROR

(I also posted my code just in case I just made a silly mistake, so someone can tell me about it. :P )

Dim $Color_One = 0xFF0000
Dim $Color_Two = 0xD31E1E

HotKeySet("{Pause}", "ExitScript")

$S_running = "PixelSearch"
If WinExists($S_running) Then
    MsgBox ( 0 , "Whoops..." , "This program is already running.")
    Exit
EndIf
AutoItWinSetTitle($S_running)   

 $ExitScript = "no"

    While 1
    
    Global $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $Color_One)
    
    MouseMove($Coords[0], $Coords[1])
    
    If $ExitScript = "yes" Then ExitLoop
WEnd

Func ExitScript()
    $ExitScript = "yes"
EndFunc

Share this post


Link to post
Share on other sites



Ive been trying to make a pixel search script. But ive ran into some problems when trying to use it in a Fullscreened window. Does anyone know how to fix this? I keep getting a "Subscript used with non-Array variable." on this line of code.

MouseMove($Coords[0], $Coords[1])

MouseMove($Coords^ ERROR

(I also posted my code just in case I just made a silly mistake, so someone can tell me about it. :P )

Dim $Color_One = 0xFF0000
Dim $Color_Two = 0xD31E1E

HotKeySet("{Pause}", "ExitScript")

$S_running = "PixelSearch"
If WinExists($S_running) Then
    MsgBox ( 0 , "Whoops..." , "This program is already running.")
    Exit
EndIf
AutoItWinSetTitle($S_running)   

 $ExitScript = "no"

    While 1
    
    Global $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $Color_One)
    
    MouseMove($Coords[0], $Coords[1])
    
    If $ExitScript = "yes" Then ExitLoop
WEnd

Func ExitScript()
    $ExitScript = "yes"
EndFunc
Dim $Color_One = 0xFF0000
Dim $Color_Two = 0xD31E1E

HotKeySet("{Pause}", "ExitScript")

$S_running = "PixelSearch"
If WinExists($S_running) Then
    MsgBox ( 0 , "Whoops..." , "This program is already running.")
    Exit
EndIf
AutoItWinSetTitle($S_running)  

$ExitScript = "no"

    While 1
    
    $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $Color_One)
    If Not @error And IsArray($Coords) Then MouseMove($Coords[0], $Coords[1], 1, 1)
    
    If $ExitScript = "yes" Then ExitLoop
WEnd

Func ExitScript()
    $ExitScript = "yes"
EndFunc

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0