Satanstheory Posted January 7, 2006 Share Posted January 7, 2006 Ok im wanting to create a bot for a small MMORPG i want it to search the landscap for moving creatures target them caste a spell rinse and repeat. Could somone give me some code examples please. Ive been searching google for like 7 hours going nuts. You can contact me on Aim , Msn, or Icq just Pm me . or post here ill check back .. and how would i add hot keys to that also im gonna do some research while i wait. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 Have you tried anything thus far at all? 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...
Satanstheory Posted January 7, 2006 Author Share Posted January 7, 2006 Well im not good at programing. But is thier a function to search the entire screen for moving things not by color? But ya see flowers and things also move. I got the colors for fox,snake, and racoon. But that wont be much help when they die they leave a carcus Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 Not quite sure what you mean 'Not by color'? Do the objects have 'Control Id's) if so you could use ControlGetPos(). 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...
Satanstheory Posted January 7, 2006 Author Share Posted January 7, 2006 (edited) Global $Paused HotKeySet("{Pause}","TogglePause") HotKeySet("{ESC}","Terminate") HotKeySet("+!d","ShowMessage") ; Define colour to match Local $Match = 0x860C0C ; Loop indefinitely While 1 ; Search the entire desktop for colour Local $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $Match,) ; If successful then click that location If Not @Error Then MouseClick('Left', $Coords[0], $Coords[1]) ; Wait until the colour at that point changes Do Sleep(1000) Until PixelGetColor($Coords[0], $Coords[1]) <> $Match Else While 1 Sleep(100) WEnd Func Togglepause() $Paused = NOT $Paused while $Paused sleep(100) ToolTip(' Bot is Paused Master "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 Func ShowMessage() MsgBox(4096m"","Terminated.") EndFunc Thats what i got so far But im getting a error that the Paused() doesn't have a While Statement. Also any idea's on how to get it to kill something before it switches to another target?It's Gotta use the insert key Edited January 7, 2006 by Satanstheory Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 (edited) Try putting: ToolTip(' Bot is Paused Master "Paused"',0,0) On one line: ToolTip(' Bot is Paused Master "Paused"',0,0) Edit: This is going to throw an error also: Func Terminate() Exit 0 Func ShowMessage() MsgBox(4096m"","Terminated.") EndFunc Can't have a function within a function: Func Terminate() Exit EndFunc Func ShowMessage() MsgBox(4096, 'm', 'Terminated'); note the comma after 4096 and quote around 'm'. EndFunc Also Take a look here: While 1 Local $Coords = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $Match,) If Not @Error And IsArray($Coord) Then MouseClick('Left', $Coords[0], $Coords[1], 1, 1) Do Sleep(1000) Until PixelGetColor($Coords[0], $Coords[1]) <> $Match EndIf WEnd Edited January 7, 2006 by SmOke_N 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...
Satanstheory Posted January 7, 2006 Author Share Posted January 7, 2006 (edited) Thanks alot.. The program seems to just Run and doesn't target anything should i try adding a ,10 after match and see if i get anything. Added a 10 to it still doesnt want to move the cursor to the red eyes on the bats and target them. Edited January 7, 2006 by Satanstheory Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 You catch on quick... yeh, start with 2 / 3 / 4 ... till you get the perfect blend... think of it as making the perfect steak... you can put every seasoning in the house on it, but it might not taste too good, or you can add little by little till it melts in your mouth. 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...
Satanstheory Posted January 7, 2006 Author Share Posted January 7, 2006 Thanks alot for all the help last night Smoke Got it to work off the black.. The bats seem to move a little faster then the cursor so it misses alot and somtimes retargets something else before i kill it. Im gonna use this till i finish off a packet based version.... Kinda like Client---> my program -----> Server That way all traffic goes through my program. 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