Sign in to follow this  
Followers 0
Insaynity

Need help with function

4 posts in this topic

#1 ·  Posted (edited)

I need help with this function. What I want it to do is check if the pixel color at 171,148 is white,if it is then it will click 585,234. If the pixel is not white I want it to click on 260,276 until the pixel color at 147,230 is white. I also need it to loop over and over until the pixel color at 147,230 is white. Thanks for your help.

func attack()
mousemove(260,276)
while 1
do
    if pixelgetcolor(171,148) = 0xFFFFFF Then 
        mouseclick("left",585,234,1,$randomdelay)
else
        mouseclick("left",260,276,1,$randomdelay)
 until PixelGetColor(147,230) = 0xFFFFFF
EndIf
wend
endfunc
Edited by Insaynity

Share this post


Link to post
Share on other sites



I am still learning myself but try this

$randomdelay = Random(100, 1000)

Func attack()
    Do
        $atk = PixelGetColor(171, 148, 2)
        If $atk = 0xFFFFFF Then
            MouseClick("left", 585, 234, 1, $randomdelay)
            If $atk <> 0xFFFFFF Then
                MouseClick("left", 260, 276, 1, $randomdelay)
            EndIf
        EndIf
    Until $atk = 0xFFFFFF
EndFunc  ;==>attack

Share this post


Link to post
Share on other sites

I need help with this function. What I want it to do is check if the pixel color at 171,148 is white,if it is then it will click 585,234. If the pixel is not white I want it to click on 260,276 until the pixel color at 147,230 is white. I also need it to loop over and over until the pixel color at 147,230 is white. Thanks for your help.

func attack()
mousemove(260,276)
while 1
do
    if pixelgetcolor(171,148) = 0xFFFFFF Then 
        mouseclick("left",585,234,1,$randomdelay)
else
        mouseclick("left",260,276,1,$randomdelay)
 until PixelGetColor(147,230) = 0xFFFFFF
EndIf
wend
endfunc
Edited it a little but got it to work exactly how I wanted. This also helped me with another bit of code I had. Thank you.

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