Jump to content

using PixelSearch


Guest d0__ob
 Share

Recommended Posts

Guest d0__ob

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 :dance: j/k :whistle: plz help!

Link to comment
Share on other sites

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 :dance: j/k :whistle: 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. :dance:

"... 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

Guest d0__ob

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 :whistle:

Link to comment
Share on other sites

  • Moderators

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 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

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...