The problem is. It attacks, finish the mob, and then the character keeps running forward until stopped and killed by mobs, pulling everything on its way. I want it to stay the same spot, target and kill one at a time if possible.
First time using Autoit so I was kinda doomed to not get it working. Tried editing and found the correct pixels (I think) with photoshop. Still not working for me.
Posting how I've edited the script just in case I've ****ed up something.
Code:;+++ AFK BOT 1.0.4 by Tomatoes99. +++ Global $Paused, $Go = False, $c = 0, $r = 0 HotKeySet("+", "Begin") ;script toggled on/off by pressing = HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key HotKeySet("x", "Stop") ;script stopped by pressing x $playtime = 6 ;Time to spend playing, in hours $logouttime = 0 ;Time to spend logged out, in hours dim $skills[7]=["2", "4", "5", "T", "Q", "E", "R"] ;keys your skills are bound to (DON'T CHANGE THE NUMBER OF SKILLS UNLESS YOU KNOW WHAT YOU ARE DOING!) $xresolution = 1920 ;Put your X screen resolution here. $yresolution = 1080 ;Put your Y screen resolution here. ;Don't change this: $xrat = $xresolution/1280 $yrat = $yresolution/720 While 1 If ($Go) Then $c = 0 if CheckEvent() then ;If a mob is found, attack it for 6 seconds call("DoEvent") ElseIf $r >= $playtime*3600000 Then ;If no mobs are around, check if it is time to logout call("Logout") randsleep($logouttime*3600000) call("Login") $r = 0 else ;Otherwise, sleep for 10 seconds sleep(10000) $r +=10000 endif endif WEnd Func CheckEvent() ; Look for a mob for 15 seconds. do $c +=1 $r +=1000 sleep(900) send("{TAB}") sleep(100) PixelSearch(782*$xrat, 104*$yrat, 1036*$xrat, 102*$yrat, 0x962014, 5) If not @error Then return true endif until not @error OR $c >=15 $c = 0 EndFunc ; >CheckEvent Func DoEvent() ;Attacks until it can't find mobs. $r +=6000 RandSkill() Shoot1(1.5) RandSkill() Shoot1(1.5) EndFunc ; >DoEvent Func Shoot1($seconds) Do $c += 1 send("1") randsleep(200) Until $c >= ($seconds * 5) $c = 0 EndFunc Func RandSkill() send($skills[random(0,6,1)]) randsleep(1500) EndFunc ; >RandSkill Func Logout() MouseClick("left", 15*$xrat, 15*$yrat) sleep(200) MouseClick("left", 625*$xrat, 401*$yrat) sleep(200) MouseClick("left", 650*$xrat, 403*$yrat) EndFunc Func Login() MouseClick("left", 446*$xrat, 629*$yrat) sleep(200) MouseClick("left", 446*$xrat, 629*$yrat) sleep(25000) send("{ENTER}") EndFunc func RandSleep($ms) ; Sleeps + or - 25% of amount sleep($ms*random(.75,1.25)) endfunc ; >RandSleep Func Begin() $Go = Not $Go EndFunc ; >Begin Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc ; >TogglePause Func Stop() Exit EndFunc ; >Stop
Did you edit the $skills to match your action bar? The script shouldn't move your character at all.
For the time being, unfortunately you're just going to have to estimate how many seconds it takes to kill stuff. Death detection is necessary to kill stuff "one at a time". It's hard enough getting the pixelsearch for the health bar to work for everybody, so I'm probably not going to add it unless there's a really good spot where it is necessary/extremely useful.
Did you try running 1.0.4 without any editing (besides changing spells/resolution to your setup)? What happens when you try to run the script in game? Can you quote the part you edited?
Last edited by Tomatoes99; 08-29-2012 at 05:26 PM.
Changed the start key as well, but that shouldnt destroy it?$xresolution = 1920 ;Put your X screen resolution here.
$yresolution = 1080 ;Put your Y screen resolution here.
Func CheckEvent() ; Look for a mob for 15 seconds.
do
$c +=1
$r +=1000
sleep(900)
send("{TAB}")
sleep(100)
PixelSearch(782*$xrat, 104*$yrat, 1036*$xrat, 102*$yrat, 0x962014, 5)
If not @error Then
return true
endif
until not @error OR $c >=15
Didnt try running 1.0.4 fresh since i have another screen resolution.
Nothing happens while im ingame.
Sorry for being a total noob on autoit, but the skills I see in the script are:
RandSkill()
Shoot1(1.5)
How do I find the names for my other skills (so I can insert them instead of the ones above), I've tried using autoit to detect the names on the skills to add, but no luck.
Try 1.0.4 and change it to your resolution where it says to
change the numbers in quotes to the buttons on your keyboard of the skills you want to use, and leave them in quotes.Code:dim $skills[7]=["2", "3", "4", "5", "6", "7", "8"] ;keys your skills are bound to
Last edited by Tomatoes99; 08-29-2012 at 07:31 PM.
Only changing the screen res. did not help.
Ah that's too bad. Looks like its not so easy to make it work with every resolution. I would try subtracting from the first 2 coords and adding to the second 2 coords to make the detection box bigger. See if that works. For instance:
PixelSearch(416*$xrat, 38*$yrat, 769*$xrat, 155*$yrat, 0x962014, 5)
If that doesnt work, you can make it as big as your whole screen.
And if THAT doesnt work, its definitely the color that is the problem.
Let us know if anything works for you.
which section to edit to make it not constantly attacking even no mobs
re edited
hi I want to know if itdid work for some people cause all i see is prob.
not complainig here jeust want to know if some people got it to work without prob
Still nothing. Could it have something to do with me having 2 monitors?
Bot is trageting usw but he doesnt attacks!
Fixed.....
Last edited by G00DFe77a; 08-30-2012 at 02:16 PM.