First off, great set of tools L124RD! It's really cleaned up some of my hunting and bot macros.
I have a small update to fight.inc, I was having a few problems with it locking up EQW.
Changes:
- autoloot subroutine replaced, same functionality without lockups
- cleaned up /doability spam by checking ability readiness first
- turn on auto attack only when in melee range, less spam
Code: Select all
| - Fight.inc -
|--------------------
|
| Useable in many macros, use
| /call Melee
| Fights the current target, using
| methods to figure out what skills
| the fighter has to use against it,
| IE bash, kick, etc... WILL NOT
| BACKSTAB OR USE DISCIPLINES!!!
| /call AutoLoot <!> <@>
| Loot's the target corpse for any-
| thing that weighs less then ! and
| has a value of over @cp.
| /call BackStab [!]
| Will backstab until hit, if ! is
| set to 1 it will call 'melee' once
| the player has been hit.
|
| Authors : L124RD
|---------------------
|
|***********************************************************|
sub Melee
/varset a(8,0) "$target(name,clean)"
/varset a(8,1) $target(level)
/varset a(8,2) $target(name)
/varset a(8,3) $target(id)
/echo Fighting a level $a(8,1) $a(8,0)
/face
/sendkey down up
:CloserAF
/if "$target(id)"!="$a(8,3)" /goto :EndAF
/if n $target(distance)>15 /sendkey down up
/if n $target(distance)<6 /sendkey down down
/if n $target(distance)<16 /sendkey up up
/if n $target(distance)>5 /sendkey up down
/if n $target(distance)<15 /attack on
/if n $target(distance)>19 /attack off
/face fast nopredict
/if "$char(class)"=="Warrior" {
/if n $char(ability,"Disarm")>0 /doability "Disarm"
/if n $char(ability,"Bash")>0 /doability "Bash"
/if n $char(ability,"Slam")>0 /doability "Slam"
/if n $char(ability,"Kick")>0 /doability "Kick"
} else /if "$char(class)"=="Monk" {
/if n $char(ability,"Flying Kick")>0 /doability "Flying Kick"
/if n $char(ability,"Dragon Punch")>0 /doability "Dragon Punch"
/if n $char(ability,"Eagle Strike")>0 /doability "Eagle Strike"
/if n $char(ability,"Instill Doubt")>0 /doability "Instill Doubt"
/if n $char(ability,"Tiger Claw")>0 /doability "Tiger Claw"
/if n $char(ability,"Round Kick")>0 /doability "Round Kick"
/if n $char(ability,"Kick")>0 /doability "Kick"
/if n $char(ability,"Mend")>0 /doability "Mend"
} else /if "$char(class)"=="Shadow Knight" {
/if n $char(ability,"Bash")>0 /doability "Bash"
/if n $char(ability,"Harm Touch")>0 /doability "Harm Touch"
} else /if "$char(class)"=="Ranger" {
/if n $char(ability,"Kick")>0 /doability "Kick"
} else /if "$char(class)"=="Beast Lord" {
/if n $char(ability,"Bash")>0 /doability "Bash"
}
/goto :CloserAF
:EndAF
/echo The level $a(8,1) $a(8,0) is dead...
/sendkey up up
/sendkey up down
/attack off
/varset a(8,3) 0
/target corpse radius 20
/return
Sub AutoLoot
/if n $target(distance)>75 /goto :continue
/stand
/echo Looting $target(name,clean) for anything that weighs less then $p0 and has value of more then $p1 copper...
/face
/if n $target(distance)<15 /goto :CloseEnough
/call AutoRun 1
/varset t0 3m
:CloserAL
/face
/delay 0
/if n $target(distance)>14 /if n $t0>0 /goto :CloserAL
:CloseEnough
/call AutoRun 0
/loot
/Delay 10
/for v10 0 to 9
/Delay 5
/click left corpse $v10
/Delay 10
/if "$cursor(name)"=="NULL" /goto :continue
/if "$target(name)"~~$char(name) /click left auto
/if n $cursor(weight)>$p0 /click left destroy
/if n $cursor(value)<$p1 /click left destroy
/if "$cursor(name)"!="NULL" /echo looting "$cursor(name)". it has a value of "$cursor(value)"cp.
/if n $cursor(value)>9 /click left auto
/delay 4
/delay $rand(5)
/next v10
:continue
/delay 5
/delay $rand(5)
/press esc
/return
sub backstab
/stand
/varset a(8,0) $target(id)
/varset a(8,1) 1
:loop
/varcalc a(8,2) $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10)
/if n $distance($a(8,2))>5 /call backstab_gotopoint $p0
/face
/if n $a(8,1)==1 {
/varset a(8,1) 0
/attack off
/doability "Pick Pocket"
/doability "Backstab"
/attack on
/varset t45 10s
}
/if n $t45==0 {
/attack off
/doability "Pick Pocket"
/doability "Backstab"
/attack on
/varset t45 10s
}
/if $combat==FALSE {
/if n $p0==1 /call melee
/return
}
/if $target()==FALSE {
/if n $p0==1 /call melee
/return
}
/goto :loop
/return
sub backstab_gotopoint
/sendkey down up
:gotopointloop
/if $combat==FALSE {
/if n $p0==1 /call melee
/return
}
/if $target()==FALSE {
/if n $p0==1 /call melee
/return
}
/varcalc a(8,2) $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10)
/face fast loc $a(8,2)
/doevents
/if n $distance($a(8,2))>5 /goto :gotopointloop
/sendkey up up
/return
I haven't tested the rogue stuff yet.
Zertful