Insaynity Posted July 5, 2008 Share Posted July 5, 2008 (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 July 5, 2008 by Insaynity Link to comment Share on other sites More sharing options...
Backnor Posted July 5, 2008 Share Posted July 5, 2008 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 Link to comment Share on other sites More sharing options...
Insaynity Posted July 5, 2008 Author Share Posted July 5, 2008 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. Link to comment Share on other sites More sharing options...
Kitsune Posted July 5, 2008 Share Posted July 5, 2008 Here ya go, Quick 'N Clean muttley Func Attack() While 1 If PixelGetColor(171,148) = 0xFFFFFF Then MouseClick("left",585,234,1,0) ElseIf NOT PixelGetColor(147,230) = 0xFFFFFF Then MouseClick("left",260,276,1,0) Else RETURN EndIf Sleep(50) WEnd EndFunc 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