need help cleaning up my battlecleric macro and adding more

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

van
a lesser mummy
a lesser mummy
Posts: 37
Joined: Mon Jun 24, 2002 1:04 am

need help cleaning up my battlecleric macro and adding more

Post by van » Fri Oct 17, 2003 2:24 pm

Stole the base from code i found here and butchered it. At least we know that you can call, call, call with no returns and not have anything blow up. This is what I have now in it and below that is what I would like it to do.

1. Starts up in wait state.
2. On tells it does the following commands


"Heal tank" - casts complete heal on tank
"Heal cleric" - heal over time on the bot
"Heal group" - casts group heal
"Attack this" - umm yea
"Cleric stop" - stop attacking (use this tell before heal tank)
"Cleric end" - /end macro

The latest version has
"Cleric follow me" - target tank and /follow
"Cleric stop following" - press left to break follow

What I would like help on making it cleaner and adding some cool abilities.


Take the attack/stop/end/follow/group heal - commands as normal BUT

automate the healing possess even if not grouped.


If not grouped you would need to supply the clericbot with a list of names to target and check health. Also range needs to be checked for heals.

Figure this could be done with arguments

/macro cleric.mac Nameone nametwo namethree namefour namefive name6

up to 6 arguments not including the cleric bot.


IF fed arguments it should cycle through the f1-f6 keys and the passed arguments

If run with 0 arguments bot should assume its in group mode.

Every 10 sec (even if its in wait state)
1. Check status of yaulp IV - if spell is available cast it (good for indoor if idle in wait state)

2. Cycle through f1-f6 and check health. Cycle through names passed in arguments

Get class of target

Check class to current hp and see if its time for a heal

Warrior health > 60% continue
Enchanter health <90 goto heal
Cleric health < 70 goto heal
sk health < 70 goto heal
(Each class has own rules of when healing is needed)

Heal would check class/current hp and pick best heal to use.

Cleric with health > 60 = 3000 point 4.6 sec heal
Cleric with health <50= fastheal

sk with health > 60 complete heal
sk with <30 = fastheal
sk with < 50 = 3000 point 4.6 sec heal

ench with health <50 = fast heal
ench with health <60 = 3000 point 4.6 sec heal


And so on and so on.

The above routine would need to be called every 10 sec.

So the wait section would have to have a timer for every 10 sec call and return

Attack would have to have a timer to call and return.

during follow mode we would want it doing nothing but idle till stop follow is issued.

Once that is all there we can add commands for
1. mana check before attacking (sorry master I am low on mana must med) yes the bot will refuse to tank while lom and cast horse or sit if bridle is not there or indoors.
2. report mana after each heal if mana is < 50%
3. rebuff HP buffs according to what wears off. (cleric symbol/virtue fades it recasts group symbol if more than 3 in group or more than 3 arguments passed, people in arguments should be grouped as it will only cast on argument 1) This will require you to make sure you do not have virtue on the cleric but the rest of the people have symbol. 10 min into the fight virtue fails and the cleric overwrites pot9+symbol with virtue =p
4. Refresh shielding when pot9 or shielding fades
5. Cast bor if faded and cycle through all casters and refresh it on fade and mana>80%

Any help getting this to that point would be nice. I see cleric bots all the time but not like this one.

sorry to be so long winded but I wanted to try to convey what I have been wanting to build.

Code: Select all

|CLERIC TANK.mac
|ripped from honduras's lazy shadow knight melee raid assist 
#Event Loading "You have been slain by a"

|commands sent by controlling toon
|replace cleric with name of cleric and tank with name of tank

#Event healtank "heal tank"
#Event healcleric "heal cleric"
#Event healgroup "heal group"
#Event attack "attack this"
#event wait "cleric stop"
#event end "cleric end"

#Event See "You can't see your target" 
#event Fizzle "Your spell fizzles!"
#event follow "cleric follow me" 
#event stopfollow "cleric do not follow me" 
#event Interrupt "Your casting has been interrupted!" 
#event Interrupt "Your spell is interrupted." 
|#event Recover "You haven't recovered yet..." 
|#event Recover "Spell recovery time not yet met." 
#event Resisted "You target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event Collapse "Your gate is too unstable, and collapses." 
#event target "you must first select a target  for this spell" 
#turbo 

