supadodger Posted May 17, 2007 Share Posted May 17, 2007 (edited) after about 4 hours it stops doing anything. it stays running, (at least the icon is in the taskbar) but it doesnt do any of the mousemoves or button presses. i know its not too clean but i havent mastered doing autoit cleanly yet. it does it on 3 seperate computers. expandcollapse popup;;;;;;;;;;;;;;;;;;;;;;;;;Options;;;;;;;;;;;;; Opt("MouseClickDownDelay", 50) Opt("SendKeyDownDelay", 50) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $hpbutton = "{2}" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinActivate ("Knight Online") Sleep(5000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AdLibEnable("My_AdLib_Function", 10000 * 100) While 1 Call ("Wait") Send ("s") Call ("Buttonz") Send ("s") Call ("EnemySearch") Send ("s") Call ("Buttonz") Send ("s") Call ("Attack") Send ("s") Call ("Buttonz") Send ("s") WEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Heal????????;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func Buttonz() $pot2 = PixelChecksum(318,724, 343,752) If $pot2 <> 2709465001 and $pot2 <> 1125787198 Then $hpbutton = "{2}" EndIf $pot3 = PixelChecksum(359,724, 387,752) If $pot3 <> 869051225 and $pot3 <> 138455423 Then $hpbutton = "{3}" EndIf $pot4 = PixelChecksum(403,724, 430,752) If $pot4 <> 912408972 and $pot4 <> 588267487 Then $hpbutton = "{4}" EndIf $pot5 = PixelChecksum(443,724, 470,752) If $pot5 <> 3579795392 and $pot5 <> 4249245283 Then $hpbutton = "{5}" EndIf $pot6 = PixelChecksum(485,724, 515,752) If $pot6 <> 1228129542 and $pot6 <> 2289156851 Then $hpbutton = "{6}" EndIf $pot7 = PixelChecksum(529,724, 554,752) If $pot7 <> 3186177673 and $pot7 <> 1011889601 Then $hpbutton = "{7}" EndIf $pot8 = PixelChecksum(569,724, 596,752) If $pot8 <> 613747395 and $pot8 <> 2732984632 Then $hpbutton = "{8}" EndIf ;;;;;;;;;;;;;;;;Pots $lowhp = PixelSearch(189, 36, 190, 42, 0xCE3010, 15) Sleep(100) If IsArray($lowhp) = 0 Then Send($hpbutton) Sleep(500) $lowhp = PixelSearch(189, 36, 190, 42, 0xCE3010, 15) Else EndIf $chi9 = PixelChecksum(612,724, 639,752) If $chi9 <> 740370240 Then $chibutton = "{9}" EndIf $chi0 = PixelChecksum(653,724, 682,752) If $chi0 <> 2164502073 Then $chibutton = "{0}" EndIf $lowchi = PixelSearch(166, 49, 181, 53, 0x184DBD, 10) If IsArray($lowchi) = 0 Then Send($chibutton) Else EndIf EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Check If You have A Mob Targetted;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func Wait() ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Potion Buttons;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $wait = PixelSearch(443, 69, 445, 71, 0xAE1210, 11) While IsArray($wait) = 1 $pot2 = PixelChecksum(318,724, 343,752) If $pot2 <> 2709465001 and $pot2 <> 1125787198 Then $hpbutton = "{2}" EndIf $pot3 = PixelChecksum(359,724, 387,752) If $pot3 <> 869051225 and $pot3 <> 138455423 Then $hpbutton = "{3}" EndIf $pot4 = PixelChecksum(403,724, 430,752) If $pot4 <> 912408972 and $pot4 <> 588267487 Then $hpbutton = "{4}" EndIf $pot5 = PixelChecksum(443,724, 470,752) If $pot5 <> 3579795392 and $pot5 <> 4249245283 Then $hpbutton = "{5}" EndIf $pot6 = PixelChecksum(485,724, 515,752) If $pot6 <> 1228129542 and $pot6 <> 2289156851 Then $hpbutton = "{6}" EndIf $pot7 = PixelChecksum(529,724, 554,752) If $pot7 <> 3186177673 and $pot7 <> 1011889601 Then $hpbutton = "{7}" EndIf $pot8 = PixelChecksum(569,724, 596,752) If $pot8 <> 613747395 and $pot8 <> 2732984632 Then $hpbutton = "{8}" EndIf ;;;;;;;;;;;;;;;;Pots $lowhp = PixelSearch(189, 36, 190, 42, 0xCE3010, 15) Sleep(100) If IsArray($lowhp) = 0 Then Send($hpbutton) Send ("ss") Else EndIf $chi9 = PixelChecksum(612,724, 639,752) If $chi9 <> 740370240 Then $chibutton = "{9}" EndIf $chi0 = PixelChecksum(653,724, 682,752) If $chi0 <> 2164502073 Then $chibutton = "{0}" EndIf $lowchi = PixelSearch(166, 49, 181, 53, 0x184DBD, 10) If IsArray($lowchi) = 0 Then Send($chibutton) Else EndIf $wait = PixelSearch(443, 69, 445, 71, 0xAE1210, 11) If IsArray($wait) = 1 Then TrayTip("Sleeping", "Sleeping", 25, 1) Send ("{s Down}") Sleep(50) Send ("{s Up}") Else EndIf WEnd EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Target Enemies;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func EnemySearch() TrayTip("Searching For Enemy", "Searching For Enemy", 5, 1) TrayTip("Sleeping", "Sleeping", 25, 1) If ProcessExists("KnightOnline.exe") Then Send ("{v Down}") Sleep(50) Send ("{v Up}") Else ProcessClose ("Launcher.exe") Sleep(5000) Mouseclick ("Left" , 42, 346, 2 ,0) Sleep(1000) Mouseclick ("Left" , 368, 408, 2 ,0) ;WinWait (" Run As" ,"" ,60000) Sleep(4000) Send ("wimp") Sleep (1000) Send ("{TAB}") Sleep (1000) Send ("wimp") Sleep(1000) Send ("{ENTER Down}") Sleep(50) Send ("{ENTER Up}") Sleep(5000) WinWait ("Knight Online" , "" , 30000) Sleep(5000) MouseClick ("left" , 803, 447, 2 ,0) Sleep(1000) Traytip ("", "Waiting For Login Screen", 15000) Sleep(10000) Send ("USERNAME") Sleep(2000) Send ("{TAB}") Send ("PASS") Sleep(2000) Send ("{ENTER Down}") Sleep(50) Send ("{ENTER Up}") Send ("{ENTER Down}") Sleep(50) Send ("{ENTER Up}") Sleep(10000) Traytip ("", "Waiting For Server Screen", 15000) Sleep(60000) Mouseclick ("Left" , 400, 585, 2 ,0) Sleep(25000) Traytip ("", "Waiting For Character Screen", 15000) MouseMove (393, 324) Mouseclick ("Left" , 393, 324, 2 ,0) Sleep(100) Mouseclick ("Left" , 125, 642) Sleep(25000) EndIf EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Attack Enemies;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func Attack() ;TrayTip("Checking Health", "Checking Health", 5, 1) $death = PixelSearch(521, 326, 521, 326, 0x570100) If IsArray($death) = 1 Then Mouseclick ("Left", 521, 326, 0) Sleep (1000) Send ("1") Sleep(1000) Send ("2") Else EndIf Sleep (1000) $avoid = PixelChecksum(407,52, 427,67) If $avoid <> 3400001110 And $avoid <> 2858478332 Then ;Sleep(1000) ; Else TrayTip("Attacking Mob", "Attacking Mob", 5,1) Send ("{a Down}") Sleep(100) Send ("{a Up}") Sleep(100) Send ("{1 Down}") Sleep(50) Send ("{1 Up}") Else Endif EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Rest Function (Not Implemented);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func Rest() $lowhp = PixelSearch(150, 38, 150, 39, 0xCE3010, 15) If IsArray($lowhp) = 0 Then Send ("1") Sleep(1000) Else EndIf Call ("wait") EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Logout and Back In to Avoid GM Test :) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func My_AdLib_Function() $wait = PixelSearch(443, 69, 445, 71, 0xAE1210, 11) If IsArray($wait) = 1 Then TrayTip("Sleeping", "Sleeping", 25, 1) Send ("{s Down}") Sleep(50) Send ("{s Up}") Sleep(5000) Send ("{ESC Down}") Sleep(50) Send ("{ESC Up}") Sleep(2000) Send($hpbutton) Sleep(2000) MouseMove (503, 361) Sleep(1000) Mouseclick ("Left" , 503, 361, 1 ,0) Sleep(15000) MouseMove (393, 324) Sleep(15000) Mouseclick ("Left" , 393, 324, 2 ,0) Sleep(100) Mouseclick ("Left" , 125, 642) Sleep(15000) Else Sleep(5000) Send ("{ESC Down}") Sleep(50) Send ("{ESC Up}") Sleep(5000) MouseMove (503, 361) Sleep(1000) Mouseclick ("Left" , 503, 361, 1 ,0) Sleep(15000) MouseMove (393, 324) Sleep(15000) Mouseclick ("Left" , 393, 324, 2 ,0) Sleep(100) Mouseclick ("Left" , 125, 642) Sleep(15000) EndIf EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Relog Function;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func Relog() If ProcessExists("KnightOnline.exe") Then Call ("Attack") Else ProcessClose ("Launcher.exe") Sleep(5000) Mouseclick ("Left" , 42, 346, 2 ,0) Sleep(1000) Mouseclick ("Left" , 368, 408, 2 ,0) Sleep(1000) Send ("wimp") Sleep(1000) Send ("{TAB}") Sleep(1000) Send ("wimp") Sleep(1000) Send ("{ENTER Down}") Sleep(50) Send ("{ENTER Up}") Sleep(5000) WinWait ("Knight Online" , "" , 30000) Sleep(5000) MouseClick ("left" , 803, 447, 2 ,0) Sleep(1000) Traytip ("", "Waiting For Login Screen", 15000) Sleep(10000) Send ("USRENAME") Sleep(2000) Send ("{TAB}") Send ("LOGIN") Sleep(10000) Traytip ("", "Waiting For Server Screen", 15000) Sleep(60000) Mouseclick ("Left" , 400, 585, 2 ,0) Sleep(25000) Traytip ("", "Waiting For Character Screen", 15000) MouseMove (393, 324) Mouseclick ("Left" , 393, 324, 2 ,0) Sleep(100) Mouseclick ("Left" , 125, 642) Sleep(25000) EndIf EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Edited May 17, 2007 by supadodger Link to comment Share on other sites More sharing options...
Ibrahim Posted May 17, 2007 Share Posted May 17, 2007 Hey man Sounds Like a big one why donot you say what it do so that we can help either getting arounf it or solving the problem my eyes hurts on looking to it [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Link to comment Share on other sites More sharing options...
Zedna Posted May 17, 2007 Share Posted May 17, 2007 1) add Opt('TrayIconDebug',1) to see where is your code running 2) Try remove unnecessary Call() 3) add litlle Sleep() into main loop to lower CPU consuming Opt('TrayIconDebug',1) While 1 Wait() Send ("s") Buttonz() Send ("s") EnemySearch() Send ("s") Buttonz() Send ("s") Attack() Send ("s") Buttonz() Send ("s") Sleep(10) WEnd Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Gigglestick Posted May 17, 2007 Share Posted May 17, 2007 (edited) Your script should error out on the line below because your quotes are unbalanced.WinWait ("Knight Online , "" , 30000)As for it working for 4 hours before dying, iduno. Edited May 17, 2007 by c0deWorm My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
supadodger Posted May 17, 2007 Author Share Posted May 17, 2007 Your script should error out on the line below because your quotes are unbalanced. WinWait ("Knight Online , "" , 30000) As for it working for 4 hours before dying, iduno. that was just a mistake in my paste, thx tho. Link to comment Share on other sites More sharing options...
supadodger Posted May 17, 2007 Author Share Posted May 17, 2007 1) add Opt('TrayIconDebug',1) to see where is your code running2) Try remove unnecessary Call()3) add litlle Sleep() into main loop to lower CPU consumingokay at the stopping point it shows nothing on autoit, cpu use by autoit is at 0 and memory usage is 496k.what i mean by showing nothing is the icon is still there but no tooltips and when i mouseover it doesnt say script.au3 or anything either.its not like autoit is crashing because if i right click on it i get pause or exit.really stumping me. Link to comment Share on other sites More sharing options...
Golbez Posted May 17, 2007 Share Posted May 17, 2007 (edited) edit: nvm about the game what are you trying to do with the bot? ive made a ko bot b4.. it works really well to can you have it no but ill help you improve yours if you want. ill help you code it i love making stuff for games Edited May 17, 2007 by Golbez 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