Daigtas Posted February 6, 2011 Posted February 6, 2011 Hi everyone. Im new to auto it, but already like it. So stright to my problem. Im building a game bot script. The game itself is based on flash so im using the pixelsearch function to find when the white color is gone then it shud do something. the problem is that im setting the coordinates of the pixelsearch (top-left corner and the bottum-right corner) and the variation of color as 1. the script seams to not see the very left side and the very right side. if anyone can suggest how to fix it or enchase the pixelsearch i wud be very grateful. the script itself so far looks like that: While 1 $plude = PixelSearch(93, 295, 902, 533, 0xFFFFFF, 1) if IsArray($plude) = True Then Sleep(2000) Else MouseMove(474, 588, 1) MouseClick("left",474, 588, 1) Sleep(3500) MouseMove(520, 450, 1) MouseClick("left", 520, 450, 1) MouseMove(474, 588, 1) MouseClick("left",474, 588, 1) Sleep(1500) EndIf WEnd as you can see the code is endless loop (that is the idea). Btw the main window of the flash game is movable, like in farmville, but the window where i am searching is the modal window inside(!) the game, so i cannot embed it. I cud get the flash vars there is some ingame vars and all the info as i can see is send as xml data. If i cud catche the xml response data and extract exact data in seconds from this: <wait t="382">a32e292efe3bb0abacc67dc7782a0945</wait> t="382" is the time, the next the next request hash. That way i wont nedd the PixelSearch function anymore. Just checking regulary the data inside this and setting the timer with it. One more thing, what function is to make a gui mode window to set variables. I am planning to make a gui window to set coordinates of the window becouse if i move the window it messes up the coords and the script does not work. I think i cud make an auto search of the window origins (to find the corrners of it and automaticly adjust the coords. The trickiest part is pixelsearch so far, the rest is the time to read all the documentation of scripting and learn with all of you guys Thanks for any advice ( btw, did i mention that im new to AutoIt scripting? )
Daigtas Posted February 6, 2011 Author Posted February 6, 2011 Forgot to mention, that the gui window for setting the coordinates shud be with buttons that when i press it it shud wait for next click, then when the user press it it shud promt a window with coordinates that the mouse was clicked and ask him is this ok or he wants to try again and change it. To tricky for me, i started to use this scripting just last night. thanks again for any advice
Developers Jos Posted February 6, 2011 Developers Posted February 6, 2011 Read the announcement at the top of the page and adhere to it. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts