Sign in to follow this  
Followers 0
city

PixelSearch problem.

6 posts in this topic

My script :

$var=PixelSearch(0,0,024,786,1677215)

MsgBox(0,"",$var&" "&$var[0]&" "&$var[0])

If @error Then

$again=0

Else

MouseClick($x,$y,2,0)

$again=1

EndIf

Problem :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\test.au3"

C:\Documents and Settings\user\Desktop\test.au3 (2) : ==> Subscript used with non-Array variable.:

MsgBox(0,"",$var&" "&$var[1]&" "&$var[0])

MsgBox(0,"",$var&" "&$var^ ERROR

>Exit code: 0 Time: 4.753

I have some problem (above), tell me why? Isn't some AutoIt3-files broken or lost?

Share this post


Link to post
Share on other sites

per help

; Find a pure red pixel in the range 0,0-20,300

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0]& "," & $coord[1])

EndIf

this $coord is the same idea as your $var

if it is NOT @error then there is an array

( dont use $var only... you need to use $var[#] ( where # = number ))

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

My script :

Problem :

I have some problem (above), tell me why? Isn't some AutoIt3-files broken or lost?

Please post in Support first when you are not sure if its a bug...

You need to test the @error to see if PixelSearch() found the requested pixel..

Moved to Support


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

MsgBox(0, "X and Y are:", $coord[0]& "," & $coord[1])

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\user\Desktop\New AutoIt v3 Script (3).au3"

C:\Documents and Settings\user\Desktop\New AutoIt v3 Script (3).au3 (14) : ==> Subscript used with non-Array variable.:

MsgBox(0, "X and Y are:", $coord[0]& "," & $coord[1])

MsgBox(0, "X and Y are:", $coord^ ERROR

>Exit code: 0 Time: 0.339

It is same while i run your script .

Share this post


Link to post
Share on other sites

Again... there is only an array created in NOT @ERROR

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

; REMOVED - MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

8)


NEWHeader1.png

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