Ops, somehow things got screwed up when I tried to make it prettier ! dont think about using this until I fix it
T
This is what I use for my casterbots!
fixed: to work with multiple chars requesting bufs.
bug: multiple chars requesting same group buf recasts for each request
-EqA
Code: Select all
|castbot.mac
|written by EqAddict
#turbo
#include Spellcast.mac
#include spellbook.mac
#include bots.mac
#chat tell
#chat group
|----------------------------------------------------------
|Main loop is here, you need to add your own specific bot code (ie shamanbot found in bots.mac)
Sub Main
/echo Starting
/call cleanup
:mainloop
/varset l1 $a(castList,0)
/doevents
/if n $l1!=$a(castList,0) /goto :mainloop
|/if $char(class)=="Shaman" /call shamanBot
|/if $char(class)=="Enchanter" /call chanterBot
|/if $char(class)=="Druid" /call druidBot
/call castSpellList 3
/delay 2
/goto :mainloop
/return
|----------------------------------------------------------
Sub Event_Chat
/if n $instr("<$p1>","AUTHLIST")==-1 {
/mqlog UNAUTHORIZED ACCESS --->>> $p0 $p1 $p2
/return
}
/varset l1 "$p2"
/if "$arg(1,"$l1")"==KEYWORD {
/echo caught keyword from $p1
/varcalc l4 $strlen(KEYWORD)+1
/varcalc l3 $int($strlen("$l1")-$l4-1)
/varset l5 "$mid($l4,$l3,"$l1")"
/if "$char(book,"$l5")"=="NULL" {
/echo "$l5" - not my spell
} else {
/call putSpellOntoList "$l5" $p1
}
/if "$arg(1,"$l1")"==ATTACK {
/varset v92 1
}
/return
|----------------------------------------------------------
|Debug routine
sub showSpellList
/varset l1 $a(castList,0)
/for l2 $l1 downto 1
/echo $l2 --> $a(castList,$l2)
/next l2
/return
|----------------------------------------------------------
|Place a spell onto a LIFO (Last In First Out) stack
| usage: putSpellOntoList target spell
sub putSpellOntoList
/varset l1 $a(castList,0)
/varset a(castList,$l1) "$p1"
/varadd l1 1
/varset a(castList,$l1) "$p0"
/varadd l1 1
/varset a(castList,0) $l1
/return
|----------------------------------------------------------
|Process spells on list
|if a parameter is given it process only that many spells before returning
|ie castSpellList 2 will cast only 2 spells and return (uncast spells stay on stack)
| usage: castSpellList SlotToUse (ie 3)
sub castSpellList
/varset l1 $a(castList,0)
/if n $l1<=2 /return
/varset l3 0
/varsub l1 1
/for l2 $l1 downto 1
/varset l5 "$a(castList,$l2)" |spell
/varsub a(castList,0) 1
/varsub l2 1
/varset l4 "$a(castList,$l2)" |target
/echo casting $l5 on $l4
|only try to cast if we have it in book
/if "$char(book,"$l5")"!="NULL" {
/target $l4
:waitforprevspellcast
/varset l6 "$char(gem,$p0)"
/delay 2
/if n $char(gem,"$l6")<0 /goto :waitforprevspellcast
/call memorizespell "$l5" "$p0"
/stand
/delay 2
/call cast "$l5"
/varadd l3 1
/if $p0!="" /if n $l3>=$p0 /return
} else /echo "$l5" not my spell
/varset a(castList,$l2) "NULL"
/varsub a(castList,0) 1
/next l2
/return
