Need quick help with this Beastlord assist macro please.

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

3boxer
orc pawn
orc pawn
Posts: 15
Joined: Fri Dec 12, 2003 11:12 am

Need quick help with this Beastlord assist macro please.

Post by 3boxer » Fri Dec 12, 2003 11:19 am

Greetings! I have been reading the site for a month or so and have decided to try and adapt a couple of scripts into a Beastlord assist script. Many thanks to those that have helped and contributed code which I am using.

Basically I 3 box (hence my name) a lot. I tank with my SK (the master). I'm wanting my beastlord to 'assist' or kill when told to. To slow when told to, and to follow when told to. That's basically it. I'm using Plasmic's spellcast as an include. I'm a little confused how to implement it tho, as you may notice that the end of the 'Slowthis' subroutine is incomplete - I'm not sure what to do with it. My goal was simply to have the BST slow when told to, check for fizzles, resists, etc using Plasmic's script, and then after a successful slow, return to the 'Main' subroutine - where I'll then issue a command to 'Kill'.

Am I doing this the right way? Does this look incomplete to you?

Thanks!

Code: Select all

|usage /mac assistme "mastername" 
|

#include Spellcast.inc

#turbo 
#Event kill "@Param0 tells you, 'kill"
#Event Slowthis "@Param0 tells you, 'slow"
#Event enraged "has become enraged" 
#Event toofar "Your target is too far away, get closer!" 
#Event follow "@Param0 tells you, 'follow'"

Sub Main

   | ----Declares 
   /declare slowSpell global 
   
   | ----CHANGE THESE DEFAULT SETTINGS AS APPROPRIATE---- 

   /varset slowSpell "Sha's Lethargy"
 
   :mainloop 
   /doevents 
   /delay 1s 
   /goto :mainloop 
/return 

Sub Event_kill 
   /assist @Param0  
   /delay 1s 
   /t commander Attacking %t
   /pet attack
   /call Combat 
/return 

Sub Event_follow 
   /press esc 
   /press esc 
   /stand 
   /attack off 
   /target @Param0 
   /t @Param0 Following you 
      :followLoop 
      /if n $target(distance)>40 /sendkey down up 
      /if n $target(distance)<20 /sendkey up up 
      /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="TRUE" /goto :followLoop 
/return 

Sub Event_toofar 
    /sendkey down up 
      :farLoop 
      /if n $target(distance)<30 /sendkey up up 
      /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="TRUE" { 
     /if n $target(distance)>40 /goto :farLoop 
     /call Combat 
   } 
/return 

Sub Event_enraged 
  /attack off
  /pet back off  
  /press esc 
  /t @Param0 rage 
  /delay 0 
/return 

Sub Combat 
   /attack on 
   :fight 
   /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="False" { 
     /sendkey up up 
     /call Main 
   } 
   /goto :fight 
/return

Sub Slowthis
   /assist @Param0
   /delay 1
   /call Cast "@slowSpell"
   /delay 1
   /if $return==CAST_SUCCESS { 
     }
/return

Here's Plasmic's spellcast.inc

Code: Select all

|Plazmic + 1 line change by Imperfect 

|** SpellCast.inc 
** This will cast a spell reliably for you... 
** Usage: 
** /call Cast "spellname" 
** It will return the following values: 
** CAST_SUCCESS 
** CAST_UNKNOWNSPELL 
** CAST_OUTOFMANA 
** CAST_OUTOFRANGE 
** CAST_CANNOTSEE 
** CAST_STUNNED 
** CAST_RESISTED 
** 
** New Vars Modification 
** Plazmic's no globals needed version 
**| 

|Oct 9, 2003 - Updated to work with new vars and $char(casting) - gf 
|Oct 11, 2003 - switched some logic, removed defines - gf 


#event Fizzle "Your spell fizzles!" 
#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 NoLOS "You cannot see your target." 
#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." 

