Jump to content

color reading (easy script)


Recommended Posts

Hello guys, this is the first time, when i try to use autoit, so i'm a very beginner. Maybe someone can help me?

I'm trying to automate a flash game (not multi player), but something just doesn't work.

script is here:

WinActivate("fishing game")

Sleep(5000)

MouseClick("left", 603, 826) ;here i click on button to start fishing

Sleep(2000)

MouseMove(635, 608); mouse moves to the float

Sleep(1000)

Do

Sleep(1000)

Until Hex(PixelGetColor(635, 608), 6) = "1E70A6" ; the float is colored in red, when fishes drown it, then pointer is pointing to water, witch is blue (1E70A6) and then script must click another button

MouseClick("left", 635, 686); this is the "catch" button

and then i need to put it in a loop. another question, do i have to take coordinates from all monitor of from window only? my browser is maximized to first desktop, so there should be no difference...

screen from game: http://yfrog.com/b9fishesp

Edited by hck7h60vrmn72
Link to comment
Share on other sites

Hello guys, this is the first time, when i try to use autoit, so i'm a very beginner. Maybe someone can help me?

I'm trying to automate a flash game (not multi player), but something just doesn't work.

script is here:

WinActivate("fishing game")

Sleep(5000)

MouseClick("left", 603, 826) ;here i click on button to start fishing

Sleep(2000)

MouseMove(635, 608); mouse moves to the float

Sleep(1000)

Do

Sleep(1000)

Until Hex(PixelGetColor(635, 608), 6) = "1E70A6" ; the float is colored in red, when fishes drown it, then pointer is pointing to water, witch is blue (1E70A6) and then script must click another button

MouseClick("left", 635, 686); this is the "catch" button

and then i need to put it in a loop. another question, do i have to take coordinates from all monitor of from window only? my browser is maximized to first desktop, so there should be no difference...

screen from game: http://yfrog.com/b9fishesp

You need to tell us what it is that doesn't work. Maybe sleeping for 1 second is too long?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

still no luck. i checked the colors and coordinates, everything should be just fine...

one more picture of what is happening.

http://yfrog.com/78fishezzp

I cant find that colour anywhere on the picture

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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