Sub Main
/declare mytimer timer 
/varset mytimer 3s
/press esc
/press esc
/call wait

sub attack

/attack on
   :Loop 
      /if n $target(distance)>=20 /sendkey down up 
      /if n $target(distance)>=18 /sendkey down up 
      /if n $target(distance)<=10 /sendkey up up 
      /if n $target(distance)<=8 /sendkey up up 
      /if "$target()"=="TRUE" /if n $target(distance)>=20 /attack on 
      /face fast 
      /face look 
      /doevents 
      /if $char(ability,"Bash")>0 /if n $target(distance)<=15 /if n $v30==0 /doability "Bash" 
      |/if @mytimer==0 
      /if n $char(gem,"Yaulp VI")!=-2 /call castspell 
      /if "$target()"=="TRUE" /goto :Loop 
      /face look 
       /attack off 
      /call wait


      
sub castspell 
/echo Yaulp incoming
/doevent flush 
/sendkey up up
/delay 5
/call cast "Yaulp VI"
/varset mytimer 62s 
/return 

Sub Event_Enraged 
  /varset v30 1 
  /attack off 
  /echo Atk off 
  /sendkey down up 
  /sendkey up up 
  /face 
  /return 


Sub Event_See 
/press down 
/face fast 
/press down 
/return 

Sub Event_Offrage 
   /attack on 
   /return 

Sub Event_Gain 
   /attack off 
   /endmacro keep keys 

Sub Event_Loading 
   /endmacro keep keys 




Sub Event_healtank
/attack off
/echo healing tank
/doevents flush 
/sendkey up up 
/delay 5 
/sendkey up up
/target tank
/delay 5
/call cast "complete healing"
/delay 14 
/call wait



Sub Event_healcleric
/echo healing cleric
/doevents flush 
/sendkey up up 
/delay 5 
/sendkey up up
/target myself
/delay 5
/call cast "supernal elixir"
/delay 14 
/return


Sub Event_healgroup
/echo healing group
/g healing group stay close
/doevents flush 
/sendkey up up 
/delay 5 
/sendkey up up
/target myself
/delay 5
/call cast "word of replenishment"
/delay 14 
/return


Sub Event_attack
/assist tank

/call attack

Sub Event_stopfollow
/attack off

:waitloop
/echo stoping follow
/delay 5
/press left
/doevents
/call wait



Sub Event_follow
/attack off

:waitloop
/echo waiting for commands
/delay 5
/target tank
/delay 5
/follow
/doevents
/call wait

Sub wait
/attack off
:waitloop2
/echo waiting for commands
/delay 5
/doevents
/goto :waitloop2



Sub Event_end
/echo stoping 
/endmacro



Sub Cast(SpellName) 
  /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
  :StartCast 
  /if n $char(gem,"@SpellName")<0 /call WaitForRefresh "@SpellName" 
  /cast "@SpellName" 

|  :WaitCast 
|     /call ClearReturnValue 
|     /doevents Fizzle 
|     /doevents Interrupt 
|     /doevents Recover 
|     /doevents Standing 
|     /doevents OutOfRange 
|     /doevents OutOfMana 
|     /doevents Resisted 
|    /if n $return==CAST_RESTART /goto :StartCast 
|     /if n $return>=CAST_RESTART /return $return 

| /if "$char(casting)"=="TRUE" /goto :WaitCast 

/return CAST_SUCCESS 

Sub WaitForRefresh(SpellName) 
|   :LoopWaitForRefresh 
|      /delay 0 
|  /if n $char(gem,"@SpellName")<0 /goto :LoopWaitForRefresh 
/return 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_Select 
/endmacro keep keys 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESISTED 
Sub Event_Stunned 
   /varset CastStatus CAST_STUNNED 
/return 

Sub Event_Resisted 
   /varset CastStatus CAST_RESISTED 
/return