Guest d0__ob Posted August 6, 2005 Share Posted August 6, 2005 this is the color that i want to search for : 0xD098B0 these are the coordinates top left : 727,303 bottom left : 727,316 top right : 769, 303 bottom right: 769, 316 i want it to check this area for the color that i mentioned above, and if there is no such color ( @error=1 i guess), then it wll execute this function: Sleep(6000) MouseMove(742,288,0) MouseDown("left") MouseUp("left") do any of you know how to do this? ill send via airmail a cookie to you guys if you can lol j/k plz help! Link to comment Share on other sites More sharing options...
Frozenyam Posted August 6, 2005 Share Posted August 6, 2005 this is the color that i want to search for : 0xD098B0these are the coordinatestop left : 727,303bottom left : 727,316top right : 769, 303bottom right: 769, 316i want it to check this area for the color that i mentioned above, and if there is no such color ( @error=1 i guess), then it wll execute this function: Sleep(6000) MouseMove(742,288,0) MouseDown("left") MouseUp("left")do any of you know how to do this? ill send via airmail a cookie to you guys if you can lol j/k plz help!<{POST_SNAPBACK}>A "PixelSearch ()" command will allow you to search that location. A unsuccessful search will set @error to 1. So all you really need to do is use an "If... Else... Elseif... End" statement to "Call()" the desired function if @error is 1. You may need to use something like "GUICtrlGetState()" or "GUICtrlRead()" to read the @error value. Anyway... hopes this helps. If anyone else reads this and sees something wrong, feel free to correct me/it. "... and the Lord said to John, "Come forth and ye shall receive eternal life," but instead John came fifth and won a toaster." Link to comment Share on other sites More sharing options...
Guest d0__ob Posted August 6, 2005 Share Posted August 6, 2005 i already tried that. but for some reason it isn't working well.. in fact it isnt detecting it at all.. the reason why i put all the information here is so that maybe some kind soul would help me do it right then i can check it with my own script Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted August 6, 2005 Share Posted August 6, 2005 what are you searching for cuz if its a monster color theres a ton of shade variations on it that it wont find it Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 6, 2005 Moderators Share Posted August 6, 2005 (edited) Opt("PixelCoordMode", 0) Opt("MouseCoordMode", 0) Global $window = "The name of the site your playing" While WinExists($window) WinWait($window) If Not Winactive($window) Then WinActivate($window) $SearchPixel = PixelSearch(727, 303, 769, 316, 0xD098B0) Sleep(6000); Do you want to wait 6 seconds before clicking if the color isn't found? If @error Then MouseClick("left", 742, 288, 1, 1) EndIf Wend Edited August 6, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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