Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

script clicks "start game" button, moves cursor to the float, but when the float disappears (it cought a fish), the monitored pixel color turns to blue, so script should click "catch button" but nothing happens.

Posted

Try just

Until PixelGetColor(635, 608) = 0x1E70A6

I know the help says it returns a decimal value but from experience this still works.

just tried it, but still no luck. script isn't reacting, when the float goes underwater :idea:

Posted (edited)

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

Edited by hck7h60vrmn72
Posted

I cant find that colour anywhere on the picture

oh, silly me. that was wrong color, now i changed it to blue background color: 0xA57118

but the script still never detects the blue color. i will try some more.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...