Sign in to follow this  
Followers 0
spel565

Help

7 posts in this topic

this is my script. I want it to mousemove if a certain colour is detected at a certain place, but the mousemoves even if the certain colour isnt there..

While @error = 0

$pixel = pixelsearch(27, 751,8, 765,0xFFBE39)

WEnd

mousemove (536, 471,50)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If PixelGetColor($placeX, $placeY) = $color Then
MouseMove(536, 471,50) 
EndIf

small tip ;)

Insert this to loop

Edited by Sobiech

This world is crazy

Share this post


Link to post
Share on other sites

Try this

While 1
    $pixel = pixelsearch(27, 751,8, 765,0xFFBE39)
    If NOT @Error Then ExitLoop
WEnd
mousemove (536, 471,50)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If PixelGetColor($placeX, $placeY) = $color Then
MouseMove(536, 471,50) 
EndIf

small tip ;)

Insert this to loop

$colour=0xFFBB39

While 1

If PixelGetColor(29, 754) = $color Then

MouseMove(536, 471,50)

EndIf

WEnd

got error message = variable used without being declared

Edited by spel565

Share this post


Link to post
Share on other sites

You spelled color 2 different ways.

Share this post


Link to post
Share on other sites

$colour=0xFFBB39

While 1

If PixelGetColor(29, 754) = $color Then

MouseMove(536, 471,50)

EndIf

WEnd

got error message = variable used without being declared

$color <> $colour xD

Anyway i think you just cant insert all code into while loop

I think you can

$color = 0x2B6F70
While 1
If PixelGetColor(833, 224) = $color Then
MsgBox(0, "Color", "I found you!")
ExitLoop
Else 
ContinueLoop
EndIf
WEnd

This will be checking 833, 224 so many times until program not detect 0x2BF6F70 :evil:

When he fount it, then show MsgBox and Exit from Lopp (so close program in this code)

You can replace MsgBox with MouseMove ;)


This world is crazy

Share this post


Link to post
Share on other sites

$color <> $colour xD

Anyway i think you just cant insert all code into while loop

I think you can

$color = 0x2B6F70
While 1
If PixelGetColor(833, 224) = $color Then
MsgBox(0, "Color", "I found you!")
ExitLoop
Else 
ContinueLoop
EndIf
WEnd

This will be checking 833, 224 so many times until program not detect 0x2BF6F70 :evil:

When he fount it, then show MsgBox and Exit from Lopp (so close program in this code)

You can replace MsgBox with MouseMove ;)

That does work, thank you!

btw close topic someone..

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