wlimpoodey Posted January 26, 2010 Share Posted January 26, 2010 Hey there i just started playing around with Autoit, and i have decided to make just a little requeue bot for Global Agenda game. Anyway here's my code so far (i know its childish but i'm still learning) Opt("WinWaitDelay",1000)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)WinWait("Global Agenda","")If Not WinActive("Global Agenda","") Then WinActivate("Global Agenda","")WinWaitActive("Global Agenda","")Send("m")MouseMove(1300,283)MouseDown("left")MouseUp("left")Sleep(1000)MouseMove(1287,794)MouseDown("left")MouseUp("left")MouseMove(1090,592)MouseDown("left")MouseUp("left")Sleep(186000)Send("aaa")Sleep(186000)Send("sss")Sleep(186000)Send("ddd")Sleep(186000)Send("www")Sleep(186000)MouseMove(1120,952)MouseDown("left")MouseUp("left")Note that the sleep function are used to time a 15.5 min timer for the missions to end.Now what it does, Using my resolution of the game, it will press M to open missions, then click the medium difficulty mission, then click join.So far this is working perfectly, Although there's a small problem, once queued the accept mission will pop, and there's no way of auto accepting it, so i have searched forums for a way to scan pixel, i did found some info but not exactly what i wantedWhat i need:The bot to search from 1100,381 To 1201,506 for the color #1b861b or 5,134,27Rgb (that color means a player accepted the mission)If the bot finds it it would click the accept button at 1090,592 and if it did not found it, it would search again for it after 5 second (that until its found)And then id need a function to loop :Send("m")MouseMove(1300,283)MouseDown("left")MouseUp("left")Sleep(1000)MouseMove(1287,794)MouseDown("left")MouseUp("left")MouseMove(1090,592)MouseDown("left")MouseUp("left")Sleep(188000)Send("aaa")Sleep(188000)Send("sss")Sleep(188000)Send("ddd")Sleep(188000)Send("www")Sleep(188000)MouseMove(1120,952)MouseDown("left")MouseUp("left")I know there are some good Autoit guru out there, pls help thanks! -jeep Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 26, 2010 Share Posted January 26, 2010 So you want PixelSearch() then. See helpfile. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 So you want PixelSearch() then. See helpfile.Yes i looked at the help file although i do not understand how to make it click IF it found the color and if not to search againSo far all i was able to make is $coord = PixelSearch( 1100, 381, 1201, 506, 0x05861B, 10 )If Not @error Then MouseMove(1090,592) MouseDown("left") MouseUp("left")EndIfUsed 10 shades that should be fine but, i need something like,If $coord is found then mouseover click etc etc, and if not search again in 5 secondsAny idea on how i could make that? Link to comment Share on other sites More sharing options...
ForsakenGod Posted January 26, 2010 Share Posted January 26, 2010 Yes i looked at the help file although i do not understand how to make it click IF it found the color and if not to search again So far all i was able to make is $coord = PixelSearch( 1100, 381, 1201, 506, 0x05861B, 10 ) If Not @error Then MouseMove(1090,592) MouseDown("left") MouseUp("left") EndIf Used 10 shades that should be fine but, i need something like, If $coord is found then mouseover click etc etc, and if not search again in 5 seconds Any idea on how i could make that? basically its simple While 1 $coord = PixelSearch( 1100, 381, 1201, 506, 0x05861B, 10 ) If @error = 0 Then ;; if color found the do action MouseMove(1090,592) MouseDown("left") MouseUp("left") Else ;; if not wait 5 secs and repeat :) Sleep(5000) EndIf Wend Good luck Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 basically its simple While 1 $coord = PixelSearch( 1100, 381, 1201, 506, 0x05861B, 10 ) If @error = 0 Then ;; if color found the do action MouseMove(1090,592) MouseDown("left") MouseUp("left") Else ;; if not wait 5 secs and repeat :) Sleep(5000) EndIf Wend Good luck Ahhh i was getting close haha thanks for the help and sharing you knowledge Link to comment Share on other sites More sharing options...
ForsakenGod Posted January 26, 2010 Share Posted January 26, 2010 Ahhh i was getting close haha thanks for the help and sharing you knowledge Np good luck Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 Opt("WinWaitDelay",1000)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)WinWait("Global Agenda","")If Not WinActive("Global Agenda","") Then WinActivate("Global Agenda","")WinWaitActive("Global Agenda","")Send("m")MouseMove(1300,283)MouseDown("left")MouseUp("left")Sleep(1000)MouseMove(1287,794)MouseDown("left")MouseUp("left")While 1 $coord = PixelSearch( 1093, 320, 1195, 505, 0x049A1D, 20 ) If @error = 0 Then MouseMove(1090,592) MouseDown("left") MouseUp("left") Else Sleep(3000) EndIfWendSleep(186000)Send("aaa")Sleep(186000)Send("sss")Sleep(186000)Send("ddd")Sleep(186000)Send("www")Sleep(186000)MouseMove(1120,952)MouseDown("left")MouseUp("left")Unfortunately the color scan does not work :S and i am absolutely sure my coord are right and i just checked again the color using photoshop and used 20 shades, any idea ? Link to comment Share on other sites More sharing options...
ForsakenGod Posted January 26, 2010 Share Posted January 26, 2010 Unfortunately the color scan does not work :S and i am absolutely sure my coord are right and i just checked again the color using photoshop and used 20 shades, any idea ?Try to do a quick debug If color found let it print up for eq : an msg box if not let it do nothink and then move the color over the pixelsearch ull see the result Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 (edited) Aiight just did with Opt("TrayIconDebug", 1) And it said Line 25 Sleep(3000) so it basicly means the script is waiting forever and not searching over and over right? Ive done it this way While 1 $coord = PixelSearch( 1093, 320, 1195, 505, 0x049A1D, 20 ) If @error = 0 Then MouseMove(1090,592) MouseDown("left") MouseUp("left") Else MsgBox(48, "aaaaaaa", "wwwwwww") EndIf Wend It just spam a msg box wich means theres no problem until there but i think i'm missing a function or something to make it repeat the color search after waiting 3 sec While 1 $coord = PixelSearch( 1093, 320, 1195, 505, 0x049A1D, 20 ) If @error = 0 Then MouseMove(1090,592) MouseDown("left") MouseUp("left") Else Sleep(3000) ;; << like something here EndIf Wend Edited January 26, 2010 by wlimpoodey Link to comment Share on other sites More sharing options...
ForsakenGod Posted January 26, 2010 Share Posted January 26, 2010 Aiight just did with Opt("TrayIconDebug", 1) And it said Line 25 Sleep(3000) so it basicly means the script is waiting forever and not searching over and over right? Ive done it this way While 1 $coord = PixelSearch( 1093, 320, 1195, 505, 0x049A1D, 20 ) If @error = 0 Then MouseMove(1090,592) MouseDown("left") MouseUp("left") Else MsgBox(48, "aaaaaaa", "wwwwwww") EndIf Wend It just spam a msg box wich means theres no problem until there but i think i'm missing a function or something to make it repeat the color search after waiting 3 sec While 1 $coord = PixelSearch( 1093, 320, 1195, 505, 0x049A1D, 20 ) If @error = 0 Then MouseMove(1090,592) MouseDown("left") MouseUp("left") Else Sleep(3000) ;; << like something here EndIf Wend That means the color you are looking for is not there or your searching area is badly setted Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 That means the color you are looking for is not there or your searching area is badly setted I see, hmmm you have any tips on how to find right searching area and color besides taking a high rez screenshot from game and using photoshop cs3 ? Link to comment Share on other sites More sharing options...
ForsakenGod Posted January 26, 2010 Share Posted January 26, 2010 I see, hmmm you have any tips on how to find right searching area and color besides taking a high rez screenshot from game and using photoshop cs3 ?Autoit Window Info.exe < ----- :D Link to comment Share on other sites More sharing options...
bogQ Posted January 26, 2010 Share Posted January 26, 2010 Note that your brakeing game Terms of Service and Privacy PolicyThe following list of prohibited conduct is for illustrative purposes only and is a non-exhaustive list of potential violations of these Terms of Service. You will be deemed to have violated these Terms of Service if you (or others using your Account) do any of the following: ...•Use or distribute "auto" software programs, "macro" software programs or other "cheat utility" software program or applications. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.  Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 Note that your brakeing game Terms of Service and Privacy PolicyThx i'm aware of that hhehe botted in wow, silroad, maple story, lotro, and now global its a part of my life ^^ too lazy to play Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 (edited) ok now this is workingOpt("WinWaitDelay",1000)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)Opt("TrayIconDebug", 1)WinWait("Global Agenda","")If Not WinActive("Global Agenda","") Then WinActivate("Global Agenda","")WinWaitActive("Global Agenda","")Send("m")MouseMove(1300,273)MouseDown("left")MouseUp("left")Sleep(1000)MouseMove(1287,784)MouseDown("left")MouseUp("left")Sleep(500)MouseDown("left")MouseUp("left")MouseMove(1090,582)While 1 $coord = PixelSearch( 1158, 392, 1195, 505, 0x04931c, 20 ) If @error = 0 Then MouseDown("left") MouseUp("left") Sleep(186000) Send("aaa") Sleep(186000) Send("sss") Sleep(186000) Send("ddd") Sleep(186000) Send("www") Sleep(186000) MouseMove(1120,952) MouseDown("left") MouseUp("left") Sleep(10000) Else Sleep(3000) EndIfWendBut id just like to add a command line that will return script to line 8 over and over again until stopped Edited January 26, 2010 by wlimpoodey Link to comment Share on other sites More sharing options...
wlimpoodey Posted January 26, 2010 Author Share Posted January 26, 2010 OK lets say i get the pixelsearch to find my green pixel i am looking for, although sometimes player click decline (red) and the bot would have to click accept again so id need just the fucntion that would let me While 1 $coord = PixelSearch( 1158, 392, 1195, 505, 0x04931c, 20 ) If @error = 0 Then MouseDown("left") MouseUp("left") Exitloop Else Sleep(3000) EndIf Wend But If $coord = the red one, return to line "While 1" any way of doing this ? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 26, 2010 Moderators Share Posted January 26, 2010 Thx i'm aware of that hhehe botted in wow, silroad, maple story, lotro, and now global its a part of my life ^^ too lazy to play Then you're probably aware that you're breaking ours.Topic closed, do not start another thread. 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 More sharing options...
Recommended Posts