hck7h60vrmn72 Posted April 23, 2010 Share Posted April 23, 2010 (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 April 23, 2010 by hck7h60vrmn72 Link to comment Share on other sites More sharing options...
martin Posted April 23, 2010 Share Posted April 23, 2010 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 fishingSleep(2000)MouseMove(635, 608); mouse moves to the floatSleep(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" buttonand 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/b9fishespYou 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 More sharing options...
hck7h60vrmn72 Posted April 23, 2010 Author Share Posted April 23, 2010 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. Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2010 Share Posted April 23, 2010 Try just Until PixelGetColor(635, 608) = 0x1E70A6 I know the help says it returns a decimal value but from experience this still works. 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 More sharing options...
hck7h60vrmn72 Posted April 23, 2010 Author Share Posted April 23, 2010 Try justUntil PixelGetColor(635, 608) = 0x1E70A6I 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 Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2010 Share Posted April 23, 2010 Do $var = PixelGetColor(635, 608) Sleep(100) Until $var = 0x1E70A6 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 More sharing options...
hck7h60vrmn72 Posted April 23, 2010 Author Share Posted April 23, 2010 (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 April 23, 2010 by hck7h60vrmn72 Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2010 Share Posted April 23, 2010 still no luck. i checked the colors and coordinates, everything should be just fine...one more picture of what is happening.http://yfrog.com/78fishezzpI 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 More sharing options...
JohnOne Posted April 23, 2010 Share Posted April 23, 2010 I could be wrong but I think pixelgetcolor() uses RGB as opposed to BGR 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 More sharing options...
hck7h60vrmn72 Posted April 23, 2010 Author Share Posted April 23, 2010 I cant find that colour anywhere on the pictureoh, silly me. that was wrong color, now i changed it to blue background color: 0xA57118but the script still never detects the blue color. i will try some more. Link to comment Share on other sites More sharing options...
hck7h60vrmn72 Posted April 23, 2010 Author Share Posted April 23, 2010 I could be wrong but I think pixelgetcolor() uses RGB as opposed to BGRIT WORKS you were right and you are the best. the rest illdo myself 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