Jump to content

MouseDown() Until IsArray = @error


Recommended Posts

$x = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $color, 3, 2)
If IsArray($x) = 1 Then
Do
MouseDown("primary")
Until IsArray($x) = @error

it clicks until i click again.. how would i do this because if i try Until @error Then MouseUp("primary"), it gives off a syntax error.. how would i write this out?

Edited by demandnothing
Link to comment
Share on other sites

$x = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $color, 3, 2)
If IsArray($x) = 1 Then
Do
MouseDown("primary")
Until IsArray($x) = @error

it clicks until i click again.. how would i do this because if i try Until @error Then MouseUp("primary"), it gives off a syntax error.. how would i write this out?

You want: Until IsArray($x) = 0

Or maybe: Until Not IsArray($x)

But there's another problem. Nothing changes the state of $x inside the loop. So how would it ever change to not being an array so the loop could exit? Did you mean to have PixelSearch() inside the loop too?

:D

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

it is in my program, i just typed that out here so you could see what i was working with.. thank you for your help

the actual loop looks like

While 1
If $ON = True Then
$x = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $color, 3, 2)
If IsArray($x) = 1 Then
Do
MouseDown("primary")
Until IsArray($x) = 0
EndIf
EndIf
WEnd
Edited by demandnothing
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...