Sub Cast(SpellName) 
  /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
  :StartCast 
  /call ClearReturnValue 
  /if n $char(gem,"@SpellName")<0 { 
     /delay 0 
     /goto :StartCast 
  } 
  /cast "@SpellName" 

  :WaitCast 
     /if "$char(casting)"=="TRUE" { 
       /delay 1 
       /goto :WaitCast 
     } 
     /doevents Fizzle 
     /doevents Interrupt 
     /doevents Recover 
     /doevents Standing 
     /doevents OutOfRange 
     /doevents OutOfMana 
     /doevents NoLOS 
     /doevents Resisted 
     /if "$return"=="CAST_RESTART" /goto :StartCast 
     /if "$return"!="CAST_SUCCESS" /return "$return" 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESISTED 

3boxer
orc pawn
orc pawn
Posts: 15
Joined: Fri Dec 12, 2003 11:12 am

Post by 3boxer » Fri Dec 12, 2003 2:09 pm

I think I answered my own question. I modified my current script and added elements of the mage script from Gnome001 and Azum (thanks guys). I think this will work. Going to test it out before posting it in the depot. My main goal was to create a simple script that would allow me to add some DPS when trying to 3-box a LDoN adventure. Hopefully this will allow me to use my Beastlord as a bot with minimal work.

Code: Select all

|usage /mac beastlord "mastername" 
| 
|This macro is for a simple Beastlord bot.
|It will follow simple commands as listed below.

#include Spellcast.inc 
#chat tell

#Event enraged "has become enraged" 
#Event toofar "Your target is too far away, get closer!" 

Sub Main 

/declare slowSpell local
/declare MastersName local 
/varset MastersName "@Param0"
/varset slowSpell "Sha's Lethargy"   

   :mainloop 
   /doevents 
   /delay 1s 
   /goto :mainloop 
/return 

Sub Event_Chat 
  /if "@Param1"!="@MastersName" /return 
  /if "@Param2"~~"sit" /sit 
  /if "@Param2"~~"stand" /stand
  /if "@Param2"~~"follow" /call Do-Follow 
  /if "@Param2"~~"assist" /call Do-Assist 
  /if "@Param2"~~"slow" /call Do-Slow 
  /if "@Param2"~~"attack" /call Do-Attack 
  /if "@Param2"~~"petattack" /call PetAttack 
  /if "@Param2"~~"petback" /call PetBack 

Sub Do-Attack 
   /assist @MastersName  
   /delay 1s 
   /t @MastersName Attacking %t 
   /pet attack 
   /call Combat 
/return 

Sub Combat 
   /attack on 
   :fight 
   /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="False" { 
     /sendkey up up 
     /call Main 
   } 
   /goto :fight 
/return

Sub Do-Follow 
   /press esc 
   /press esc 
   /stand 
   /attack off 
   /target @MastersName 
   /t @MastersName Following you 
      :followLoop 
      /if n $target(distance)>40 /sendkey down up 
      /if n $target(distance)<20 /sendkey up up 
      /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="TRUE" /goto :followLoop 
/return 

Sub Event_toofar 
    /sendkey down up 
      :farLoop 
      /if n $target(distance)<30 /sendkey up up 
      /face fast 
   /doevents 
   /delay 0 
   /if "$target()"=="TRUE" { 
     /if n $target(distance)>40 /goto :farLoop 
     /call Combat 
   } 
/return 

Sub Event_enraged 
  /attack off 
  /pet back off  
  /press esc 
  /t @MastersName RAGE!! 
  /delay 0 
/return 

Sub Do-Slow
   /sit off
   /assist @MastersName 
   /delay 1 
   /call Cast "@slowSpell" 
/return 

Sub PetBack
   /t @MastersName Pulling Pet Back
   /pet back off
/return

notadruid
a ghoul
a ghoul
Posts: 143
Joined: Mon Dec 08, 2003 6:02 pm

Post by notadruid » Sat Dec 13, 2003 11:46 am

Looks like you copy/pasted a lot from my preliminary monkpet.mac when it was still called bot.mac.

Did ya?

3boxer
orc pawn
orc pawn
Posts: 15
Joined: Fri Dec 12, 2003 11:12 am

Post by 3boxer » Mon Dec 15, 2003 10:09 am

Aye I think that's where some of the code comes from. Ive slept a few days since.

Thank you!