S.C.G.R. Posted January 4, 2006 Share Posted January 4, 2006 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. ) 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 4, 2006 Moderators Share Posted January 4, 2006 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. ) 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 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now