Shaman Macro - v0.7.2 - Hubba (2004-11-09)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Kirurgen
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Nov 28, 2004 3:28 pm

Post by Kirurgen » Fri Dec 17, 2004 8:01 am

demitri wrote:ok!

Nuker works great but wont mem whatever spell you have assigned for the Toggle Nuke, just memms the dot even if you have dot false.

Tested this for about 7h stright today and I shouldt complain too much since Im not a coder I cant fix the problems or understand why they happen but here is some info:

I gather the group, start the script with ma as target, shammy will summon pet and buff but wont get into the combat loop or show exp whenever mob is killed. I start manually slow malo dd etc on the shammy with script running and all of a sudden it starts. I cant figure out what starts it, Ive tried loads of ways so I know how to do next time but its impossible hehe. BUT when its running, it runs and runs :)

FA works up untill you start chainpulling mobs, then the script freaks and seems to forget any timers of any FA'd melees.

I just wish I could explain more in code of what the problem is cuz this script is sooo nice!

You rock Hubba,
Deim
Same thing happens to me, my shammy fix pet, do FA and buff but i must manually "start" the slowing and combat reactions.

aristocle
orc pawn
orc pawn
Posts: 27
Joined: Mon Dec 13, 2004 3:54 pm

Post by aristocle » Fri Dec 17, 2004 3:52 pm

Code: Select all

/declare AssistAt      int   outer 100 
   /declare CombatAt      int   outer 99 
try changing this to

Code: Select all

/declare AssistAt      int   outer 99
   /declare CombatAt      int   outer 98
it wont malo on inc just takes sec longer but might fix your delay problem

vanemon
a lesser mummy
a lesser mummy
Posts: 58
Joined: Fri Aug 20, 2004 7:22 am

Post by vanemon » Sun Dec 26, 2004 6:44 pm

can somebody help me with 2 minor problems i have:

first: i want to add the "tiny companion" into the code, so that the pet is shrinked as well. if i add it to varsets-buff, he casts it over and over (sure, cause it isnt a buff - no length duration....)
second: though my shammy is 70, i dont have the new group spells - so i cant add them into the declare section. but i want him to self-buff at least the new spells (works great with "buff me", but not on the shammy itself)

im very glad about suggestions, thx in advance

aristocle
orc pawn
orc pawn
Posts: 27
Joined: Mon Dec 13, 2004 3:54 pm

Post by aristocle » Sun Dec 26, 2004 8:07 pm

try

Code: Select all

Sub BuffPet 

   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
      /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana} <= ${Me.CurrentMana}) { 
         /pet target 
         /delay 1s ${Me.Pet.ID}==${Target.ID} 
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
         /call cast ${SpellPetBuff[${i}]} gem5 9s 
         /call cast "Tiny Companion" gem5 7s
         /call cast "Tiny Companion" gem5 7s
         /call EquipItem ${MainItem} 
      } 
   /next i 
/return 
should only cast twice i dont use pet shrink so not tested or anything let me know if it works or not will look into it further


as for the single buffs just change grp buff declares to the single buffs you have then find the grpbuff sub and change it to this

Code: Select all

Sub GrpBuffs 
   /declare i int local 1 
   /for i 1 to ${SpellGrpBuff.Size} 
      /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) /return 
      /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 
         /target myself
         /delay 1s ${Me.ID}==${Target.ID}  
         /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
         /call cast ${SpellGrpBuff[${i}]} gem5 5s 
         /call EquipItem ${MainItem} 
      } 
   /next i 
/return 
it should buff u whenever your buffs fade you will hafta let group members use the /tell buff me part when theres fade try it out and see donno just off the top of my head fast fix

anon456
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Dec 12, 2004 3:22 pm

Post by anon456 » Sun Dec 26, 2004 8:35 pm

OK, I've been working with this macro all day, and am having much the same problems with it that has been discussed earlier. It will start up fine, mem all the spells that I want it to, it will set the assist to the PC that I want it to. It will try to summon a Drogmor, even indoors (I know of the fix for this, just haven't done it yet). It will cast and buff a pet. It will mem and cast the buff spells that I want it to. It will cast Canni4 and Stoicism as it needs to.
The one thing it won't do is attack anyone. the assist is there, but it won't malo or slow not will it send the pet in. I have used the <Echo toggle assistat> and always get this response.....<assisting at range: 0_longer range than 100 is futile> I also get a simlisr response for the <echo toggle combatat> <Initiate Combat at 0% (Malo/Slow). I have checked both of these variables and have set them as has been suguested, Assistat=99 and Combat=98. It has not helped.
I have also tried to spam <Echo toggle combatat 99> and it says that it will initiate combat at 99%, but it dosen't. I also tried <Echo Assistat 99>, but that didn't work either. For some reasin, the code isn't reconizing the 2 /declare statements for assistat and combatat.
If anyone has found a solution to this problem, please post it, as this would be an awesome macro if i could get it working as it is intended to work.

guest_01
a ghoul
a ghoul
Posts: 115
Joined: Thu Apr 22, 2004 5:15 am

Post by guest_01 » Sun Jan 16, 2005 10:31 am

Been working with this macro for the last couple days, think my version is ALMOST ready to release... just thought I'd post an update so that if I end up getting distracted, someone can remind me to finish it =P

Features include:
Slows all mobs in area that are attacking group members.

Can do HoT aswell as Instant heals, depending on HP level, set independantly for each class (ie. have my BST set to HoT at 70 %, then direct heal at 40 % for emergency heals).

Records pathing safe points, and automatically attempts to root park adds that attack it, then move out of range of all mobs, but as close to MT as possible. Also uses safe points to attempt to get close to group members that need buffs, but are out of range.

If group members need buffs, but are out of range, it puts buff on hold for a few seconds and tries again... previously, it would just forget about them.

Follow mode, allows the use of advpath.inc to autofollow, but disengages when combat is detected, then re-engages autofollow after combat is finished. Also, while in follow mode, if you don't move for a few seconds, shammy will assume you're taking a break, and start buffing/healing/cannying again until you continue moving.

Buff timers are kept between macro restarts (got tired of him trying to rebuff everyone each time I was testing another fix/feature =P)

Multiple bug fixes/performance fixes, in general.... think there were a few other things I added, but can't remember right now.... ATM, I'm having a strange bug with the optional pet heals and a loop when a group member isn't in zone, once I iron those out, I'll post the script.


Caveat: I've done most of my testing with a (51-54) shaman and a (56-57) beastlord duo. Started off in PoJ, and am now easily handling PoI/PoD/PoN without having to touch the shammy. Also stress tested it as main healer in a VERY fast pulling PoI group, where a 65 BST was chain pulling about a mob a minute on average. This is where I ran into the loop bug when a group member isn't in the zone, had to turn mac off and wait til he zoned back in before continueing.

PoJ was neat, because I could set up camp in one of the long halls, pull a sentry, and get 50 rat adds, and watch shammy root park and slow them all in a line down the hall =P
[url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=methejuggler@hotmail.com&item_name=guest_01&no_shipping=2&no_note=1&tax=0&currency_code=USD&lc=DK&bn=PP%2dDonationsBF&charset=UTF%2d8][img]http://www.paypal.com/en_US/i/btn/x-click-but21.gif[/img][/url]
If you like any of the plugins or macros I make, and would like to help with future development, please consider donating.
I don't play on live, so if you want updates for live, I'll need an account. Donations go towards paying for a live account. Any extra beyond that helps with motivation ;)

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Sun Jan 16, 2005 11:29 am

guest_01 wrote:ATM, I'm having a strange bug with the optional pet heals and a loop when a group member isn't in zone, once I iron those out, I'll post the script.
You're probably not checking if the group member's even in zone. If they're out of the zone their HP level returns 0, and therefore you try to heal them.

A simple addition to the logic will fix it, just add:

Code: Select all

${Group[x].ID}
to any /if that is checking group members. Make [x] whatever your /for loop variable is.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

guest_01
a ghoul
a ghoul
Posts: 115
Joined: Thu Apr 22, 2004 5:15 am

Post by guest_01 » Sun Jan 16, 2005 6:06 pm

Thought of that myself, but it wasn't working.... actually have resolved that issue now, working on another I noticed =P

The problem turned out to be that either you can't use multiple /next commands in a for loop (to proceed to the start of the loop early) or it was bugged for some reason, since

/if (!${Group[${g}].ID}) /next g

did nothing.... seemed to be basicly ignored by parser.... all I had to do was convert it to a bracketed statement like this and it worked:

/if (${Group[${g}].ID}) {
(healing command code stuff here)
}
[url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=methejuggler@hotmail.com&item_name=guest_01&no_shipping=2&no_note=1&tax=0&currency_code=USD&lc=DK&bn=PP%2dDonationsBF&charset=UTF%2d8][img]http://www.paypal.com/en_US/i/btn/x-click-but21.gif[/img][/url]
If you like any of the plugins or macros I make, and would like to help with future development, please consider donating.
I don't play on live, so if you want updates for live, I'll need an account. Donations go towards paying for a live account. Any extra beyond that helps with motivation ;)

guest_01
a ghoul
a ghoul
Posts: 115
Joined: Thu Apr 22, 2004 5:15 am

Post by guest_01 » Tue Jan 25, 2005 6:48 pm

Ok, I'm still not completely happy with this, but figured I'd post it anyway. There are certain situations I think it could handle better, but for now, it works not too badly.... only really has issues when things get REALLY harry (main healer/slower with multiple adds and many people needing healing.... healing and slowing take priority over rooting/moving away from adds, which can result in a dead shammy)

Of course, for most peoples usage, this shouldn't be a problem (or if it is, shammy usually can't be held responsible anyway =P)

Let me know what you think, any bugs you encounter, and feature requests.

Code: Select all

|__________________ Shaman Do Stuff Script _____________________| 
| 
| Version: v0.8.0 
| Release Date: 2004-11-09 
|____________________________________ By Hubba _________________| 
|____________________________________ Updated by guest_01 ______| 
| 
| Usage: 
| 1. Target player you like to assist (main tank is good) 
| 2. Start the script with: /mac <scriptname> 
|
| Don't forget to use /clearpathing when you get to camp, and
| run around the area a bit to set up the safe locations,
| otherwise shammy will just stand there looking dumb when 
| something attacks him, or run off back the way you came,
| quite possibly agroing things along the way.
|
| /resetbuffs [1-6] - this command resets the buff timers.
| If used by it's self, it resets all buff timers, Otherwise,
| it only resets the timers of the specified group member.
|
| Responds to the following commands in group chat and tells:
|
| follow me - this command will cause it to start to autofollow you
| wait here - ceases autofollow and resumes normal opperation
| mana - reports mana % in group chat
| sow - rebuffs bihli
| heal - uses instant heal on chat sender
| hot - uses hot on chant sender
| slow - assists and slows target - shouldn't be necessary
|
| 
| Use "help" for more help ( ! help is incomplete ! ) 
|_______________________________________________________________| 

| -!- This Script Uses spell_routines.inc by Rusty 
| -!- This Script Uses advpath.inc 
| -!- This Script Uses move.inc 
| -!- Exptrack snippet from exptracker.mac by Raebis, with tweaks from Phoenix 
| -!- Wait4Rez snippet from wait4rez.mac by fantum409 

#chat group 
#chat tell 

#Event   ToggleVariable   "[MQ2] Toggle #1#" 
#Event   ToggleVariable   "[MQ2] Toggle #1# #2#" 
#Event   OutDoor         "#*#outdoors#*#" 
#Event   NoMount         "You can not summon a mount here." 
#Event   ImDead         "You have been slain by#*#" 
#Event   Invited         "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 

#Event   UnderAttack         "#*#YOU for#*#points of damage." 
#Event   UnderAttack         "#*#YOU, but YOU#*#!" 
#Event   UnderAttack         "#*#YOU, but misses!" 

/declare noInvis int outer 1

#include Spell_Routines.inc 
#include advpath.inc 
#include move.inc

Sub Main 

/call InitAPFVars 1 15 20 


| ########### Make changes in spells as you need. 

   | The % of your spell duration bonus. 
   /declare SpellDurationBonus   outer 0 
    
   |- If you have no focus item, leave it blank. 
   /declare BuffFocusItem       outer "" 

   /declare SpellSlow          outer Turgur's Insects
   /declare SpellSlowGem          outer 3

   /declare SpellDoT         outer Envenomed Bolt
   /declare SpellDoTGem         outer 2

   /declare SpellPet           outer Frenzied Spirit
   /declare SpellPetGem           outer 8

   /declare SpellDeBuff        outer Malosi
   /declare SpellDeBuffGem        outer 6

   /declare SpellCanni         outer Cannibalize III
   /declare SpellCanniGem         outer 7

   /declare SpellHoT           outer Stoicism
   /declare SpellHoTGem           outer 5

   /declare SpellHeal          outer Superior Healing
   /declare SpellHealGem          outer 1

   /declare SpellRoot          outer Root
   /declare SpellRootGem          outer 4

   /declare SpellNuke         outer Ice Strike
   /declare SpellNukeGem         outer 8

   /declare SpellATK          outer 
   /declare SpellATKGem          outer 4

   /declare Mount             outer Tan Rope Bridle


   /declare SpellBuffsGem          outer 8




   /declare SpellPetBuff[1] string outer 
   /varset SpellPetBuff[1] "Alacrity" 

| ############ The Magic of single spell buffs... 
| ############ 
| ############ /declare SpellBuff[2,2] string outer 
| ############  Do only change the 1st number in [#,#] 
| ############  If you have three single spells to cast change the 1st number to 3. 
| ############ /declare SpellBuff[3,2] string outer 
| ############ 
| ############ /varset SpellBuff[1,1] "Spirit of Sense" 
| ############  This is the 1st line that is needed, Here you write your spell name 
| ############ /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter," 
| ############  The 2nd line is for the classes who gets the buff. 
| ############ NOTE: Only classes in group will get buffed 
| ############ NOTE: End the class line with a , If not you can BLOW up your computer. ;P 

   | Turn on or off Single buffs here. 
   /declare DoSingleBuffs      outer TRUE

   /declare SpellBuff[9,2] string outer 
    
   /varset SpellBuff[1,1] Regrowth
   /varset SpellBuff[1,2] "Bard,Beastlord,Berserker,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior," 

   /varset SpellBuff[2,1] Alacrity
   /varset SpellBuff[2,2] "Bard,Beastlord,Berserker,Monk,Paladin,Ranger,Rogue,Shadowknight,Warrior," 

   /varset SpellBuff[3,1] Deliriously Nimble 
   /varset SpellBuff[3,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[4,1] Dexterity
   /varset SpellBuff[4,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[5,1] Riotous Health
   /varset SpellBuff[5,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[6,1] Strength
   /varset SpellBuff[6,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[7,1] Inner Fire
   /varset SpellBuff[7,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[8,1] Infusion of Spirit
   /varset SpellBuff[8,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 

   /varset SpellBuff[9,1] Talisman of Altuna
   /varset SpellBuff[9,2] "Bard,Beastlord,Berserker,Cleric,Druid,Enchanter,Magician,Monk,Necromancer,Paladin,Ranger,Rogue,Shadowknight,Shaman,Warrior,Wizard," 


| ############ Group buffs... 

   /declare SpellGrpBuff[0] string outer 

|   /varset SpellGrpBuff[1] Talisman of Jasinth




    
   /declare AssistAt      int   outer 100 
   /declare CombatAt      int   outer 99 
   /declare CastDoTat      int   outer 98 
   /declare MinDoTat       int   outer 40
   /declare Rootat         int   outer 30 
   /declare NukeAt         int   outer 90 
   /declare CasterHeals   int   outer 90 
   /declare MeleeHeals      int   outer 75 
   /declare TankHeal      int outer 45 

   /declare DoMalo             outer FALSE   
   /declare DoSlow             outer TRUE 
   /declare FastSlow         outer FALSE 
   /declare DoRoot             outer FALSE 
   /declare SummonPet          outer TRUE 
   /declare BuffPet         outer TRUE 
   /declare HealPets         outer TRUE
   /declare DoDoT             outer FALSE 
   /declare DoBuffs          outer TRUE 
   /declare DoSow             outer TRUE
   /declare DoNuke            outer FALSE
   /declare DoHeal            outer TRUE 
   /declare DoHoT            outer TRUE 
   /declare Cannibalization   outer TRUE 
   /declare Verbose         outer FALSE 

   /declare AutoMove         outer TRUE
   /declare AllowAutoFollow         outer TRUE

   /declare NoMount         outer TRUE 


   | This is a delay for how long Avatar will hold. (8min) 
   /declare AvatarDelay       outer 5350 

   /declare ClassHeals[3] string outer

   /declare ClassHealsBard[3] string outer
   /varset ClassHealsBard[2] 40
   /varset ClassHealsBard[3] 60

   /declare ClassHealsBeastlord[3] string outer
   /varset ClassHealsBeastlord[2] 40
   /varset ClassHealsBeastlord[3] 70

   /declare ClassHealsBerserker[3] string outer
   /varset ClassHealsBerserker[2] 40
   /varset ClassHealsBerserker[3] 70

   /declare ClassHealsCleric[3] string outer
   /varset ClassHealsCleric[2] 40
   /varset ClassHealsCleric[3] 70

   /declare ClassHealsDruid[3] string outer
   /varset ClassHealsDruid[2] 40
   /varset ClassHealsDruid[3] 60

   /declare ClassHealsEnchanter[3] string outer
   /varset ClassHealsEnchanter[2] 40
   /varset ClassHealsEnchanter[3] 70

   /declare ClassHealsMagician[3] string outer
   /varset ClassHealsMagician[2] 40
   /varset ClassHealsMagician[3] 70

   /declare ClassHealsMonk[3] string outer
   /varset ClassHealsMonk[2] 40
   /varset ClassHealsMonk[3] 70

   /declare ClassHealsNecromancer[3] string outer
   /varset ClassHealsNecromancer[2] 40
   /varset ClassHealsNecromancer[3] 70

   /declare ClassHealsPaladin[3] string outer
   /varset ClassHealsPaladin[2] 40
   /varset ClassHealsPaladin[3] 70

   /declare ClassHealsRanger[3] string outer
   /varset ClassHealsRanger[2] 40
   /varset ClassHealsRanger[3] 70

   /declare ClassHealsRogue[3] string outer
   /varset ClassHealsRogue[2] 40
   /varset ClassHealsRogue[3] 70

   /declare ClassHealsShadowknight[3] string outer
   /varset ClassHealsShadowknight[2] 40
   /varset ClassHealsShadowknight[3] 70

   /declare ClassHealsShaman[3] string outer
   /varset ClassHealsShaman[2] 40
   /varset ClassHealsShaman[3] 60

   /declare ClassHealsWarrior[3] string outer
   /varset ClassHealsWarrior[2] 40
   /varset ClassHealsWarrior[3] 70

   /declare ClassHealsWizard[3] string outer
   /varset ClassHealsWizard[2] 40
   /varset ClassHealsWizard[3] 70




| ########### ! No Changes Are Needed From Here ! 

   /squelch /alias /domalo /echo toggle malo 
   /squelch /alias /doslow /echo toggle slow 
   /squelch /alias /dofastslow /echo toggle fastslow 
   /squelch /alias /doroot /echo toggle root 
   /squelch /alias /dopet /echo toggle pet 
   /squelch /alias /dodot /echo toggle dot 
   /squelch /alias /donuke /echo toggle nuke 
   /squelch /alias /nukeat /echo toggle nukeat    
   /squelch /alias /dobuffs /echo toggle buffs 
   /squelch /alias /dosow /echo toggle sow 
   /squelch /alias /assistat /echo toggle assistat 
   /squelch /alias /dotat /echo toggle dotat 
   /squelch /alias /rootat /echo toggle rootat 
   /squelch /alias /combatat /echo toggle combatat 
   /squelch /alias /healmeleeat /echo toggle healmeleeat 
   /squelch /alias /healcastersat /echo toggle healcastersat 
   /squelch /alias /healtankat /echo toggle healtankat 
   /squelch /alias /doassist /echo toggle assist 
   /squelch /alias /healat /echo toggle healat 
   /squelch /alias /status /echo toggle show 
   /squelch /alias /show /echo toggle show    
   /squelch /alias /bothelp /echo toggle help 
   /squelch /alias /verbose /echo toggle verbose    
   /squelch /alias /resetbuffs /echo toggle resetbuffs 
   /squelch /alias /clearpathing /echo toggle clearpathing
   /squelch /alias /dohot /echo toggle dohot
   /squelch /alias /doheal /echo toggle doheal
   /squelch /alias /HealPets /echo toggle HealPets

    
   /declare M_Assist   string   outer 
   /declare OutDoors         outer TRUE 
    
   /declare SpDuration         outer 
   /declare SpCastTime         outer 
   /declare SpDurBonus         outer 
    
   /declare MainItem         outer 
    
   /declare MeLoM            outer FALSE 
    
   /declare TargetArray[4] string outer 
   /declare MobMaloed         outer FALSE 
   /declare MobSlowed         outer FALSE 
   /declare PetOn            outer FALSE 
   /declare MobRooted         outer FALSE 
   /declare MobDoTed         outer FALSE 
   /declare CombatOn         outer TRUE

   /declare i int local 
   /for i 1 to ${SpellBuff.Size[1]} 
      /squelch /declare SpellBufftmr${i}0   timer   global 0 
      /squelch /declare SpellBufftmr${i}1   timer   global 0 
      /squelch /declare SpellBufftmr${i}2   timer   global 0 
      /squelch /declare SpellBufftmr${i}3   timer   global 0 
      /squelch /declare SpellBufftmr${i}4   timer   global 0 
      /squelch /declare SpellBufftmr${i}5   timer   global 0 
   /next i 
    
   /declare Exper float outer 
   /declare AAExp float outer 
       
   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 

   /declare ATKBuffed0 timer outer 0 
   /declare ATKBuffed1 timer outer 0 
   /declare ATKBuffed2 timer outer 0 
   /declare ATKBuffed3 timer outer 0 
   /declare ATKBuffed4 timer outer 0 
   /declare ATKBuffed5 timer outer 0 
    
   /declare CallManaTmr timer outer 0 

   /varset MobRooted FALSE 
   /varset MobMaloed FALSE 
   /varset MobSlowed FALSE 
   /varset PetOn FALSE 
   /varset MobDoTed FALSE 

      /varset MobRooted FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
      /varset CombatOn FALSE 
    
      /varset TargetArray[1] NULL 
      /varset TargetArray[2] NULL 
      /varset TargetArray[3] NULL 
      /varset TargetArray[4] NULL 

	/declare GroupMemHoTTime0 timer outer 0
	/declare GroupMemHoTTime1 timer outer 0
	/declare GroupMemHoTTime2 timer outer 0
	/declare GroupMemHoTTime3 timer outer 0
	/declare GroupMemHoTTime4 timer outer 0
	/declare GroupMemHoTTime5 timer outer 0

	/declare GroupMemPetHoTTime0 timer outer 0
	/declare GroupMemPetHoTTime1 timer outer 0
	/declare GroupMemPetHoTTime2 timer outer 0
	/declare GroupMemPetHoTTime3 timer outer 0
	/declare GroupMemPetHoTTime4 timer outer 0
	/declare GroupMemPetHoTTime5 timer outer 0

	/declare DebuffTimers[10] int outer

	/declare grpBuffTimer timer outer

	/declare grpBuffTimesAttempted int outer

	/declare j int local 1

	/declare following string outer FALSE

	/declare tookAction int outer 0
	/declare WaitingOnSpell int outer 0

	/declare didCanni int outer 0
	/declare noMoveCount int outer 0

	/declare underAttack timer outer 0
	/declare underAttackBy int outer NULL

	/declare LastSLAdded int outer

	/squelch /declare SafeLocs[20,2] float global

	/declare PrevLoc[2] float outer

	/varset PrevLoc[1] 0
	/varset PrevLoc[2] 0


	/declare DotTime timer outer

    
   /call MemSpells 
    
| ############### Target a player as Main Assist 
    
    /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
      /echo Your target is NOT a player, make sure its a player character! 
        /endmacro 
    } else { 
      /varset M_Assist ${Target.CleanName} 
      /echo Assist set to ${M_Assist} 
      /assist off 
    } 

:Main_Loop 

   /varset tookAction 0
   /varset WaitingOnSpell 0


   /if (${PrevLoc[1]}!=${Me.X} || ${PrevLoc[2]}!=${Me.Y}) {
	/varset PrevLoc[1] ${Me.X}
	/varset PrevLoc[2] ${Me.Y}
	/call AddSafeLoc
   }


   |- Check for new events in chat etc etc... 
   /doevents 
    

   /call GetTarget 



	/if (${FollowFlag}) {

		/if (${CombatOn}) {
        		/varset FollowFlag 0
        		/echo Combat Detected. No longer following. Resuming program.
			/keypress FORWARD
		}


		| -------- You need to add this call to your loop section in Main. ------------------------------------------ 
		/call AdvPathPoll 

		/delay 1

   		/if (!${Me.Moving}) {
			/if (${Me.State.Equal[Stand]} && !${underAttack}) /sit 
			/vardata noMoveCount Math.Calc[${noMoveCount}+1]
		}

   		/if (${noMoveCount} > 30) {
			/varset noMoveCount 0
			/goto :Hold_Main 
			
		}


		/goto :Main_Loop 

	}	


    |- Do we move? 
:Hold_Main 
    /if (!${FollowFlag} && ${Me.Moving}) /goto :Main_Loop 
    
    /if (${Me.State.Equal[Stand]}) {
	/if (${TargetArray[4]} && ${Target.ID}==${TargetArray[4]}) /face fast

	/if (!${underAttack}) {
		/sit 
	}
    }

    |- Let the group know Im LOM 
    /if (${Me.PctMana} < 20 && !${CallManaTmr}) { 
       /if (${Verbose}) /gsay ${Me.PctMana}% Mana 
       /varset CallManaTmr 900 
    } 

    |- Am I LoM? 
    /if (${Me.PctMana} < 25) /varset MeLoM TRUE 
    /if (${MeLoM}) /if (${Me.PctMana} > 35) /varset MeLoM FALSE 

	/if (${underAttackBy}) {
		/target id ${underAttackBy}
	
		/call cast "${SpellRoot}" gem${SpellRootGem}

		/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} || ${Macro.Return.Equal[CAST_IMMUNE]}) {
			/echo Rooted ${Target.CleanName}
		}
		/call AttemptAvoid
   		/goto :Main_Loop 
	}


   |- Summon drogmore 
   /if (!${Me.Mount.ID} && ${OutDoors} && !${NoMount}) {
	/call cast ${Mount} item 4s 
   	/goto :Main_Loop 
   }
    

   |- Wait until spells are ready it doesn't think it can't cast slow yet if it's been chain healing
   /if (!${Me.SpellReady[1]} && !${Me.SpellReady[2]} && !${Me.SpellReady[3]} && !${Me.SpellReady[4]}) /goto :Main_Loop

   /call CheckDebuffTimers
   /if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop 

   /call CheckSlowRadius
   /if (${tookAction} && !${WaitingOnSpell}) /goto :Main_Loop 


   |- Group Heals 
   /call Check_grpHPs 
   /if (${tookAction}) /goto :Main_Loop 

   /if (${Me.CurrentHPs} < ${Math.Calc[${Me.MaxHPs}-900]}) /call CheckMyHPs 
   /if (${tookAction}) /goto :Main_Loop 




   |- Check for mobs and do combat stuff 
   /if (${CombatOn}) /call Combat   
   /if (${tookAction}) /goto :Main_Loop  

   /if (${HealPets}) /call Check_grpPetHPs

   |- Canni 
   /if (${Cannibalization} && ${Me.AltAbilityReady[47]} && ${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-1200]} && ${Me.MaxHPs} > 3900) /call Cannibalization 
   /if (${tookAction}) /goto :Main_Loop 


   /if (${Me.PctMana} < 60) {
	/call cast "${SpellCanni}" gem${SpellCanniGem} 6s 
   	/goto :Main_Loop 
   }



   |- Sow Buff 
   /if (!${grpBuffTimer}) /if (!${Me.Buff[Spirit of Eagle].ID} && !${Me.Buff[Flight of Eagles].ID}) /if (!${Me.Buff[Spirit of Bih`Li].ID} && ${DoSow} && ${OutDoors}) { 


      /if (${grpBuffTimesAttempted}<3) {
      
	/for j 1 to 5
		/if (${Group[${j}].Distance} > ${Spell[Spirit of Bih`Li].AERange}) {
			/echo *** Need to rebuff Spirit of Bih`Li, but group members are too far away!
			/varset grpBuffTimer 150
			/varset grpBuffTimesAttempted ${Math.Calc[${grpBuffTimesAttempted}+1]}
			/goto :FollowingSoW
		}
	/next j
      }

      /call checkCanCast "Spirit of Bih`Li" gem${SpellBuffsGem}
      /varset WaitingOnSpell 1
      /if (!${Macro.Return}) /goto :FollowingBuffs

      /call EquipItem ${BuffFocusItem} 
      /varset MainItem ${Macro.Return} 
      /target pc ${M_Assist} 
      /if (${Verbose}) /gsay INC Spirit of Bih`Li, Stay close or miss out!
      /call cast "Spirit of Bih`Li" gem${SpellBuffsGem} 17s 
      /call EquipItem ${MainItem} 
      /varset grpBuffTimesAttempted 0
      /goto :Main_Loop 
   } 
:FollowingSoW

   |- Group Buffs 
   /if (${Me.PctMana} > 40) /if (!${grpBuffTimer}) /if (!${CombatOn} || (${CombatOn} && !(!${MobMaloed} && ${DoMalo}) && !(!${MobSlowed} && ${DoSlow}))) /if (${DoBuffs}) /call GrpBuffs 
   /if (${WaitingOnSpell}) /goto :FollowingBuffs
   /if (${tookAction}) /goto :Main_Loop 
   /if (${Me.PctMana} > 40) /if (${Me.SpellReady[${SpellATK}]}) {
	/call Cast_Avatar 
   	/if (${WaitingOnSpell}) /goto :FollowingBuffs
        /if (${tookAction}) /goto :Main_Loop 
   }

    |- Single Buff ! 
    /if (${Me.PctMana} > 40) /if (!${CombatOn} || (${CombatOn} && !(!${MobMaloed} && ${DoMalo}) && !(!${MobSlowed} && ${DoSlow}))) /if (${DoSingleBuffs}) /call SingleBuffs 
    /if (${WaitingOnSpell}) /goto :FollowingBuffs
    /if (${tookAction}) /goto :Main_Loop 

   |- Pet 
   /if (!${CombatOn} && !${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana} <= ${Me.CurrentMana}) {
        
        /call checkCanCast "${SpellPet}" gem${SpellPetGem}
        /if (!${Macro.Return}) /goto :FollowingBuffs

	/call cast "${SpellPet}" gem${SpellPetGem} 25s 
   	/goto :Main_Loop 
   }
   /if (!${CombatOn} && ${Me.Pet.ID} && ${BuffPet}) {
	/call BuffPet 
   	/if (${WaitingOnSpell}) /goto :FollowingBuffs
   	/if (${tookAction}) /goto :Main_Loop 
   }

:FollowingBuffs


   /if (((${Me.SpellReady["${SpellCanni}"]} && ${WaitingOnSpell}) || !${WaitingOnSpell}) && ${Me.PctMana} < 90) {
	/call cast "${SpellCanni}" gem${SpellCanniGem} 6s 
   	/goto :Main_Loop 
   }



   /goto :Main_Loop 
/return 

Sub MemSpells 

   /echo Memming spells. Hang on. 
   /if ( !${Me.Gem["${SpellCanni}"]} ) { 
      /memspell ${SpellCanniGem} "${SpellCanni}"
      /delay 25 
   } 
   /if ( !${Me.Gem["${SpellSlow}"]} ) { 
      /memspell ${SpellSlowGem} "${SpellSlow}"
      /delay 20 
   } 
   /if ( !${Me.Gem["${SpellDeBuff}"]} ) { 
      /memspell ${SpellDeBuffGem} "${SpellDeBuff}"
      /delay 20 
   } 
   /if ( !${Me.Gem["${SpellATK}"]} ) { 
      /memspell ${SpellATKGem} "${SpellATK}"
      /delay 20 
   } 
   /if ( !${Me.Gem["${SpellHeal}"]} ) { 
      /memspell ${SpellHealGem} "${SpellHeal}"
      /delay 20 
   } 
   /if ( !${Me.Gem["${SpellHoT}"]} ) { 
      /memspell ${SpellHoTGem} "${SpellHoT}"
      /delay 20 
   } 
   /if ( !${Me.Gem["${SpellDoT}"]} ) { 
      /memspell ${SpellDoTGem} "${SpellDoT}"
      /delay 30 
   } 
   |/if ( ${Window[SpellBookWnd].Open} ) /windowstate SpellBookWnd close 
   /echo Spells are memmed. 

/return 



| ################# Ensures that the spell is memmed and ready to cast,
| # so we're not waiting for 5 minutes for the recast timer to tick down

Sub checkCanCast(string spellName,string spellGem)

	/if ( ${Me.SpellReady[${spellName}]} ) /return 1

	/if ( !${Me.Gem[${spellName}]} ) { 
   		:mem_spell 
      		/if ( ${Cursor.ID} ) { 
        	 	/autoinventory 
      		   	/delay 5 
     		    	/goto :mem_spell  
      		} 
     	   	/memspell ${spellGem.Right[1]} "${spellName}" 
     		/delay 6s ${Me.Gem[${spellName}]} 
	}
   	/varset tookAction 1
	/varset WaitingOnSpell 1

/return 0


| ################# Checks for expired slow/debuff timers

Sub CheckDebuffTimers

	/declare i int local 1

	/for i 1 to ${DebuffTimers.Size}

		/if (${DebuffTimers[${i}]}) /if (!${Spawn[${DebuffTimers[${i}]}].ID} || ${Spawn[${DebuffTimers[${i}]}].State.Equal[DEAD]}) {
			/if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
				/deletevar DebuffTimer${DebuffTimers[${i}]}
			}

			/varset DebuffTimers[${i}] 0

		}

		/if (${DebuffTimers[${i}]}) /if (${Defined[DebuffTimer${DebuffTimers[${i}]}]}) /if (${DebuffTimer${DebuffTimers[${i}]}}<=6) {
			
			/target id ${DebuffTimers[${i}]}
			/call Slow
		}

	/next i

/return


Sub SetDebuffTimer(int id,timer t)

	/declare i int local 1

	/for i 1 to ${DebuffTimers.Size}
		/if (!${DebuffTimers[${i}]}) {

			/varset DebuffTimers[${i}] ${id}

			/if (!${Defined[DebuffTimer${DebuffTimers[${i}]}]}) {
				/declare DebuffTimer${DebuffTimers[${i}]} timer outer ${t}
			} else {
				/varset DebuffTimer${DebuffTimers[${i}]} ${t}
			}
			/return

		}
	/next i

/return


Sub CheckSlowRadius

	/declare s string local

	/declare i int local 1
	/declare g int local 1
	/declare h int local 1

	/for i 1 to 10
		

:CheckSlowRadiusLoop1

		/varset s ${Me.NearestSpawn[${i},npc].ID}

		/if (${Spawn[${s}].Distance}>${Spell[${SpellSlow}].Range}) /next i
		/if ((${DoMalo} && !${MobMaloed} && ${Spawn[${s}].ID}==${TargetArray[4]}) || (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana})) /next i

		/call CheckAttacking ${Spawn[${s}].ID}

   		/if (${Target.Type.Equal[NPC]} && ${Macro.Return}) { 


			/for g 0 to 6

				/if (${Group[${g}].ID}) /if (${Math.Distance[${Spawn[${s}].X},${Spawn[${s}].Y}:${Group[${g}].X},${Group[${g}].Y}]} <= 50) {

					/for h 1 to ${DebuffTimers.Size}

						/if (${DebuffTimers[${h}]}==${s}) {
						|	/varset i ${Math.Calc[${i}+1]}
						|	/if (${i}>15) /return
						|	/goto :CheckSlowRadiusLoop1
							/next i
						}

					/next h


					|/if (${LineOfSight[${Me.X},${Me.Y},${Me.Z}:${Spawn[${s}].X},${Spawn[${s}].Y},${Spawn[${s}].Z}]}) {
					|	/if (${LineOfSight[${Group[${g}].X},${Group[${g}].Y},${Group[${g}].Z}:${Spawn[${s}].X},${Spawn[${s}].Y},${Spawn[${s}].Z}]}) {

							/target id ${s}

							|/if (${DoMalo} && ${Target.Type.Equal[NPC]}) {
							|	/call DeBuff
							|}

							/if (${DoSlow} && ${Target.Type.Equal[NPC]}) {
								/call Slow
							}
							/if (${tookAction}) /return
					|	}
					|}
				}
			
			/next g
		}
	/next i

/return


| ################# This will check what Main Assist has in target. 

Sub GetTarget 

   /declare temp int inner 0

   /squelch /target clear

   /assist ${M_Assist} 
   /delay 5 ${Target.ID}

   /if (${Target.Type.Equal[NPC]}) /if (${Target.Distance}<=${AssistAt} && ${Target.ID}!=${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) { 
      /varset TargetArray[1] ${Target.CleanName} 
      /varset TargetArray[2] ${Target.Level} 
      /varset TargetArray[3] ${Target.Name} 
      /varset TargetArray[4] ${Target.ID} 
      /varset CombatOn TRUE 
       
      /varset MobRooted FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
      /varset DotTime 0
    

   } 
/return 

| ################### Check target and do stuff like slow, dot, pet attack etc. 

Sub Combat 

   /target id ${TargetArray[4]}

   /delay 3 ${Target.ID}==${TargetArray[4]}


   /if (${Target.ID}==${TargetArray[4]}) /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) { 

	/if (${Target.Distance}>${Spell[${SpellSlow}].Range}) /call AttemptAvoid

   }




   /if (${CombatOn} && !${MobMaloed} && ${DoMalo} && ${Target.ID}==${TargetArray[4]}) {
	/call DeBuff
	/return
   }
 
|   /if (${CombatOn} && !${MobSlowed} && ${DoSlow} && ${Target.ID}==${TargetArray[4]}) {
|	/call Slow 
|	/return
|   }

   /if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]}) { 
	/pet back off
      	/pet attack 
      	/varset PetOn TRUE 
   } 

   /if (${Defined[DebuffTimer${Target.ID}]} && ${DebuffTimer${Target.ID}} > 0) /if (${DotTime}<=0) /if (${Me.PctMana} > 65) /if (${CombatOn} && ${DoDoT} && ${Target.PctHPs}<=${CastDoTat} && ${Target.PctHPs}>=${MinDoTat}) { 
      	
	
        /call checkCanCast "${SpellDoT}" gem${SpellDoTGem}
        /if (!${Macro.Return}) /return

	/call cast "${SpellDoT}" gem${SpellDoTGem} 

	/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
		/varset DotTime ${Math.Calc[${Spell["${SpellDoT}"].Duration}*60-${Spell["${SpellDoT}"].CastTime}*10]}
	} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
		/call AttemptAvoid
	} else {
		/varset DotTime 50
	}

   	/varset tookAction 1

	/return
   } 
    
   /if (${Me.PctMana} > 60) /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt} && ${Target.PctHPs}>=15) { 
        /call checkCanCast "${SpellNuke}" gem${SpellNukeGem} 
        /if (!${Macro.Return}) /return

      	/call cast "${SpellNuke}" gem${SpellNukeGem} 
	/return
   } 
    
   /if (!${MobRooted} && ${CombatOn} && ${DoRoot} && ${Target.PctHPs}<=${Rootat}) { 
        /call checkCanCast "${SpellRoot}" gem${SpellRootGem} 
        /if (!${Macro.Return}) /return

      /call cast "${SpellRoot}" gem${SpellRootGem} 
      /varset tookAction 1
      /varset MobRooted TRUE 
   } 

|- EndCombat 

   /target id ${TargetArray[4]} 
    
   /if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) { 
      /varset MobRooted FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
      /varset CombatOn FALSE 
      /varset DotTime 0
    
      /varset TargetArray[1] NULL 
      /varset TargetArray[2] NULL 
      /varset TargetArray[3] NULL 
      /varset TargetArray[4] NULL 

      /varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]} 
      /varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]} 

      /echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
      /popup EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
      /varset Exper ${Me.PctExp} 
      /varset AAExp ${Me.PctAAExp} 


      /if (!${following.Equal[FALSE]}) {
          /echo Combat over. Resume following ${following}.
          /call FollowFunction "${following}"

      }
    
   } 

/return 

Sub DeBuff 
:DeBuff_Loop 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) { 
         /echo *** Shid ! I don't have mana to Malo %T 
      } else { 
        /call checkCanCast "${SpellDeBuff}" gem${SpellDeBuffGem}
        /if (!${Macro.Return}) /return

         /call cast "${SpellDeBuff}" gem${SpellDeBuffGem} 6s 
         /varset tookAction 1
         /if (!${Macro.Return.Equal["CAST_SUCCESS"]}) {
		/return
	 } else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
		/call AttemptAvoid
	 }
         /varset MobMaloed TRUE 
      } 
   } 
/return 

Sub Slow 

   /if (${DoMalo} && !${MobMaloed} && ${Target.ID}==${TargetArray[4]}) /return
   |/if (${Target.PctHPs}<=${CombatAt} && ${Target.Type.Equal[NPC]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) { 
         /echo Shid ! I don't have mana to Malo %T 
      } else { 
:Slow_Loop 
        /call checkCanCast "${SpellSlow}" gem${SpellSlowGem}
        /if (!${Macro.Return}) /return

         /call cast "${SpellSlow}" gem${SpellSlowGem} 6s 
         /varset tookAction 1
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /return
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /gsay < %T > is IMMUNE to slow ! 
          
            /varset MobSlowed TRUE 
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
               /if (${Verbose}) /gsay < %T > RESISTED slow ! Trying again...
                /return 
             } 
            /varset MobSlowed TRUE 
          } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay < %T > is SLOWED 
            /varset MobSlowed TRUE 

	    /call SetDebuffTimer ${Target.ID} ${Math.Calc[${Spell[${SpellSlow}].Duration}*60-100]}
          }  else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
		/call AttemptAvoid
	 }
         /if (${Macro.Return.Equal["CAST_CANNOTSEE"]}) { 
	    /call SetDebuffTimer ${Target.ID} 150
		/echo Cannot See: ${Target.CleanName}
          } 

      } 
   |} 
/return 

[url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=methejuggler@hotmail.com&item_name=guest_01&no_shipping=2&no_note=1&tax=0&currency_code=USD&lc=DK&bn=PP%2dDonationsBF&charset=UTF%2d8][img]http://www.paypal.com/en_US/i/btn/x-click-but21.gif[/img][/url]
If you like any of the plugins or macros I make, and would like to help with future development, please consider donating.
I don't play on live, so if you want updates for live, I'll need an account. Donations go towards paying for a live account. Any extra beyond that helps with motivation ;)

guest_01
a ghoul
a ghoul
Posts: 115
Joined: Thu Apr 22, 2004 5:15 am

Post by guest_01 » Tue Jan 25, 2005 6:53 pm

Code part 2 (too long for one post)

Code: Select all



| ################### Buff the group with buffs from the SpellGrpBuff array 
| ################### It will NOT cast any single target spells 

Sub GrpBuffs 
   /declare i int local 1 
   /declare j int local 1

   /if (!${SpellGrpBuff.Size}) /return

   /for i 1 to ${SpellGrpBuff.Size} 
      /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) /return 
      /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 

         /target id ${Me.ID} 
         /delay 1s ${Target.ID} 

	/call AttemptAvoid

	/if (${grpBuffTimesAttempted}<3) {
      
		/for j 1 to 5
			/if (${Group[${j}].Distance} > ${Spell[${SpellGrpBuff[${i}]}].AERange}) {
				/echo *** Need to rebuff ${SpellGrpBuff[${i}]}, but group members are too far away!
				
				/varset grpBuffTimer 150
				/varset grpBuffTimesAttempted ${Math.Calc[${grpBuffTimesAttempted}+1]}
				/return
			}
		/next j
	}

        /call checkCanCast "${SpellGrpBuff[${i}]}" gem${SpellBuffsGem}
        /if (!${Macro.Return}) /return

         /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
         /if (${Verbose}) /gsay INC ${SpellGrpBuff[${i}]}, Stay close or miss out!
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 

         /call cast "${SpellGrpBuff[${i}]}" gem${SpellBuffsGem} 5s 
         /varset tookAction 1
         /call EquipItem ${MainItem} 
	 /varset grpBuffTimesAttempted 0
	 /return
      } 
   /next i 
/return 

|################### Check if any group member needs healing

Sub Check_grpHPs 
   /declare g int local 1 
   /declare gClass string local

   /for g 0 to ${Group} 

	/if (${Group[${g}].ID} && !${Group[${g}].Type.Equal[CORPSE]}) {

		/varset gClass ${Group[${g}].Class.Name}


		/if ((${DoHoT} || !${g}) && ${Group[${g}].PctHPs}<=${ClassHeals${gClass}[3]}) { 


			/if (!${GroupMemHoTTime${g}}) {

   				/call SpellInformation "${SpellHoT}"
    
				/target pc ${Group[${g}]} 

               			/delay 1s ${Target.ID}==${Group[${g}].ID} 

				/if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
					/echo *** Shid ! I don't have mana to heal ${Group[${g}]} 
				} else /if (${Target.Distance}<=${Spell[${SpellHoT}].Range} && ${Target.ID}==${Group[${g}].ID}) { 
					/if (${Verbose}) /gsay ${SpellHoT} on < %T >
					/varset GroupMemHoTTime${g} ${SpDuration}
					/call cast "${SpellHoT}" gem${SpellHoTGem} 4s 
   					/varset tookAction 1
					/if (!${Macro.Return.Equal[CAST_SUCCESS]}) {
						/varset GroupMemHoTTime${g} 50
					} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
						/call AttemptAvoid ${Group[${g}].ID}
	 				}
				} else {
					/call AttemptAvoid ${Group[${g}].ID}
	 			}
			}
		}

		/if ((${DoHeal} || !${g}) && ${Group[${g}].PctHPs}<=${ClassHeals${gClass}[2]}) { 

			/target pc ${Group[${g}]} 
               		/delay 1s ${Target.ID}==${Group[${g}].ID} 
			/if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
				/echo *** Shid ! I don't have mana to heal ${Group[${g}]} 
			} else /if (${Target.Distance}<=${Spell[${SpellHeal}].Range}) { 
				/if (${Verbose}) /gsay ${SpellHeal} on < %T >
				/call cast "${SpellHeal}" gem${SpellHealGem} 4s
  		 		/varset tookAction 1 
			} else {
				/call AttemptAvoid ${Group[${g}].ID}
	 		}
			
		}
	}

   /next g
/return 


|################### Check if any group member's Pets need healing

Sub Check_grpPetHPs 
   /declare g int local 1 
   /declare gClass string local

   /for g 0 to ${Group} 

	/if (${Group[${g}].ID} && ${Group[${g}].Pet.ID}) {

		/varset gClass ${Group[${g}].Pet.Class.Name}

		/if ((${DoHoT}) && ${Group[${g}].Pet.PctHPs}<=${ClassHeals${gClass}[3]}) { 

			/if (!${GroupMemPetHoTTime${g}}) {

   				/call SpellInformation "${SpellHoT}"
    
				/target id ${Group[${g}].Pet.ID} 

               			/delay 1s ${Target.ID}==${Group[${g}].Pet.ID} 

				/if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
					/echo *** Shid ! I don't have mana to heal ${Group[${g}]}'s Pet 
				} else /if (${Target.Distance}<=${Spell[${SpellHoT}].Range} && ${Target.ID}==${Group[${g}].Pet.ID}) { 
					/if (${Verbose}) /gsay ${SpellHoT} on < %T >
					/varset GroupMemPetHoTTime${g} ${SpDuration}
					/call cast "${SpellHoT}" gem${SpellHoTGem} 4s 
   					/varset tookAction 1
					/if (!${Macro.Return.Equal[CAST_SUCCESS]}) {
						/varset GroupMemPetHoTTime${g} 50
					} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
						/call AttemptAvoid ${Group[${g}].Pet.ID}
	 				}
				} else {
					/call AttemptAvoid ${Group[${g}].Pet.ID}
	 			}
			}
		}

		/if ((${DoHeal}) && ${Group[${g}].Pet.PctHPs}<=${ClassHeals${gClass}[2]}) { 

			/target id ${Group[${g}].Pet.ID} 
               		/delay 1s ${Target.ID}==${Group[${g}].Pet.ID} 
			/if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
				/echo *** Shid ! I don't have mana to heal ${Group[${g}]}'s Pet
			} else /if (${Target.Distance}<=${Spell[${SpellHeal}].Range}) { 
				/if (${Verbose}) /gsay ${SpellHeal} on < %T >
				/call cast "${SpellHeal}" gem${SpellHealGem} 4s
  		 		/varset tookAction 1 
			} else {
				/call AttemptAvoid ${Group[${g}].Pet.ID}
	 		}
			
		}
	}

   /next g
/return 


| ################## Canni 5 

Sub Cannibalization 

   /call CheckMyHPs 
   /if (${Me.Buff[${SpellHoT}].ID} && ${Me.CurrentHPs} > 3200) { 
      /if (${Verbose}) /gsay *** Doing Cannibalization ! 
      /aa act Cannibalization 
      /delay 3s 
   } 

/return 

| ################## This will NOT check self HPs, Only check HoT or recast HoT 

Sub CheckMyHPs 

   /if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
      /echo *** Shit, I don't have mana to cast ${SpellHoT} 
   } else { 

			/if (!${GroupMemHoTTime0}) {

   				/call SpellInformation "${SpellHoT}"
    
				/target pc ${Group[0]} 

               			/delay 1s ${Target.ID}==${Group[0].ID} 

				/if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
					/echo *** Shid ! I don't have mana to heal ${Group[0]} 
				} else /if (${Target.ID}==${Group[0].ID}) { 
					/varset GroupMemHoTTime0 ${SpDuration}
					/call cast "${SpellHoT}" gem${SpellHoTGem} 4s 
   					/varset tookAction 1
					/if (!${Macro.Return.Equal[CAST_SUCCESS]}) {
						/varset GroupMemHoTTime0 50
					}
				} 
			}
   } 

/return 

| ################## Buff pet with spells from SpellPetBuff array 

Sub BuffPet 

   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
      /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana} <= ${Me.CurrentMana}) { 

        /call checkCanCast "${SpellPetBuff[${i}]}" gem${SpellBuffsGem}
        /if (!${Macro.Return}) /return

         /pet target 
         /delay 1s ${Me.Pet.ID}==${Target.ID} 
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
         /call cast "${SpellPetBuff[${i}]}" gem${SpellBuffsGem} 9s 
   	 /varset tookAction 1
         /call EquipItem ${MainItem} 
      } 
   /next i 
/return 

|################### Casting Avatar on all melee classes in group 

Sub Cast_Avatar 

   /declare i int local 0 
   /for i 0 to ${Group} 
   /if (${Group[${i}].ID}) { 
      /if (${ATKBuffed${i}}==0) /if (${Group[${i}].Class.Name.Equal[Beastlord]} || ${Group[${i}].Class.Name.Equal[Shadow Knight]} || ${Group[${i}].Class.Name.Equal[Bard]} || ${Group[${i}].Class.Name.Equal[Ranger]} || ${Group[${i}].Class.Name.Equal[Rogue]} || ${Group[${i}].Class.Name.Equal[Paladin]} || ${Group[${i}].Class.Name.Equal[Monk]} || ${Group[${i}].Class.Name.Equal[Warrior]}) { 
         /target pc ${Group[${i}]} 
         /delay 1s ${Group[${i}].ID}==${Target.ID} 
         /if (${Me.CurrentMana}>${Spell[${SpellATK}].Mana}) { 


            /call checkCanCast "${SpellATK}" gem${SpellATKGem}
            /if (!${Macro.Return}) /return



            /call EquipItem ${BuffFocusItem} 
            /varset MainItem ${Macro.Return} 
            /call cast "${SpellATK}" gem${SpellATKGem} 4s 
            /varset tookAction 1
            /if (${Macro.Return.Equal["CAST_SUCCESS"]}) {
		/varset ATKBuffed${i} ${AvatarDelay}´ 
	    }  else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
		/call AttemptAvoid
	    }
            /call EquipItem ${MainItem} 
            /return 
         } 
      } 
   } 
   /next i 
/return 

| #################### The Single boofs stuff routine kinda 
| Im sure there is a better way to do this. 
| But this is what I could crackup at work. 

Sub SingleBuffs 

   /declare i int local 1 
   /declare g int local 0 
   /declare h int local 1 
   /declare Classes int local 0 

   /if (!${SpellBuff.Size[1]}) /return

   /for i 1 to ${SpellBuff.Size[1]} 

      /if (${Spell[${SpellBuff[${i}]},1].Mana} > ${Me.CurrentMana}) /return 

      /varset Classes ${String[${SpellBuff[${i},2]}].Count[,]} 

      /for g 0 to ${Group} 

         /if (${SpellBufftmr${i}${g}}) /next g 

      	 /call SpellInformation "${SpellBuff[${i},1]}"

         /for h 1 to ${Classes} 

            /if (${Group[${g}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) { 

               /target pc ${Group[${g}]} 

               /delay 1s ${Target.ID}==${Group[${g}].ID} 

		/if (${Target.Distance}<=${Spell[${SpellBuff[${i},1]}].Range}) { 

			/if (${Me.CurrentMana}<${Spell[${SpellBuff[${i},1]}].Mana}) { 
				/return
			}

                        /call checkCanCast "${SpellBuff[${i},1]}" gem${SpellBuffsGem}
                        /if (!${Macro.Return}) /return

               		/call EquipItem ${BuffFocusItem} 

               		/varset MainItem ${Macro.Return} 

               		/call cast "${SpellBuff[${i},1]}" gem${SpellBuffsGem} ${SpCastTime} 
   			/varset tookAction 1

			/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${spellNotHold}) {
               			/varset SpellBufftmr${i}${g} ${Math.Calc[${SpDuration}-${SpCastTime}-${Spell[${SpellBuff[${i},1]}].RecastTime}*10-100]} 
			} else /if (${Macro.Return.Equal[CAST_OUTOFRANGE]}) {
				/call AttemptAvoid
	 		} else {
               			/varset SpellBufftmr${i}${g} 50
				/next h
			}

               		/call EquipItem ${MainItem} 
               		/return 
		} else {
			/call AttemptAvoid ${Group[${g}].ID}
               		/varset SpellBufftmr${i}${g} 50
			/next h
		}
            } 
         /next h 
      /next g 
   /next i 
/return 

| ################### Get some information of the spell to be used. 

Sub SpellInformation(string SpellName) 

   /varset SpDurBonus ${Math.Calc[${SpellDurationBonus}/100+1]} 

   /varset SpDuration ${Math.Calc[${Spell[${SpellName}].Duration}*60*${SpDurBonus}]}

   |/varset SpDuration ${Math.Calc[${Spell[${SpellName}].Duration}/10*60*${SpDurBonus}]} 

   /varset SpCastTime ${Math.Calc[${Spell[${SpellName}].CastTime}*10].Int} 

/return 

| ################### This will check whenever the player is changing any variable via /echo 

Sub Event_ToggleVariable(string Line, string Command, string Command2) 

	/declare i int local 1

   /if (${Command.Equal[malo]} && ${DoMalo}==0) { 
      /varset DoMalo TRUE 
      /echo Do Malo:   ${DoMalo} 
   } else /if (${Command.Equal[malo]}) { 
      /varset DoMalo FALSE 
      /echo Do Malo:   ${DoMalo} 
   } 

   /if (${Command.Equal[slow]} && ${DoSlow}==0) { 
      /varset DoSlow TRUE 
      /echo Do Slow:   ${DoSlow} 
   } else /if (${Command.Equal[slow]}) { 
      /varset DoSlow FALSE 
      /echo Do Slow:   ${DoSlow} 
   } 
    
   /if (${Command.Equal[fastslow]} && ${FastSlow}==0) { 
      /varset FastSlow TRUE 
      /echo Do Fast Slow:   ${FastSlow} 
   } else /if (${Command.Equal[fastslow]}) { 
      /varset FastSlow FALSE 
      /echo Do Fast Slow:   ${FastSlow} 
   } 
    
   /if (${Command.Equal[root]} && ${DoRoot}==0) { 
      /varset DoRoot TRUE 
      /echo Do Root:   ${DoRoot} 
   } else /if (${Command.Equal[root]}) { 
      /varset DoRoot FALSE 
      /echo Do Root:   ${DoRoot} 
   }    
    
   /if (${Command.Equal[pet]} && ${SummonPet}==0) { 
      /varset SummonPet TRUE 
      /echo Summon Pet:   ${SummonPet} 
   } else /if (${Command.Equal[pet]}) { 
      /varset SummonPet FALSE 
      /echo Summon Pet:   ${SummonPet} 
   }    
    
   /if (${Command.Equal[dot]} && ${DoDoT}==0) { 
      /varset DoDoT TRUE 
      /echo Do DoT:   ${DoDoT} 
   } else /if (${Command.Equal[dot]}) { 
      /varset DoDoT FALSE 
      /echo Do DoT:   ${DoDoT} 
   } 
    
   /if (${Command.Equal[buffs]} && ${DoBuffs}==0) { 
      /varset DoBuffs TRUE 
      /echo Do Buffs:   ${DoBuffs} 
   } else /if (${Command.Equal[buffs]}) { 
      /varset DoBuffs FALSE 
      /echo Do Buffs:   ${DoBuffs} 
   } 
    
   /if (${Command.Equal[sow]} && ${DoSow}==0) { 
      /varset DoSow TRUE 
      /echo Do Sow:   ${DoSow} 
   } else /if (${Command.Equal[sow]}) { 
      /varset DoSow FALSE 
      /echo Do Sow:   ${DoSow} 
   } 
    
   /if (${Command.Equal[nuke]} && ${DoNuke}==0) { 
      /varset DoNuke TRUE 
      /echo Do Nuke:   ${DoNuke} 
   } else /if (${Command.Equal[nuke]}) { 
      /varset DoNuke FALSE 
      /echo Do Nuke:   ${DoNuke} 
   } 
    
   /if (${Command.Equal[heal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoNuke} 
   } else /if (${Command.Equal[heal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoNuke} 
   } 

   /if (${Command.Equal[verbose]} && ${Verbose}==0) { 
      /varset Verbose TRUE 
      /echo Verbose:   ${Verbose} 
   } else /if (${Command.Equal[verbose]}) { 
      /varset Verbose FALSE 
      /echo Verbose:   ${Verbose} 
   } 

   /if (${Command.Equal[buffpet]} && ${BuffPet}==0) { 
      /varset BuffPet TRUE 
      /echo Buff Pet:   ${BuffPet} 
   } else /if (${Command.Equal[buffpet]}) { 
      /varset BuffPet FALSE 
      /echo Buff Pet:   ${BuffPet} 
   } 
    
   /if (${Command.Equal[assistat]}) { 
      /varset AssistAt ${Command2} 
      /echo Assisting at range:   ${AssistAt} _ (Longer range then 100 is futile) 
   } 
    
   /if (${Command.Equal[dotat]}) { 
      /varset CastDoTat ${Command2} 
      /echo Casting ${SpellDoT} at ${CastDoTat}% 
   } 
    
   /if (${Command.Equal[rootat]}) { 
      /varset Rootat ${Command2} 
      /echo Rooting Mobs at ${Rootat}% 
   } 
    
   /if (${Command.Equal[nukeat]}) { 
      /varset NukeAt ${Command2} 
      /echo Starting to Nuke Mobs at ${NukeAt}% 
   } 
    
   /if (${Command.Equal[combatat]}) { 
      /varset CombatAt ${Command2} 
      /echo Initiate Combat at ${CombatAt}% (Malo / Slow) 
   } 
    
   /if (${Command.Equal[healtankat]}) { 
      /varset TankHeal ${Command2} 
      /echo Healing ${M_Assist} at ${TankHeal}% 
   } 
    
   /if (${Command.Equal[healmeleeat]}) { 
      /varset MeleeHeals ${Command2} 
      /echo Healing all Melee classes at ${MeleeHeals}% 
   } 
    
   /if (${Command.Equal[healcastersat]}) { 
      /varset CasterHeals ${Command2} 
      /echo Healing all Caster classes at ${CasterHeals}% 
   } 
    
   /if (${Command.Equal[dohot]} && ${DoHoT}==0) { 
      /varset DoHoT TRUE 
      /echo Do HoT:   ${DoHoT} 
   } else /if (${Command.Equal[dohot]}) { 
      /varset DoHoT FALSE 
      /echo Do HoT:   ${DoHoT} 
   } 
    
   /if (${Command.Equal[DoHeal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoHoT} 
   } else /if (${Command.Equal[DoHeal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoHeal} 
   } 

   /if (${Command.Equal[HealPets]} && ${HealPets}==0) { 
      /varset HealPets TRUE 
      /echo HealPets:   ${HealPets} 
   } else /if (${Command.Equal[HealPets]}) { 
      /varset HealPets FALSE 
      /echo HealPets:   ${HealPets} 
   } 

    
   /if (${Command.Equal[clearpathing]}) { 

	/for i 1 to ${SafeLocs.Size[1]}
		/varset SafeLocs[${i},1] 0
		/varset SafeLocs[${i},2] 0
	/next i

   } 
    
   /if (${Command.Equal[assist]}) { 
      /varset M_Assist ${Command2} 

      /sq /target pc ${M_Assist} 
      /if (!${Target.ID}) { 
         /echo ${M_Assist} is not here dude ! 
         /return 
      } 
       
      /echo I will assist:   ${M_Assist} 
   } 
    

   /if (${Command.Equal[test]}) { 
	/call AttemptAvoid
        /return 
   } 

   /if (${Command.Equal[resetbuffs]} && !${Defined[Command2]}) { 
     /for i 1 to ${SpellBuff.Size[1]} 
      /varset SpellBufftmr${i}0   0 
      /varset SpellBufftmr${i}1   0 
      /varset SpellBufftmr${i}2   0 
      /varset SpellBufftmr${i}3   0 
      /varset SpellBufftmr${i}4   0 
      /varset SpellBufftmr${i}5   0 
     /next i 
   }
    

   /if (${Command.Equal[resetbuffs]} && ${Defined[Command2]}) { 
     	/for i 1 to ${SpellBuff.Size[1]}
      		/varset SpellBufftmr${i}${Math.Calc[${Command2}-1].Int}   0 
     	/next i 
   }
    

   /if (${Command.Equal[healat]}) { 
      /varset HealGRPat ${Command2} 
      /echo Healing any group member below ${HealGRPat}% HPs 
   } 

   /if (${Command.Equal[Show]}) { 
    
      /echo --------------------------- 
      /echo Do Malo:..............${DoMalo} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
      /echo Do Slow:..............${DoSlow} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
      /echo Do Fastslow:......${FastSlow} - (Will only try to slow once!) 
      /echo Do Nuke:.............${DoNuke} - Casting at: ${NukeAt}% (Will chain nuke mob to death) 
      /echo Do Dot:................${DoDoT} - Casting at: ${CastDoTat}% 
      /echo Do Pet:................${SummonPet} 
      /echo Do Buffs:.............${DoBuffs} 
      /echo Do Root:..............${DoRoot} - Casting at: ${Rootat}% 
      /echo Do Sow:...............${DoSow} 
      /echo Do Heal:..............${DoHeal} 
      /echo Buff Pet:.............${BuffPet} 
      /echo --------------------------- 
      /echo Assist range: ${AssistAt} 
      /echo Assisting: ${M_Assist} 
      /echo Healing Casters: ${CasterHeals}% Melees: ${MeleeHeals}% 
      /echo ${M_Assist} get heals at ${TankHeal} 
      /echo Initiate Combat: ${CombatAt}% 
      /echo Verbose: ${Verbose} 
      /echo 
      /echo help - Will show help to set variables. 
       
   } 
    
   /if (${Command.Equal[help]}) { 
      /echo ___ Shaman Do Stuff Script ___ 
      /echo 
      /echo Commands that will turn ON or OFF 
      /echo /domalo, /doslow, /dofastslow, /doroot, /dopet, /dodot, /dobuffs, /dosow, /donuke, /doheal, /dobuffpet 
      /echo 
      /echo /dofastslow will NOT check if the slow is landed or not. Good to have on when you skip maloing. 
      /echo Commands to change values, ie: /assistat 50 (Will start the combat routine when mob is in range 50) 
      /echo /assisat <range> - Most spells don't go longer then 100 
      /echo /combatat <% hps> - Initiate Combat when mob is at % HPs 
      /echo /healtankat <% hps> 
      /echo /healmeeleat <% hps> 
      /echo /healcastersat <% hps> 
      /echo /doassist <PC Name> 
   } 
    
/return 

| ###################################################################################################### 

Sub Event_OutDoor 
    
   /echo This is an indoor zone. Sorry. 
   /varset OutDoors FALSE 

/return 

| ###################################################################################################### 

Sub Event_NoMount 
    
   /echo No mount in this zone. Sorry. 
   /varset NoMount TRUE 

/return 

| ###################################################################################################### 

Sub Event_Invited 
   /invite 
/return 

| ################## 

Sub Event_ImDead 

   /declare i int local 1

   /echo Bummer ! 


:Zone_Loop 
   /if ( ${Me.Bound.ID} != ${Zone.ID} ) /goto :Zone_Loop 

   /varset FollowFlag 0
   /varset underAttackBy 0

   /varset MobRooted FALSE 
   /varset MobMaloed FALSE 
   /varset MobSlowed FALSE 
   /varset PetOn FALSE 
   /varset MobDoTed FALSE 
   /varset CombatOn FALSE 
   /varset DotTime 0
    
   /varset TargetArray[1] NULL 
   /varset TargetArray[2] NULL 
   /varset TargetArray[3] NULL 
   /varset TargetArray[4] NULL 

   /delay 5s 
   /consent group 
   /consent raid
   /delay 5 
   |/gsay Im ready to get rez. 
   /call Wait4Rez 

   /delay 20 

   /call MemSpells 

   /if (${Command.Equal[resetbuffs]}) { 
     /for i 1 to ${SpellBuff.Size[1]} 
      /varset SpellBufftmr${i}0   0 
      /varset SpellBufftmr${i}1   0 
      /varset SpellBufftmr${i}2   0 
      /varset SpellBufftmr${i}3   0 
      /varset SpellBufftmr${i}4   0 
      /varset SpellBufftmr${i}5   0 
     /next i 
   }
    

/return 


| ################## This part is taken from wait4res. 

Sub Wait4Rez 

:waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
      /delay 5s ${Window[ConfirmationDialogBox].Open} 
      /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
:zonein 
   /delay 5 
   /squelch /target mycorpse 
   /delay 5 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /delay 3s 
      /call Loot_Corpse 
   } else /goto :zonein 

/return 

Sub Loot_Corpse 

  /declare LootTotal int local 0 
  /declare LootSlot int local 

  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 1s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 

  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 

  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 

/return 

| ################# Tells n Hells 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 
      /if (!${ChatType.Equal[GROUP]} && !${ChatType.Equal[TELL]}) /return 
       
      /if (${ChatText.Equal[heal]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) {
		/call cast "${SpellHeal}" gem${SpellHealGem}
   		/varset tookAction 1
	}
      /return 
      } 

      /if (${ChatText.Equal[hot]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) {
		/call cast "${SpellHoT}" gem${SpellHoTGem}
   		/varset tookAction 1
	 }
      /return 
      } 
       
      /if (${ChatText.Equal[slow]}) { 
         /assist ${ChatSender} 
	 /delay 3
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast "${SpellMalo}" gem${SpellMaloGem} 6s 
            /call cast "${SpellSlow}" gem${SpellSlowGem} 6s 
   	    /varset tookAction 1
            /tell ${ChatSender} %T is SLOWED 
         } 
      /return 
      } 

      /if (${ChatText.Equal[sow]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) {
		/varset DoSow 1 
		/varset OutDoors 1
		/notify BuffWindow Buff${Math.Calc[${Me.Buff["Spirit of Bih`Li"].ID}-1].Int} leftmouseup
	 }
      /return 
      } 
       
       
      /if (${ChatText.Equal["follow me"]}) { 

	 /if (!${AllowAutoFollow}) /return

         /target pc ${ChatSender} 
	
         /delay 1s ${Target.CleanName.Equal[${ChatSender}]}

         /echo Following ${Target.CleanName}

         /call FollowFunction "${Target.CleanName}"

         /varset following ${ChatSender}

         /return 
      } 
       
      /if (${ChatText.Equal["wait here"]}) { 
         /varset FollowFlag 0
         /varset following FALSE
	 /keypress FORWARD

         /echo No longer following. Resuming program.
         /return 
      }

      /if (${ChatText.Equal[mana]}) { 

       		/gsay ${Me.PctMana}% Mana 
       		/varset CallManaTmr 300 

      /return
      }

/return 


| CheckIsLookingAt 
| Used for checking if an NPC is attacking.someone.  Default PC is master 
|Usage /call CheckIsLookingAt "id of mob to check" "id of PC to check" 
Sub CheckIsLookingAt(int MobID,int PCID) 
   /declare MobHeading int local 0 
   /declare HeadingToPC int local 
   /declare DeltaX local float 
   /declare DeltaY local float 
   /declare HeadingDelta local float 
   /if (!${Defined[PCID]} || !${PCID}) /return 0 
   /if (${Spawn[id ${MobID}].ID}) { 
      /varcalc DeltaX ${Spawn[id ${PCID}].X}-${Spawn[id ${MobID}].X} 
      /varcalc DeltaY ${Spawn[id ${PCID}].Y}-${Spawn[id ${MobID}].Y} 
      /varcalc MobHeading ${Spawn[id ${MobID}].Heading.Degrees} 
      /if (${DeltaX}>0) { 
         /varcalc HeadingToPC ${Math.Atan[${DeltaY}/${DeltaX}]}+270 
      } else /if (${DeltaX}<0) { 
         /varcalc HeadingToPC ${Math.Atan[${DeltaY}/${DeltaX}]}+90 
      } else { 
         /if (${DeltaY}>0) { 
            /varcalc HeadingToPC 90 
         } else { 
            /varcalc HeadingToPC 270 
         } 
      } 
      /varcalc HeadingDelta ${Math.Abs[${HeadingToPC}-${MobHeading}]} 
      |/echo DeltaY ${DeltaY} DeltaX ${DeltaX}  Atan ${Math.Atan[${DeltaY}/${DeltaX}]} 
      |/echo Mob ${Spawn[id ${MobID}].Name} MobHeading ${MobHeading} HeadingToPC ${HeadingToPC} 
      /if (${HeadingDelta}<4 || ${HeadingDelta}>356) { 
         /return 1 
      } 
   } 
/return 0


Sub CheckIsLookingAtGroup(int mob) 


	/call CheckIsLookingAt ${mob} ${Group[0].ID} 
	/if (${Macro.Return}) /return 1

	/call CheckIsLookingAt ${mob} ${Group[1].ID} 
	/if (${Macro.Return}) /return 1

	/call CheckIsLookingAt ${mob} ${Group[2].ID} 
	/if (${Macro.Return}) /return 1

	/call CheckIsLookingAt ${mob} ${Group[3].ID} 
	/if (${Macro.Return}) /return 1

	/call CheckIsLookingAt ${mob} ${Group[4].ID} 
	/if (${Macro.Return}) /return 1

	/call CheckIsLookingAt ${mob} ${Group[5].ID} 
	/if (${Macro.Return}) /return 1


/return 0



| #### Checks the animation value of a mob to see if it's attacking.
| # Returns 0 if not attacking, 1 if definitely attacking, and 2 if possibly attacking.


Sub CheckAttacking(int mob)

	/declare animation int local

	/varset animation ${Spawn[${mob}].Animation}


   	/if (${mob}==${TargetArray[4]}) {
		/if (${animation} == 5 ) /return 1
		/if (${animation} == 7 ) /return 1
		/if (${animation} == 8 ) /return 1
		/if (${animation} == 12 ) /return 1
		/if (${animation} == 13 ) /return 1
		/if (${animation} == 17 ) /return 1
		/if (${animation} == 18 ) /return 1
		/if (${animation} == 32 ) /return 1

		/if (${animation} == 44 ) /return 1
		|/echo Animation #${animation} detected while in combat mode.
	}

	/if (${animation} == 5 ) /return 1

	/if (${animation} == 7 ) /return 1

	/if (${animation} == 8 ) /return 1

	/if (${animation} == 12 ) /return 1

	/if (${animation} == 13 ) /return 1

	/if (${animation} == 16 ) /return 0

	|## 17: Walking
	/if (${animation} == 17 ) /return 0

	|## 18: Running
	/if (${animation} == 18 ) /return 0

	/if (${animation} == 26 ) /return 0

	/if (${animation} == 32 ) /return 0

	/if (${animation} == 33 ) /return 0

	/if (${animation} == 34 ) /return 0

	/if (${animation} == 37 ) /return 0

	/if (${animation} == 38 ) /return 0

	/if (${animation} == 44 ) /return 0

	/if (${animation} == 71 ) /return 0

	/if (${animation} == 72 ) /return 0

	/if (${animation} == 73 ) /return 0

	|/echo Unknown Animation #${animation}, by mob ID: ${mob} (${Spawn[${mob}].Name}).
/return 0




Sub AddSafeLoc

	/declare i int local 0	

	/declare tmp[2] float local

	/varset tmp[1] ${Me.X}
	/varset tmp[2] ${Me.Y}

	/for i 1 to ${SafeLocs.Size[1]}

		/if (${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp[1]},${tmp[2]}]} <= 25) /return

	/next i

	/varset LastSLAdded ${Math.Calc[${LastSLAdded}+1]}
	/if (${LastSLAdded}>${SafeLocs.Size[1]}) /varset LastSLAdded 1

	/varset SafeLocs[${LastSLAdded},1] ${tmp[1]}
	/varset SafeLocs[${LastSLAdded},2] ${tmp[2]}

	/echo Added SafeLoc: ${tmp[1]},${tmp[2]}

/return


Sub AttemptAvoid(int pcID)

	/declare i int local 1
	/declare j int local 1

	/declare final[4] float local
	/declare tmp[2] float local
	/declare tmp2[3] float local
	/declare tmp3[3] float local

	/if (!${AutoMove}) /return

	/varset tmp[1] ${Spawn[pc ${M_Assist}].X}
	/varset tmp[2] ${Spawn[pc ${M_Assist}].Y}

	/if (${Defined[pcID]} && ${pcID}) {

		/varset tmp[1] ${Spawn[${pcID}].X}
		/varset tmp[2] ${Spawn[${pcID}].Y}

	}

	/squelch /varset tmp2[1] ${Spawn[${underAttackBy}].X}
	/squelch /varset tmp2[2] ${Spawn[${underAttackBy}].Y}
	/squelch /varset tmp2[3] ${Spawn[${underAttackBy}].MaxRange}

	/varset final[3] 9999



	/for i 1 to ${SafeLocs.Size[1]}

		/if (${SafeLocs[${i},1]}!=0 && ${SafeLocs[${i},2]}!=0) {

			/varset final[4] ${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp[1]},${tmp[2]}]}


			/if (${final[4]} < ${final[3]}) {

				/if (${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp2[1]},${tmp2[2]}]} > ${tmp2[3]}) {
	
					/for j 1 to ${DebuffTimers.Size}
						/if (${DebuffTimers[${j}]}) {
						
							/squelch /varset tmp3[1] ${Spawn[${DebuffTimers[${j}]}].X}
							/squelch /varset tmp3[2] ${Spawn[${DebuffTimers[${j}]}].Y}
							/squelch /varset tmp3[3] ${Spawn[${DebuffTimers[${j}]}].MaxRange}


							/if (${Math.Distance[${SafeLocs[${i},1]},${SafeLocs[${i},2]}:${tmp3[1]},${tmp3[2]}]} <= ${tmp3[3]}) /next i
	
						}
					/next j

					/varset final[1] ${SafeLocs[${i},1]}
					/varset final[2] ${SafeLocs[${i},2]}
					/varset final[3] ${final[4]}
				}
			}
		}

	/next i

	/if (!(${Defined[DebuffTimer${underAttackBy}]} && ${DebuffTimer${underAttackBy}}>0)) {
		/call SetDebuffTimer ${underAttackBy} 50
	}

	/varset underAttackBy 0
   	/varset underAttack 50

	/if (${final[1]}!=0 && ${final[2]}!=0) {


		/varset PauseFlag 0
		/varset PathingFlag 0
		/varset FollowFlag 0
		/varset RecordPathFlag 0

		|/call GotoFunction ${final[2]} ${final[1]}
		/call MoveToLoc ${final[2]} ${final[1]}


		/return
	}

	/echo WARNING: No safe locs found to move to!

/return


Sub Event_UnderAttack(string Line) 

	/declare i int local

	/if (!${underAttack}) {
		/echo Under Attack! Not sitting for 5 seconds.

		/for i 1 to 10
			/varset underAttackBy ${Me.NearestSpawn[npc].ID}

			/if (${Line.Find[${Spawn[${underAttackBy}].CleanName}]}) {
				|/call cast "${SpellRoot}" gem${SpellRootGem}

				|/if (${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} || ${Macro.Return.Equal[CAST_IMMUNE]}) {
				|	/echo Rooted ${Target.CleanName}
				|	/call AttemptAvoid
				|}

				/call CheckIsLookingAt ${underAttackBy} ${Me.ID}
				/if (!${Macro.Return}) {
					/varset underAttackBy 0
					/next i
				}
				/varset underAttack 50
				/stand
				/return
			}

			/varset underAttackBy 0
		
		/next i


	}
	/varset underAttack 50

/return
[url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=methejuggler@hotmail.com&item_name=guest_01&no_shipping=2&no_note=1&tax=0&currency_code=USD&lc=DK&bn=PP%2dDonationsBF&charset=UTF%2d8][img]http://www.paypal.com/en_US/i/btn/x-click-but21.gif[/img][/url]
If you like any of the plugins or macros I make, and would like to help with future development, please consider donating.
I don't play on live, so if you want updates for live, I'll need an account. Donations go towards paying for a live account. Any extra beyond that helps with motivation ;)

Hubba
orc pawn
orc pawn
Posts: 22
Joined: Wed Jul 14, 2004 5:00 am

Post by Hubba » Mon Feb 14, 2005 1:12 pm

Hi guys!

I see you still fiddle with my crappy script.

Everquest 2 got booring for me and I stopped play that game. I hated how the zone was build, strange...

Well, Im all into Anarchy Online (it's totaly free, and way harder to play then EQ, all these skills, implants etc etc) and Desert Combat for a uppcomming Lan game.

PS. If you know a marcro thingy for AO, PM me pls. I need to autobot my Engi.

Take care for now...

mmatt_y2k
decaying skeleton
decaying skeleton
Posts: 9
Joined: Fri Dec 31, 2004 10:44 am

Post by mmatt_y2k » Sat Mar 12, 2005 2:50 pm

guest_01,

I attempted to use your updated version of the macro but when I start it only advpath is initialized then the macro ends. Any ideas? I am a 67 Shaman only things I edited were the spells. Thanks!

firehawk
orc pawn
orc pawn
Posts: 17
Joined: Wed Nov 10, 2004 12:17 am

Post by firehawk » Sat May 07, 2005 12:30 pm

so has abyone gotten this to work since patch,i have made the group changes, i get name spam, it stars up fine then just crashes, no spam no warning just crashes here is the code i use

Code: Select all

|__________________ Shaman Do Stuff Script _____________________| 
| 
| Version: v0.7.2 
| Release Date: 2004-11-09 
|___________________________________________________Hubba_______| 
| 
| Usage: 
| 1. Target player you like to assist (main tank is good) 
| 2. Start the script with: /mac <scriptname> 
| 
| Use "help" for more help ( ! help is incomplete ! ) 
|_______________________________________________________________| 

| -!- This Script Uses spell_routines.inc by Rusty 
| -!- Exptrack snippet from exptracker.mac by Raebis, with tweaks from Phoenix 
| -!- Wait4Rez snippet from wait4rez.mac by fantum409 

#chat group 
#chat tell 

#Event   ToggleVariable   "[MQ2] Toggle #1#" 
#Event   ToggleVariable   "[MQ2] Toggle #1# #2#" 
#Event   OutDoor         "#*#outdoors#*#" 
#Event   NoMount         "You can not summon a mount here." 
#Event   ImDead         "You have been slain by#*#" 
#Event   Invited         "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#" 

#include Spell_Routines.inc 
#include BuffBeg.inc
Sub Main 

| The spell will be memmed in the listed order. 
| Gem1 = Canni 
| Gem2 = Slow 
| Gem3 = Malo 
| Gem4 = Avatar 
| Gem5 = Pet and buffs , root 
| Gem6 = Heal 
| Gem7 = HoT 
| Gem8 = DoT, Nuke 

| ########### Make changes in spells as you need. 
| ########### Obs! This is mainly for a 65+ shaman with Cannibalization ability 
| ########### Set Cannibalization to False if you don't have the ability 

   | The % of your spell duration bonus. I have 30% from AAs and 15% from item. 
   /declare SpellDurationBonus   outer 45 
    
   |- If you have no focus item, leave it blank. Ring of Firewarding is a 15% spell duration up to 65spells. 
   /declare BuffFocusItem       outer "Ring of Firewarding" 

   /declare SpellSlow          outer "Turgur's Insects" 
   /declare SpellDoT         outer "Blood of Saryrn" 
   /declare SpellPet           outer "True Spirit" 
   /declare SpellDeBuff        outer "Malos" 
   /declare SpellCanni         outer "Cannibalize IV" 
   /declare SpellHoT           outer "Quiescence" 
   /declare SpellHeal          outer "Yoppa's Mending" 
   /declare SpellRoot          outer "Petrifying Earth" 
   /declare SpellNuke         outer "Velium Strike" 
   /declare SpellATK          outer "Ferine Avatar" 
   /declare Mount             outer "Small White Drum" 
   /declare SpellHp		outer "Wunshi's Focusing"
   /call BuffBegDeclares
   /declare BuffGuy   string   outer
   /declare TargetReturn  string outer

   /declare SpellPetBuff[3] string outer 
   /varset SpellPetBuff[1] "Celerity" 
   /varset SpellPetBuff[2] "Strength of the Diaku" 
   /varset SpellPetBuff[3] "Ferine Avatar" 

| ############ The Magic of single spell buffs... 
| ############ 
| ############ /declare SpellBuff[2,2] string outer 
| ############  Do only change the 1st number in [#,#] 
| ############  If you have three single spells to cast change the 1st number to 3. 
| ############ /declare SpellBuff[3,2] string outer 
| ############ 
| ############ /varset SpellBuff[1,1] "Talismen of Sense" 
| ############  This is the 1st line that is needed, Here you write your spell name 
| ############ /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter," 
| ############  The 2nd line is for the classes who gets the buff. 
| ############ NOTE: Only classes in group will get buffed 
| ############ NOTE: End the class line with a , If not you can BLOW up your computer. ;P 

   | Turn on or off Single buffs here. 
   /declare DoSingleBuffs      outer TRUE 

   /declare SpellBuff[2,2] string outer 
    
   /varset SpellBuff[1,1] "Talismen of Sense" 
   /varset SpellBuff[1,2] "Warrior,Monk,Cleric,Shaman,Enchanter," 

   /varset SpellBuff[2,1] "Levitation" 
   /varset SpellBuff[2,2] "Monk," 

| ############ Group buffs... 

   /declare SpellGrpBuff[4] string outer 
   /varset SpellGrpBuff[1] "Blessing of Replenishment" 
   /varset SpellGrpBuff[2] "Focus of the Seventh" 
   /varset SpellGrpBuff[3] "Talisman of the Wrulan" 
   /varset SpellGrpBuff[4] "Talisman of the Boar" 
    
   /declare AssistAt      int   outer 100 
   /declare CombatAt      int   outer 99 
   /declare CastDoTat      int   outer 99 
   /declare Rootat         int   outer 30 
   /declare NukeAt         int   outer 90 
   /declare CasterHeals   int   outer 90 
   /declare MeleeHeals      int   outer 75 
   /declare TankHeal      int outer 45 

   /declare DoMalo             outer TRUE    
   /declare DoSlow             outer TRUE 
   /declare FastSlow         outer FALSE 
   /declare DoRoot             outer FALSE 
   /declare SummonPet          outer FALSE 
   /declare BuffPet         outer FALSE 
   /declare DoDoT             outer TRUE 
   /declare DoBuffs          outer TRUE 
   /declare DoSow             outer TRUE 
   /declare DoNuke            outer FALSE 
   /declare DoHeal            outer TRUE 
   /declare Cannibalization   outer TRUE 
   /declare Verbose         outer FALSE 

   | This is a delay for how long Avatar will hold. (8min) 
   /declare AvatarDelay       outer 5350 

| ########### ! No Changes From Here Is Needed ! 

   /squelch /alias malo /echo toggle malo 
   /squelch /alias slow /echo toggle slow 
   /squelch /alias fastslow /echo toggle fastslow 
   /squelch /alias root /echo toggle root 
   /squelch /alias pet /echo toggle pet 
   /squelch /alias dot /echo toggle dot 
   /squelch /alias nuke /echo toggle nuke 
   /squelch /alias nukeat /echo toggle nukeat    
   /squelch /alias buffs /echo toggle buffs 
   /squelch /alias sow /echo toggle sow 
   /squelch /alias assistat /echo toggle assistat 
   /squelch /alias dotat /echo toggle dotat 
   /squelch /alias rootat /echo toggle rootat 
   /squelch /alias combatat /echo toggle combatat 
   /squelch /alias healmeleeat /echo toggle healmeleeat 
   /squelch /alias healcastersat /echo toggle healcastersat 
   /squelch /alias healtankat /echo toggle healtankat 
   /squelch /alias assist /echo toggle assist 
   /squelch /alias healat /echo toggle healat 
   /squelch /alias status /echo toggle show 
   /squelch /alias show /echo toggle show    
   /squelch /alias help /echo toggle help 
   /squelch /alias verbose /echo toggle verbose    
    
   /declare M_Assist   string   outer 
   /declare OutDoors         outer TRUE 
   /declare NoMount         outer FALSE 
   
    
   /declare SpDuration         outer 
   /declare SpCastTime         outer 
   /declare SpDurBonus         outer 
    
   /declare MainItem         outer 
    
   /declare MeLoM            outer FALSE 
    
   /declare TargetArray[4] string outer 
   /declare MobMaloed         outer FALSE 
   /declare MobSlowed         outer FALSE 
   /declare PetOn            outer FALSE 
   /declare MobRooted         outer FALSE 
   /declare MobDoTed         outer FALSE 
   /declare CombatOn         outer FALSE 

   /declare i int local 
   /for i 1 to ${SpellBuff.Size[1]} 
      /declare SpellBufftmr${i}0   timer   outer 0 
      /declare SpellBufftmr${i}1   timer   outer 0 
      /declare SpellBufftmr${i}2   timer   outer 0 
      /declare SpellBufftmr${i}3   timer   outer 0 
      /declare SpellBufftmr${i}4   timer   outer 0 
      /declare SpellBufftmr${i}5   timer   outer 0 
   /next i 
    
   /declare Exper float outer 
   /declare AAExp float outer 
       
   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 

   /declare ATKBuffed0 timer outer 0 
   /declare ATKBuffed1 timer outer 0 
   /declare ATKBuffed2 timer outer 0 
   /declare ATKBuffed3 timer outer 0 
   /declare ATKBuffed4 timer outer 0 
   /declare ATKBuffed5 timer outer 0 
    
   /declare CallManaTmr timer outer 0 
    
   /call MemSpells 
    
| ############### Target a player as Main Assist 
    
    /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
      /echo Your target is NOT a player, make sure its a player character! 
        /endmacro 
    } else { 
      /varset M_Assist ${Target.CleanName} 
      /echo Assist set to ${M_Assist} 
      /assist off 
    } 

:Main_Loop 

   |- Summon drogmore 
   /if (!${Me.Mount.ID} && ${OutDoors} && !${NoMount}) /call cast ${Mount} item 4s 
   /call BuffBeg 
   |- Check for new events in chat etc etc... 
   /doevents 
    
   |- Do we move? 
:Hold_Main 
   /if (${Me.Moving}) /goto :Hold_Main 
    
   |- Pet 
   /if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana} <= ${Me.CurrentMana}) /call cast ${SpellPet} gem5 25s 
   /if (${Me.Pet.ID} && ${BuffPet}) /call BuffPet 
    
   |- Sow Buff 
   /if (!${Me.Buff[Spirit of Eagle].ID} && !${Me.Buff[Flight of Eagles].ID}) /if (!${Me.Buff[Spirit of Bih`Li].ID} && ${DoSow} && ${OutDoors}) { 
      /call EquipItem ${BuffFocusItem} 
      /varset MainItem ${Macro.Return} 
      /target pc ${M_Assist} 
      /call cast "Spirit of Bih`Li" gem5 17s 
      /call EquipItem ${MainItem} 
   } 
    
   |- Canni 
   /if (${Me.CurrentHPs} < ${Math.Calc[${Me.MaxHPs}/2]}) /call CheckMyHPs 
   /if (${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-5]} && ${Me.SpellReady[${SpellCanni}]}) /call cast ${SpellCanni} gem1 6s 
   /if (${Cannibalization} && ${Me.AltAbilityReady[47]} && ${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-1200]} && ${Me.MaxHPs} > 3200) /call Cannibalization 
  
    |- Let the group know Im LOM 
    /if (${Me.PctMana} < 20 && !${CallManaTmr}) { 
       /gsay ${Me.PctMana}% Mana 
       /varset CallManaTmr 300 
    } 
  
    |- Single Buff ! 
    /if (${DoSingleBuffs}) /call SingleBuffs 
     
    |- Am I LoM? 
    /if (${Me.PctMana} < 25) /varset MeLoM TRUE 
    /if (${MeLoM}) /if (${Me.PctMana} > 35) /varset MeLoM FALSE 

   |- Group Buffs 
   /if (${DoBuffs}) /call GrpBuffs 
   /if (${Me.SpellReady[${SpellATK}]}) /call Cast_Avatar 
    
   |- Group Heals 
   /call Check_grpHPs 

   |- Check for mobs and do combat stuff 
   /call GetTarget 
   /if (${CombatOn}) /call Combat    

   /if (${Me.State.Equal[Stand]}) /sit 

   /goto :Main_Loop 
/return 

Sub MemSpells 

   /echo Memming spells. Hang on. 
   /if ( !${Me.Gem[${SpellCanni}]} ) { 
      /memspell 1 ${SpellCanni} 
      /delay 25 
   } 
   /if ( !${Me.Gem[${SpellSlow}]} ) { 
      /memspell 2 ${SpellSlow} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellDeBuff}]} ) { 
      /memspell 3 ${SpellDeBuff} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellATK}]} ) { 
      /memspell 4 ${SpellATK} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellPet}]} ) { 
      /memspell 5 ${SpellPet} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellHeal}]} ) { 
      /memspell 6 ${SpellHeal} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellHoT}]} ) { 
      /memspell 7 ${SpellHoT} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellDoT}]} ) { 
      /memspell 8 ${SpellDoT} 
      /delay 30 
   } 
   |/if ( ${Window[SpellBookWnd].Open} ) /windowstate SpellBookWnd close 
   /echo Spells are memmed. 

/return 

| ################# This will check what Main Assist has in target. 

Sub GetTarget 
   /assist ${M_Assist} 
   /delay 3 
   /if (${Target.Type.Equal[NPC]}) /if (${Target.Distance}<=${AssistAt} && ${Target.ID}!=${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) { 
      /varset TargetArray[1] ${Target.CleanName} 
      /varset TargetArray[2] ${Target.Level} 
      /varset TargetArray[3] ${Target.Name} 
      /varset TargetArray[4] ${Target.ID} 
      /varset CombatOn TRUE 
       
   /varset MobRooted FALSE 
   /varset MobMaloed FALSE 
   /varset MobSlowed FALSE 
   /varset PetOn FALSE 
   /varset MobDoTed FALSE 
   } 
/return 

| ################### Check target and do stuff like slow, dot, pet attack etc. 

Sub Combat 

   /if (${CombatOn} && !${MobMaloed} && ${DoMalo} && ${Target.ID}==${TargetArray[4]}) /call DeBuff 
   /if (${CombatOn} && !${MobSlowed} && ${DoSlow} && ${Target.ID}==${TargetArray[4]}) /call Slow 

   /if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]}) { 
      /pet attack 
      /varset PetOn TRUE 
   } 

   /if (!${MeLoM} && ${CombatOn} && ${DoDoT} && !${MobDoTed} && ${Target.PctHPs}<=${CastDoTat}) { 
      /call cast ${SpellDoT} gem8 
      /varset MobDoTed TRUE 
   } 
    
   /if (${CombatOn} && ${DoNuke} && ${Target.PctHPs}<=${NukeAt}) { 
      /call cast ${SpellNuke} gem8 
   } 
    
   /if (!${ModRooted} && ${CombatOn} && ${DoRoot} && ${Target.PctHPs}<=${RootAt}) { 
      /call cast ${SpellRoot} gem5 
      /varset MobRooted TRUE 
   } 

|- EndCombat 

   /target ${TargetArray[3]} 
    
   /if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) { 
      /echo ${TargetArray[1]} is dead 
      /varset MobRooted FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
      /varset CombatOn FALSE 
    
      /varset TargetArray[1] NULL 
      /varset TargetArray[2] NULL 
      /varset TargetArray[3] NULL 
      /varset TargetArray[4] NULL 

   /varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]} 
   /varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]} 

   /echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
   /popup EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.PctAAExp}% - ${Math.Calc[${Macro.RunTime}/60]} minutes 
   /varset Exper ${Me.PctExp} 
   /varset AAExp ${Me.PctAAExp} 
    
   } 

/return 

Sub DeBuff 
:DeBuff_Loop 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) { 
         /echo *** Shid ! I don't have mana to Malo %T 
      } else { 
         /call cast ${SpellDeBuff} gem3 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :DeBuff_Loop 
         /varset MobMaloed TRUE 
      } 
   } 
/return 

Sub Slow 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) { 
         /echo Shid ! I don't have mana to Malo %T 
      } else { 
:Slow_Loop 
         /call cast ${SpellSlow} gem2 6s 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Slow_Loop 
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /gsay *** %T is IMMUNE to my slow ! 
          
            /varset MobSlowed TRUE 
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
               /if (${Verbose}) /gsay *** %T RESISTED slow ! Trying again asap 
                /goto :Slow_Loop 
             } 
            /varset MobSlowed TRUE 
          } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /gsay *** %T is SLOWED 
            /varset MobSlowed TRUE 
          } 

      } 
   } 
/return 


| ################### Buff the group with buffs from the SpellGrpBuff array 
| ################### It will NOT cast any singel target spells 

Sub GrpBuffs 
   /declare i int local 1 
   /for i 1 to ${SpellGrpBuff.Size} 
      /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) /return 
      /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 
         /target pc ${M_Assist} 
         /delay 1s ${Target.ID} 
         /echo *** Hang on ! Rebuffing ${SpellGrpBuff[${i}]} 
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
         /call cast ${SpellGrpBuff[${i}]} gem5 5s 
         /call EquipItem ${MainItem} 
      } 
   /next i 
/return 

|################### Check if any group member needs heal 

Sub Check_grpHPs 
   /declare i int local 1 
    
   /for i 1 to ${Group.Members} 

   /if (${Group.Member[${i}].Class.Name.Equal[Cleric]} || ${Group.Member[${i}].Class.Name.Equal[Druid]} || ${Group.Member[${i}].Class.Name.Equal[Wizard]} || ${Group.Member[${i}].Class.Name.Equal[Magician]} || ${Group.Member[${i}].Class.Name.Equal[Necromancer]} || ${Group.Member[${i}].Class.Name.Equal[Enchanter]}) /if (${Group.Member[${i}].PctHPs}<=${CasterHeals}) { 
      /target pc ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /gsay *** ${SpellHeal} on %T 
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 
    
   /if (${Group.Member[${i}].Class.Name.Equal[Warrior]} || ${Group.Member[${i}].Class.Name.Equal[Monk]} || ${Group.Member[${i}].Class.Name.Equal[Rouge]} || ${Group.Member[${i}].Class.Name.Equal[Ranger]} || ${Group.Member[${i}].Class.Name.Equal[Beast]} || ${Group.Member[${i}].Class.Name.Equal[Shadow Knight]} || ${Group.Member[${i}].Class.Name.Equal[Paladin]}) /if (${Group.Member[${i}].PctHPs}<=${MeleeHeals} && ${Group.Member[${i}].Name.NotEqual[${M_Assist}]}) { 
      /target pc ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /gsay *** ${SpellHeal} on %T 
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 

   /if (${Group.Member[${i}].Name.Equal[${M_Assist}]}) /if (${Group.Member[${i}].PctHPs}<=${TankHeal}) { 
      /target pc ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /gsay *** ${SpellHeal} on %T 
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 

   /next i 
/return 

| ################## Canni 5 

Sub Cannibalization 

   /call CheckMyHPs 
   /if (${Me.Buff[${SpellHoT}].ID} && ${Me.CurrentHPs} > 3200) { 
      /if (${Verbose}) /gsay *** Doing Cannibalization ! 
      /aa act Cannibalization 
      /delay 3s 
   } 

/return 

| ################## This will NOT check self HPs, Only check HoT or recast HoT 

Sub CheckMyHPs 

   /if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
      /echo *** Shit, I don't have mana to cast ${SpellHoT} 
   } else { 
      /target myself 
      /delay 1s ${Me.ID}==${Target.ID} 
      /if (!${Me.Buff[${SpellHoT}].ID} && ${Target.ID}==${Me.ID}) /call cast ${SpellHoT} gem7 3s 
   } 

/return 

| ################## Buff pet with spells from SpellPetBuff array 

Sub BuffPet 

   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
      /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana} <= ${Me.CurrentMana}) { 
         /pet target 
         /delay 1s ${Me.Pet.ID}==${Target.ID} 
         /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
         /call cast ${SpellPetBuff[${i}]} gem5 9s 
         /call EquipItem ${MainItem} 
      } 
   /next i 
/return 

|################### Casting Avatar on all melee classes in group 

Sub Cast_Avatar 

   /declare i int local 0 
   /for i 0 to ${Group.Members} 
   /if (${Group.Member[${i}].ID}) { 
      /if (${ATKBuffed${i}}==0) /if (${Group.Member[${i}].Class.Name.Equal[Beastlord]} || ${Group.Member[${i}].Class.Name.Equal[Shadow Knight]} || ${Group.Member[${i}].Class.Name.Equal[Bard]} || ${Group.Member[${i}].Class.Name.Equal[Ranger]} || ${Group.Member[${i}].Class.Name.Equal[Rogue]} || ${Group.Member[${i}].Class.Name.Equal[Paladin]} || ${Group.Member[${i}].Class.Name.Equal[Monk]} || ${Group.Member[${i}].Class.Name.Equal[Warrior]}) { 
         /target pc ${Group.Member[${i}]} 
         /delay 1s ${Group.Member[${i}].ID}==${Target.ID} 
         /if (${Me.CurrentMana}>${Spell[${SpellATK}].Mana}) { 
            /call EquipItem ${BuffFocusItem} 
         /varset MainItem ${Macro.Return} 
            /call cast ${SpellATK} gem4 4s 
            /if (${Macro.Return.Equal["CAST_OUTOFRANGE"]}) /varset ATKBuffed${i} 200 
            /if (${Macro.Return.Equal["CAST_SUCCESS"]}) /varset ATKBuffed${i} ${AvatarDelay}´ 
            /call EquipItem ${MainItem} 
            /return 
         } 
      } 
   } 
   /next i 
/return 

| #################### The Single boofs stuff routine kinda 
| Im sure there is a better way to do this. 
| But this is what I could crackup at work. 

Sub SingleBuffs 

   /declare i int local 1 
   /declare g int local 0 
   /declare h int local 1 
   /declare Classes int local 0 
   /for i 1 to ${SpellBuff.Size[1]} 
      /if (${Spell[${SpellBuff[${i}]},1].Mana} > ${Me.CurrentMana}) /return 
      /varset Classes ${String[${SpellBuff[${i},2]}].Count[,]} 
      /for g 0 to ${Group} 
         /if (${SpellBufftmr${i}${g}}) /next g 
         /for h 1 to ${Classes} 
            /if (${Group.Member[${g}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) { 
               /target pc ${Group.Member[${g}]} 
               /delay 1s ${Target.ID}==${Group.Member[${g}].ID} 
               /call SpellInformation ${SpellBuff[${i},1]} 
                  /call EquipItem ${BuffFocusItem} 
                  /varset MainItem ${Macro.Return} 
               /call cast ${SpellBuff[${i},1]} gem5 ${SpCastTime} 
               /varset SpellBufftmr${i}${g} ${SpDuration} 
                  /call EquipItem ${MainItem} 
               /return 
            } 
         /next h 
      /next g 
   /next i 
/return 

| ################### Get some information of the spell to be used. 

Sub SpellInformation(string SpellName) 

   /varset SpDurBonus ${Math.Calc[${SpellDurationBonus}/100+1]} 

   /varset SpDuration ${Math.Calc[${Spell[${SpellName}].Duration}/10*60*${SpDurBonus}]} 
   /varset SpCastTime ${Math.Calc[${Spell[${SpellName}].CastTime}*10].Int} 

/return 

| ################### This will check whenever the player is changing any variable via /echo 

Sub Event_ToggleVariable(string Line, string Command, string Command2) 

   /if (${Command.Equal[malo]} && ${DoMalo}==0) { 
      /varset DoMalo TRUE 
      /echo Do Malo:   ${DoMalo} 
   } else /if (${Command.Equal[malo]}) { 
      /varset DoMalo FALSE 
      /echo Do Malo:   ${DoMalo} 
   } 

   /if (${Command.Equal[slow]} && ${DoSlow}==0) { 
      /varset DoSlow TRUE 
      /echo Do Slow:   ${DoSlow} 
   } else /if (${Command.Equal[slow]}) { 
      /varset DoSlow FALSE 
      /echo Do Slow:   ${DoSlow} 
   } 
    
   /if (${Command.Equal[fastslow]} && ${FastSlow}==0) { 
      /varset FastSlow TRUE 
      /echo Do Fast Slow:   ${FastSlow} 
   } else /if (${Command.Equal[fastslow]}) { 
      /varset FastSlow FALSE 
      /echo Do Fast Slow:   ${FastSlow} 
   } 
    
   /if (${Command.Equal[root]} && ${DoRoot}==0) { 
      /varset DoRoot TRUE 
      /echo Do Root:   ${DoRoot} 
   } else /if (${Command.Equal[root]}) { 
      /varset DoRoot FALSE 
      /echo Do Root:   ${DoRoot} 
   }    
    
   /if (${Command.Equal[pet]} && ${SummonPet}==0) { 
      /varset SummonPet TRUE 
      /echo Summon Pet:   ${SummonPet} 
   } else /if (${Command.Equal[pet]}) { 
      /varset SummonPet FALSE 
      /echo Summon Pet:   ${SummonPet} 
   }    
    
   /if (${Command.Equal[dot]} && ${DoDoT}==0) { 
      /varset DoDoT TRUE 
      /echo Do DoT:   ${DoDoT} 
   } else /if (${Command.Equal[dot]}) { 
      /varset DoDoT FALSE 
      /echo Do DoT:   ${DoDoT} 
   } 
    
   /if (${Command.Equal[buffs]} && ${DoBuffs}==0) { 
      /varset DoBuffs TRUE 
      /echo Do Buffs:   ${DoBuffs} 
   } else /if (${Command.Equal[buffs]}) { 
      /varset DoBuffs FALSE 
      /echo Do Buffs:   ${DoBuffs} 
   } 
    
   /if (${Command.Equal[sow]} && ${DoSow}==0) { 
      /varset DoSow TRUE 
      /echo Do Sow:   ${DoSow} 
   } else /if (${Command.Equal[sow]}) { 
      /varset DoSow FALSE 
      /echo Do Sow:   ${DoSow} 
   } 
    
   /if (${Command.Equal[nuke]} && ${DoNuke}==0) { 
      /varset DoNuke TRUE 
      /echo Do Nuke:   ${DoNuke} 
   } else /if (${Command.Equal[nuke]}) { 
      /varset DoNuke FALSE 
      /echo Do Nuke:   ${DoNuke} 
   } 
    
   /if (${Command.Equal[heal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoNuke} 
   } else /if (${Command.Equal[heal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoNuke} 
   } 

   /if (${Command.Equal[verbose]} && ${Verbose}==0) { 
      /varset Verbose TRUE 
      /echo Verbose:   ${Verbose} 
   } else /if (${Command.Equal[verbose]}) { 
      /varset Verbose FALSE 
      /echo Verbose:   ${Verbose} 
   } 

   /if (${Command.Equal[buffpet]} && ${BuffPet}==0) { 
      /varset BuffPet TRUE 
      /echo Buff Pet:   ${BuffPet} 
   } else /if (${Command.Equal[buffpet]}) { 
      /varset BuffPet FALSE 
      /echo Buff Pet:   ${BuffPet} 
   } 
    
   /if (${Command.Equal[assistat]}) { 
      /varset AssistAt ${Command2} 
      /echo Assisting at range:   ${AssistAt} _ (Longer range then 100 is futile) 
   } 
    
   /if (${Command.Equal[dotat]}) { 
      /varset CastDoTat ${Command2} 
      /echo Casting ${SpellDoT} at ${CastDoTat}% 
   } 
    
   /if (${Command.Equal[rootat]}) { 
      /varset Rootat ${Command2} 
      /echo Rooting Mobs at ${Rootat}% 
   } 
    
   /if (${Command.Equal[nukeat]}) { 
      /varset NukeAt ${Command2} 
      /echo Starting to Nuke Mobs at ${NukeAt}% 
   } 
    
   /if (${Command.Equal[combatat]}) { 
      /varset CombatAt ${Command2} 
      /echo Initiate Combat at ${CombatAt}% (Malo / Slow) 
   } 
    
   /if (${Command.Equal[healtankat]}) { 
      /varset TankHeal ${Command2} 
      /echo Healing ${M_Assist} at ${TankHeal}% 
   } 
    
   /if (${Command.Equal[healmeleeat]}) { 
      /varset MeleeHeals ${Command2} 
      /echo Healing all Melee classes at ${MeleeHeals}% 
   } 
    
   /if (${Command.Equal[healcastersat]}) { 
      /varset CasterHeals ${Command2} 
      /echo Healing all Caster classes at ${CasterHeals}% 
   } 
    
   /if (${Command.Equal[assist]}) { 
      /varset M_Assist ${Command2} 

      /sq /target pc ${M_Assist} 
      /if (!${Target.ID}) { 
         /echo ${M_Assist} is not here dude ! 
         /return 
      } 
       
      /echo I will assist:   ${M_Assist} 
   } 
    
   /if (${Command.Equal[healat]}) { 
      /varset HealGRPat ${Command2} 
      /echo Healing any group member below ${HealGRPat}% HPs 
   } 

   /if (${Command.Equal[Show]}) { 
    
      /echo --------------------------- 
      /echo Do Malo:..............${DoMalo} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
      /echo Do Slow:..............${DoSlow} - Casting at: ${CombatAt}% (Initiate Combat*, higher then 99 is no good) 
      /echo Do Fastslow:......${FastSlow} - (Will only try to slow once!) 
      /echo Do Nuke:.............${DoNuke} - Casting at: ${NukeAt}% (Will chain nuke mob to death) 
      /echo Do Dot:................${DoDoT} - Casting at: ${CastDoTat}% 
      /echo Do Pet:................${SummonPet} 
      /echo Do Buffs:.............${DoBuffs} 
      /echo Do Root:..............${DoRoot} - Casting at: ${Rootat}% 
      /echo Do Sow:...............${DoSow} 
      /echo Do Heal:..............${DoHeal} 
      /echo Buff Pet:.............${BuffPet} 
      /echo --------------------------- 
      /echo Assist range: ${AssistAt} 
      /echo Assisting: ${M_Assist} 
      /echo Healing Casters: ${CasterHeals}% Melees: ${MeleeHeals}% 
      /echo ${M_Assist} get heals at ${TankHeal} 
      /echo Initiate Combat: ${CombatAt}% 
      /echo Verbose: ${Verbose} 
      /echo 
      /echo help - Will show help to set variables. 
       
   } 
    
   /if (${Command.Equal[help]}) { 
      /echo ___ Shaman Do Stuff Script ___ 
      /echo 
      /echo Commands that will turn ON or OFF 
      /echo malo, slow, fastslow, root, pet, dot, buffs, sow, nuke, heal, buffpet 
      /echo 
      /echo fastslow will NOT check if the slow is landed or not. Good to have on when you skip maloing. 
      /echo Commands to change values, ie: assistat 50 (Will start the combat routine when mob is in range 50) 
      /echo assisat <range> - Most spells don't go longer then 100 
      /echo combatat <% hps> - Initiate Combat when mob is at % HPs 
      /echo healtankat <% hps> 
      /echo healmeeleat <% hps> 
      /echo healcastersat <% hps> 
      /echo assist <PC Name> 
   } 
    
/return 

| ###################################################################################################### 

Sub Event_OutDoor 
    
   /echo This is an indoor zone. Sorry. 
   /varset OutDoors FALSE 

/return 

| ###################################################################################################### 

Sub Event_NoMount 
    
   /echo No mount in this zone. Sorry. 
   /varset NoMount TRUE 

/return 

| ###################################################################################################### 

Sub Event_Invited 
   /invite 
/return 

| ################## 

Sub Event_ImDead 

   /echo Bummer ! 
:Zone_Loop 
   /if ( ${Me.Bound.ID} != ${Zone.ID} ) /goto :Zone_Loop 
   /delay 5s 
   /consent group 
   /delay 5 
   /gsay Im ready to get rez. 
   /call Wait4Rez 

   /delay 20 

   /call MemSpells 

   /if (${Me.State.Equal[Stand]}) /sit 

| We do some short meditate before we start again. 
:Meditate 
   /delay 1s 
   /if (${Me.CurrentMana} < 300) /goto :Meditate 
    
/return 


| ################## This part is taken from wait4res. 

Sub Wait4Rez 

:waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
      /delay 5s ${Window[ConfirmationDialogBox].Open} 
      /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
:zonein 
   /delay 5 
   /squelch /target mycorpse 
   /delay 5 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /delay 3s 
      /call Loot_Corpse 
   } else /goto :zonein 

/return 

Sub Loot_Corpse 

  /declare LootTotal int local 0 
  /declare LootSlot int local 

  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 1s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 

  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 

  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 

/return 

| ################# Tells n Hells 



Sub Event_Chat(ChatType,Sender,ChatText) 
/varset BuffGuy ${Sender}
/if (${ChatText.Find[cha]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Unfailing Reverence" gem7 10s 
} 
/if (${ChatText.Find[Agility]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Agility of the Wrulan" gem7 10s 
} 
/if (${ChatText.Find[Focus]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Wunshi's Focusing" gem7 10s 
} 
/if (${ChatText.Find[Stam]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Spirit of Fortitude" gem7 10s 
} 
/if (${ChatText.Find[Fort]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Spirit of Fortitude" gem7 10s 
} 
/if (${ChatText.Find[tribunal]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of the Tribunal" gem7 10s 
} 
/if (${ChatText.Find[Haste]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Swift like the Wind" gem7 10s 
} 
/if (${ChatText.Find[Strength]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Strength of the Diaku" gem7 10s 
} 
/if (${ChatText.Find[Diaku]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Strength of the Diaku" gem7 10s 
} 
/if (${ChatText.Find[Shrink]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Tiny Terror" gem7 10s 
} 
/if (${ChatText.Find[Sense]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of Sense" gem7 10s 
} 
/if (${ChatText.Find[Regen]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Blessing of Replenishment" gem7 10s 
} 
/if (${ChatText.Find[Full Buff]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Focus of the Seventh" gem7 10s 
} 
/if (${ChatText.Find[Full Buff]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Blessing of Replenishment" gem7 10s 
} 
/if (${ChatText.Find[Full Buff]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of the Diaku" gem7 10s 
} 
/if (${ChatText.Find[Full Buff]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of the Boar" gem7 10s 
} 
/if (${ChatText.Find[Full Buff]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of the Wrulan" gem7 10s 
} 
/if (${ChatText.Find[Full Buffs]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Talisman of Sense" gem7 10s 
} 
/if (${ChatText.Find[Full Buffs]}) { 
  /call TargetGuy 
  /if (${TargetReturn.Equal[TARGET_SUCCESS]} && ${Target.Distance}<100) /call Cast "Spirit of Bih'Li" gem7 10s 
} 
}
/return




Sub TargetGuy 
/squelch /target clear 
/target pc ${BuffGuy} 
/if (!${Target.ID}) { 
  /varset TargetReturn TARGET_FAILED 
  /return 
} 
/varset TargetReturn TARGET_SUCCESS 
/return 
I just added the buffbeg from Adruid_oo and a buff routine that i was more familiar with, al worked until the change, i made the changes, i can't seem to find the problem, it just locks up on me :(

firehawk
orc pawn
orc pawn
Posts: 17
Joined: Wed Nov 10, 2004 12:17 am

Post by firehawk » Sat May 07, 2005 6:48 pm

code works now had to recompile with new zip :lol:

aristocle
orc pawn
orc pawn
Posts: 27
Joined: Mon Dec 13, 2004 3:54 pm

Post by aristocle » Sat May 07, 2005 11:16 pm

well i have a small edited version i use thought i would share it cause people been asking me for it few things to note i only 2Box with this script have no idea how or even IF it will perform in groups but it makes 2Boxing pretty easy

THIS REQUIRES MQ2Fakelink PLUGIN
if u dont have it or cant find it after you copy code just search for /fake and remove all instances of it i run this script 8 to 10 hours a day 2boxed with my warrior and it runs perfect

Code: Select all

#chat group 
#chat tell 

#Event   ToggleVariable   "[MQ2] Toggle #1#" 
#Event   ToggleVariable   "[MQ2] Toggle #1# #2#" 
#Event   OutDoor          "#*#outdoors#*#" 
#Event   Zoning           "You have entered#*#" 
#Event   Hungry           "#*#out of food#*#" 
#Event   Thirsty          "#*#out of drink#*#" 
#Event   ImDead           "You have been slain by#*#" 
#Event   nopet            "#*#dont have a pet#*#" 

cancel#*#" 

#include Spell_Routines.inc 

Sub Main 

| ########### Default  Channel, Controller 

   /declare CChannel      outer "" 
   /declare ChatController outer "" 
  
| ########### Your Spell List - update as needed  

   /declare SpellSlow          outer "Turgur's Insects" 
   /declare SpellDoT2          outer "Bane" 
   /declare SpellPet           outer "Farrel's Companion" 
   /declare SpellDeBuff        outer "Malos" 
   /declare SpellCanni         outer "Pained Memory" 
   /declare SpellHoT           outer "Spiritual Serenity" 
   /declare SpellHeal          outer "Yoppa's Mending" 
   /declare SpellDoT           outer "curse of sisslak" 
   /declare SpellATK2          outer "Champion"
   /declare SpellATK           outer "spirit of the leopard" 
   /declare SpellHASTE         outer "Talisman of Alacrity" 
   /declare SpellFOCUS         outer "Wunshi's Focusing" 
   /declare SpellSOW           outer "Spirit of Bih`Li" 
   /declare SpellSHRINK        outer "Tiny Terror" 
   /declare SpellGROW          outer "Grow" 
   /declare SpellGATE          outer "Gate" 
   /declare SpellFOOD          outer "Summon Food" 
   /declare SpellDRINK         outer "Summon Drink" 

| ########### My Pet Buff Spell List 

   /declare SpellPetBuff[5] string outer 
   /varset SpellPetBuff[1] "Swift Like The Wind" 
   /varset SpellPetBuff[2] "Strength of the Diaku" 
   /varset SpellPetBuff[3] "Spirit of might" 
   /varset SpellPetBuff[4] "Wunshi's Focusing" 
   /varset SpellPetBuff[5] "spirit of the leopard"
| ############ Group Buff List. 

   /declare SpellGrpBuff[6] string outer 
   /varset SpellGrpBuff[1] "Talisman of Perseverance" 
   /varset SpellGrpBuff[2] "Talisman of Wunshi" 
   /varset SpellGrpBuff[3] "Talisman of Alacrity"  
   /varset SpellGrpBuff[4] "Talisman of Fortitude" 
   /varset SpellGrpBuff[5] "Champion" 
   /varset SpellGrpBuff[6] "Talisman of Sense" 

| ############ Combat Variables 

   /declare AssistAt      int   outer 100 
   /declare CombatAt      int   outer 99 

   /declare CastDoTat     int   outer 90 
   /declare DotMana       int   outer 40 

   /declare CastDoT2at        int   outer 85 
   /declare DoT2Mana      int   outer 40 

   /declare SitAt         int   outer 80 
   /declare BuffMana      int   outer 30 
   /declare MinMana       int   outer 15 
    
 | ############ Heal Priority. 

   /declare CasterHeals   int   outer 60 
   /declare MeleeHeals    int   outer 40 
   /declare TankHeal      int   outer 45 
   /declare HoTheals      int   outer 75 

| ############ To Do List 

   /declare DoMalo             outer TRUE    
   /declare DoSlow             outer TRUE 
   /declare FastSlow           outer FALSE 
   /declare DoDoT2             outer TRUE 
   /declare SummonPet          outer TRUE 
   /declare BuffPet            outer FALSE 
   /declare DoDoT              outer TRUE 
   /declare DoBuffs            outer TRUE 
   /declare DoSow              outer TRUE 
   /declare DoHeal             outer TRUE 
   /declare Cannibalization    outer TRUE 
   /declare Verbose            outer TRUE 
   /declare CallManaTmr timer  outer 0 
 
| ########### ! No Changes From Here Is Needed ! 

   /squelch /alias malo /echo toggle malo 
   /squelch /alias slow /echo toggle slow 
   /squelch /alias dot2 /echo toggle dot2 
   /squelch /alias pet /echo toggle pet 
   /squelch /alias dot /echo toggle dot  
   /squelch /alias buffs /echo toggle buffs 
   /squelch /alias sow /echo toggle sow 
   /squelch /alias assistat /echo toggle assistat 
   /squelch /alias dotat /echo toggle dotat 
   /squelch /alias dot2at /echo toggle dot2at 
   /squelch /alias combatat /echo toggle combatat 
   /squelch /alias healmeleeat /echo toggle healmeleeat 
   /squelch /alias healcastersat /echo toggle healcastersat 
   /squelch /alias healtankat /echo toggle healtankat 
   /squelch /alias assist /echo toggle assist 
   /squelch /alias healat /echo toggle healat 
  /squelch /alias verbose /echo toggle verbose    
    
   /declare TargetArray[4] string outer 
   /declare MobMaloed      outer FALSE 
   /declare MobSlowed      outer FALSE 
   /declare PetOn          outer FALSE 
   /declare MobDoT2ed      outer FALSE 
   /declare MobDoTed       outer FALSE 
   /declare CombatOn       outer TRUE 
   /declare Engaged        outer FALSE  
   /declare LowMana        outer FALSE  

   /declare M_Assist       string outer 
   /declare OutDoors       outer TRUE    

    
   /call MemSpells 
    
| ############### Target a player as Main Assist 
    
      /if (${Defined[Param0]}) {  
          /varset M_Assist ${Param0} 
          /fake /gsay Assist set to --> [[ ${M_Assist} ]] <--
      } else { 
          /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
              /Gsay Your Do not have a main assist, make sure its a player character! And Targeted When you start this Script 
              /endmacro 
          } 
          /varset M_Assist ${Target.CleanName} 
          /fake /gsay Assist set to --> [[ ${M_Assist} ]] <--
      } 

      /assist off 

      /if (${Defined[Param1]}) /varset CChannel ${Param1} 
      /leaveall 
      /join ${CChannel} 
      /1 I am here! 
      /t ${M_Assist} i have Joined channel ${CChannel} if you wish to control my from there 

      /if (${Defined[Param2]}) /varset ChatController ${Param2} 
      /vtell ${ChatController} 005 
      /tell ${ChatController} I am here! 


| ############### Shrink 

    /target pc ${M_Assist} 
    /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
       /fake /gsay --> [[ ${SpellSHRINK} ]] is incomming to the group now
      /call cast ${SpellSHRINK} gem5 5s 
      /call cast ${SpellSHRINK} gem5 5s 
    }    
          
    
| ###############    
| ############### Main Loop Starts 
| ###############  

:Main_Loop 

   |- Check for Standing if less than sitat then sit 
   /if ( ${Me.State.Equal[Stand]} && ${Me.PctMana}<${SitAt}) /sit 
|- Block this off if you dont want someone to know your botting it will be obvious 
 /if (${Me.PctMana} < 100 && !${CallManaTmr}) { 
       /fake /gsay i have --> [[ ${Me.PctMana}%  Mana ]] <--
       /varset CallManaTmr 300 
    } 
    

   |- Check for low mana state 
   /call Check_Mana 

   |- Check for new events in chat etc etc... 
   /doevents 
    
   |- Do we move? 
   :Hold_Main 
   /if (${Me.Moving}) /goto :Hold_Main 
    
   |- Pet 
   /call PET 
    
   |- Buff Sow 
   /call SOW 
    
   |- Check for mobs and do combat stuff 
   /call GetTarget 
   /if (${CombatOn}) /call Combat        

   |- Group Heals 
   /call Check_grpHPs 

   |- Check for Standing if less than sitat then sit 
   /if ( ${Me.State.Equal[Stand]} && ${Me.PctMana}<${SitAt}) /sit 

   |- Canni 
   /call LOM 

   |- Group Buffs if more than BuffMana mana 
   /if (${Me.PctMana}>=${BuffMana} && ${DoBuffs}) /call GrpBuffs 

   |- Group Heals 
   /call Check_grpHPs 

   /goto :Main_Loop 
/return 

| ###############    
| ############### Main Loop Ends 
| ############### 

  
| ############### Mem Spells in Spell List 

Sub MemSpells 

   /gsay Memming spells. Hang on. 
 /if ( !${Me.Gem[${SpellHeal}]} ) { 
      /memspell 1 ${SpellHeal} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellCanni}]} ) { 
      /memspell 2 ${SpellCanni} 
      /delay 25 
   } 
/if ( !${Me.Gem[${SpellHoT}]} ) { 
      /memspell 3 ${SpellHoT} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellATK2}]} ) { 
      /memspell 4 ${SpellATK2} 
      /delay 20 
   } 
  /if ( !${Me.Gem[${SpellPet}]} ) { 
      /memspell 5 ${SpellPet} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellDoT}]} ) { 
      /memspell 6 ${SpellDoT} 
      /delay 45 
   } 
   /if ( !${Me.Gem[${SpellDot2}]} ) { 
      /memspell 7 ${SpellDot2} 
      /delay 30 
   } 
 /if ( !${Me.Gem[${SpellDeBuff}]} ) { 
      /memspell 8 ${SpellDeBuff} 
      /delay 20 
   } 
   /if ( !${Me.Gem[${SpellSlow}]} ) { 
      /memspell 9 ${SpellSlow} 
      /delay 20 
   } 
   /if ( ${Window[SpellBookWnd].Open} ) /windowstate SpellBookWnd close 
   /gsay Spells are memmed. 

/return 

| -Main combat routine 

Sub Combat 
   /if (${CombatOn} && !${MobMaloed} && ${DoMalo} && ${Target.ID}==${TargetArray[4]}) /call DeBuff 
   /if (${CombatOn} && !${MobSlowed} && ${DoSlow} && ${Target.ID}==${TargetArray[4]}) /call Slow 
   /if (${CombatOn} && !${PetOn} && ${Target.ID}==${TargetArray[4]}) { 
      /pet attack 
      /varset PetOn TRUE 
      /varset Engaged TRUE  
   } 

   |- Check for new events in chat etc etc... 
   /doevents 
   /if (${CombatOn} && ${DoDoT} && !${MobDoTed} && ${Me.PctMana}>=${DoTMana} && ${Target.PctHPs}<=${CastDoTat}) { 
      /call cast ${SpellDoT} gem6    
       /if (${Verbose}) /fake /gsay --> [[ %T ]] <-- Has been filled with --> [[ ${SpellDoT} ]] <--
      /varset MobDoTed TRUE 
   } 
   /if (${CombatOn} && ${DoDoT2} && !${MobDoT2ed} && ${Me.PctMana}>=${DoT2Mana} && ${Target.PctHPs}<=${DoT2At}) { 
      /call cast ${SpellDoT2} gem7 
      /varset MobDoT2ed TRUE 
   } 

   |- Check for new events in chat etc etc... 
   /doevents 

|- EndCombat 

   /target ${TargetArray[3]} 
    
   /if (!${Target.Name.Equal[${TargetArray[3]}]} || !${Target.ID}) { 
      /Gsay ${TargetArray[1]} is dead 
      /pet hold
      /varset MobDoT2ed FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
      /varset CombatOn FALSE 
      /varset Engaged FALSE    
      
      /varset TargetArray[1] NULL 
      /varset TargetArray[2] NULL 
      /varset TargetArray[3] NULL 
      /varset TargetArray[4] NULL 

  } 
/return 
  
| ############### Debuff 

Sub DeBuff 
:DeBuff_Loop 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellDeBuff}].Mana}) { 
        /fake /gsay  Not enough Mana To Cast --> [[ ${SpellDeBuff} ]] <--
      } else { 
         /call cast ${SpellDeBuff} 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :DeBuff_Loop 
         /varset MobMaloed TRUE 
      } 
   } 
/return 
  
| ############### Slowing 

Sub Slow 
   /if (${Target.PctHPs}<=${CombatAt} && ${Target.ID}==${TargetArray[4]}) { 
      /if (${Me.CurrentMana}<${Spell[${SpellSlow}].Mana}) { 
         /fake /gsay  Not enough Mana To Cast --> [[ ${SpellSlow} ]] <--
      } else { 
      :Slow_Loop 
         /call cast ${SpellSlow} 
         /if (${Macro.Return.Equal["CAST_INTERRUPTED"]}) /goto :Slow_Loop 
         /if (${Macro.Return.Equal["CAST_IMMUNE"]}) { 
            /if (${Verbose}) /fake /gsay --> [[ %T ]] <-- is  [[ IMMUNE ]] to my slow ! 
          
            /varset MobSlowed TRUE 
         } 
         /if (${Macro.Return.Equal["CAST_RESISTED"]}) { 
            /if (!${FastSlow}) { 
               /if (${Verbose}) /fake /gsay --> [[ %T ]] <-- RESISTED slow ! [[ Trying again ]] asap 
                /goto :Slow_Loop 
             } 
            /varset MobSlowed TRUE 
          } 
         /if (${Macro.Return.Equal["CAST_SUCCESS"]}) { 
            /if (${Verbose}) /fake /gsay --> [[ %T ]] <-- is SLOWED with --> [[ ${SpellSlow} ]] <--
            /varset MobSlowed TRUE 
   } 
/return 

Sub GetTarget 
   /assist ${M_Assist} 
   /delay 3 
   /if (${Target.Type.Equal[NPC]}) /if (${Target.Distance}<=${AssistAt} && ${Target.ID}!=${TargetArray[4]} && ${Target.PctHPs}<=${CombatAt}) { 
      /varset TargetArray[1] ${Target.CleanName} 
      /varset TargetArray[2] ${Target.Level} 
      /varset TargetArray[3] ${Target.Name} 
      /varset TargetArray[4] ${Target.ID} 
      /varset CombatOn TRUE 
        
      /varset MobDoT2ed FALSE 
      /varset MobMaloed FALSE 
      /varset MobSlowed FALSE 
      /varset PetOn FALSE 
      /varset MobDoTed FALSE 
   } 
/return 

| ################### Buff the group with buffs from the SpellGrpBuff array 


Sub GrpBuffs 
   /declare i int local 1 
   /for i 1 to ${SpellGrpBuff.Size} 
      /doevents 
      /if (${Spell[${SpellGrpBuff[${i}]}].Mana} > ${Me.CurrentMana}) /return 
      /if ( !${Me.Buff[${SpellGrpBuff[${i}]}].ID} ) { 
         /target pc ${M_Assist} 
         /delay 3 
        /fake  /gsay Hang on ! Rebuffing --> [[ ${SpellGrpBuff[${i}]} ]] <--
         /call cast ${SpellGrpBuff[${i}]} gem5 5s 
        /call Check_grpHPs 
      } 
   /next i 
/return 

|################### Check if any group member needs heal 
Sub Check_grpHPs 
   /declare i int local 1 
    
   /for i 1 to ${Group} 

   /if (${Group.Member[${i}].Class.Name.Equal[Cleric]} || ${Group.Member[${i}].Class.Name.Equal[Druid]} || ${Group.Member[${i}].Class.Name.Equal[Wizard]} || ${Group.Member[${i}].Class.Name.Equal[Magician]} || 

${Group.Member[${i}].Class.Name.Equal[Necromancer]} || ${Group.Member[${i}].Class.Name.Equal[Enchanter]}) /if (${Group.Member[${i}].PctHPs}<=${CasterHeals}) { 
      /target clear 
      /delay 2
      /target PC  ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /fake /gsay --> [[ ${SpellHeal} ]] on --> [[ %T ]] <--
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 
    
   /if (${Group.Member[${i}].Class.Name.Equal[Warrior]} || ${Group.Member[${i}].Class.Name.Equal[Monk]} || ${Group.Member[${i}].Class.Name.Equal[Rouge]} || ${Group.Member[${i}].Class.Name.Equal[Ranger]} || 

${Group.Member[${i}].Class.Name.Equal[Beast]} || ${Group.Member[${i}].Class.Name.Equal[Shadow Knight]} || ${Group.Member[${i}].Class.Name.Equal[Paladin]}) /if (${Group.Member[${i}].PctHPs}<=${MeleeHeals} && 

${Group.Member[${i}].Name.NotEqual[${M_Assist}]}) { 
      /target clear 
      /delay 2
      /target PC ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /fake /gsay --> [[ ${SpellHeal} ]] on --> [[ %T ]] <--
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 

   /if (${Group.Member[${i}].Name.Equal[${M_Assist}]} && ${Group.Member[${i}].PctHPs}<=${TankHeal}) { 
      /target clear 
      /delay 2
      /target PC ${Group.Member[${i}]} 
      /if (${Me.CurrentMana}<${Spell[${SpellHeal}].Mana}) { 
         /echo *** Shid ! I don't have mana to heal ${Group.Member[${i}]} 
      } else /if (${Target.Distance}<=100) { 
         /if (${Verbose}) /fake /gsay --> [[ ${SpellHeal} ]] on --> [[ %T ]] <--
         /call cast ${SpellHeal} gem6 4s 
      } 
   } 

   /next i 
/return 

| ################### Check Mana level and report it 

Sub Check_Mana 
   /if (${Math.Calc[${Me.MaxMana}*${MinMana}/100]} >= ${Me.CurrentMana} && !${LowMana}) { 
      /varset LowMana TRUE 
      /fake /gsay I am [[ LOM... ]] 
   } else /if (${Math.Calc[${Me.MaxMana}*${BuffMana}/100]} <= ${Me.CurrentMana} && ${LowMana}) { 
      /fake /gsay I am [[ GTG... ]]     
      /varset LowMana FALSE  
   } 
/return 

| ################## Canni 5 

Sub Cannibalization 
   /call CheckMyHPs 
   /if (${Me.CurrentHPs} < 3424) { 
      /call CheckMyHPs 
   } else /if (${Me.Buff[${SpellHoT}].ID}) { 
      /if (${Verbose}) /fake /gsay --> [[ Doing Cannibalization ! ]] 
      /aa act Cannibalization 
      /delay 3s 
   } 
/return 

| ################## This will NOT check self HPs, Only check HoT or recast HoT 

Sub CheckMyHPs 
   /if (${Me.CurrentMana}<${Spell[${SpellHoT}].Mana}) { 
     /fake /gsay  Shit, I don't have mana to cast [[ ${SpellHoT} ]]
   } else { 
      /target myself 
      /delay 3 
      /if (!${Me.Buff[${SpellHoT}].ID}) /call cast ${SpellHoT} gem3 3s 
   } 
/return 

| ################## This will Check to see if I am Low on Mana 

Sub LOM 
   /if (${Me.CurrentHPs} < ${Math.Calc[${Me.MaxHPs}/2]}) /call CheckMyHPs 
   /if (${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-5]} && ${Me.SpellReady[${SpellCanni}]}) /call cast ${SpellCanni} gem2 6s 
   /if (${Cannibalization} && ${Me.AltAbilityReady[47]} && ${Me.CurrentMana} < ${Math.Calc[${Me.MaxMana}-1200]} && ${Me.MaxHPs} > 2424) /call Cannibalization 

/return    

| ################## This will Check to see if I have SOW 

Sub SOW 
   /if (!${Me.Buff[Spirit of Eagle].ID} && !${Me.Buff[Flight of Eagles].ID} && !${Me.Buff[Spirit of Bih`Li].ID} && ${DoSow} && ${OutDoors}) { 
      /target pc ${M_Assist} 
      /call cast "Spirit of Bih`Li" gem5 17s 
   } 
/return 

| ################## Summon pet and buff with spells from SpellPetBuff array 

Sub Pet 
   /if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana}<=${Me.CurrentMana}) { 
      /call cast ${SpellPet} gem5 25s 
      /echo Buff ${Me.Pet.ID} with ${SpellPet} 
   } 
   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
   /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana}<=${Me.CurrentMana}) { 
      /pet target 
      /delay 2 
      /call cast ${SpellPetBuff[${i}]} gem5 9s          
    } 
   /next i 
/return 
| ################## Hungry 

Sub Event_Hungry 
   /if (${Engaged}) /return    
   /fake /gsay I am [[ Hungry ]]
   /fake /gsay I am [[ summoning food... ]] please hold pulls 
   /declare i int local 1 
   /for i 1 to 8 
      /autoinventory 
      /delay 1 
      /call cast ${SpellFOOD} gem5 5s 
   /next i 
   /autoinventory 
   /gsay GTG now 
/return 

| ################## Thirsty 

Sub Event_Thirsty 
   /if (${Engaged}) /return    
   /gsay I am Thirsty    
   /gsay I am summoning drink... please hold pulls 
   /declare i int local 1 
   /for i 1 to 8 
      /autoinventory 
      /delay 1 
      /call cast ${SpellDRINK} gem5 5s 
   /next i 
   /autoinventory 
   /gsay GTG now 
/return 
| ############### Pet Death

Sub Event_nopet 

 /if (${engaged}) /return 
 /if (${Command.Equal[pet]} && ${SummonPet}==0) { 
      /varset SummonPet TRUE 
      /echo Summoning Pet:   ${SummonPet} 
   } else /if (${Command.Equal[pet]}) { 
      /varset SummonPet FALSE 
      /echo Summoning Pet:   ${SummonPet} 
 /gsay Summoning My Pet 
 /gsay Please Dont Pull Till Pet is Ready 
 /if (!${Me.Pet.ID} && ${SummonPet} && ${Spell[${SpellPet}].Mana}<=${Me.CurrentMana}) { 
      /call cast ${SpellPet} gem5 25s 
      /echo Buff ${Me.Pet.ID} with ${SpellPet} 
   } 
   /declare i int local 
   /for i 1 to ${SpellPetBuff.Size} 
   /if (!${Me.PetBuff[${SpellPetBuff[${i}]}]} && ${Spell[${SpellPetBuff[${i}]}].Mana}<=${Me.CurrentMana}) { 
      /pet target 
      /delay 2 
      /call cast ${SpellPetBuff[${i}]} gem5 9s          
    } 
   /next i 
/gsay Pets Ready Resume Pulles Now! 
/return 



| ################## Outdoors 

Sub Event_OutDoor 
   /gsay This is an indoor zone. Sorry. 
   /varset OutDoors FALSE 
/return 

| ##################  Zoning 

Sub Event_Zoning 
   /gsay I zoned, time to shrink 
   /gsay Shrinks incomming Now 
   /delay 10 
   /call cast ${SpellSHRINK} gem5 5s 
   /call cast ${SpellSHRINK} gem5 5s 

   /varset TargetArray[1] ${Target.CleanName} 
   /varset TargetArray[2] ${Target.Level} 
   /varset TargetArray[3] ${Target.Name} 
   /varset TargetArray[4] ${Target.ID} 
   /varset CombatOn TRUE 
        
   /varset MobDoT2ed FALSE 
   /varset MobMaloed FALSE 
   /varset MobSlowed FALSE 
   /varset PetOn FALSE 
   /varset MobDoTed FALSE 

/return 

| ################## I Died 

Sub Event_ImDead 
   /gsay Bummer ! 
   :Zone_Loop 
      /if ( ${Me.Bound.ID} != ${Zone.ID} ) /goto :Zone_Loop 
   /delay 5s 
   /consent group 
   /delay 5 
   /gsay Im ready to get rez. 
   /gsay I have consented group. 
   /call Wait4Rez 
   /delay 20 
   /call MemSpells 
   /if (${Me.State.Equal[Stand]}) /sit 

| We do some short meditate before we start again. 

   :Meditate 
      /delay 1s 
      /if (${Me.CurrentMana} < 300) /goto :Meditate 
   /return 

| ################## This part is taken from wait4res. 

Sub Wait4Rez 
   :waitforrez 
      /if (!${Window[ConfirmationDialogBox].Open}) { 
         /delay 5s ${Window[ConfirmationDialogBox].Open} 
         /goto :waitforrez 
      } 
      /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button  leftmouseup 
      :zonein 
         /delay 5 
         /squelch /target mycorpse 
         /delay 5 
         /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
         /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
            /delay 3s 
            /call Loot_Corpse 
         } else /goto :zonein 
   /return 

| #################  Looting Corpse 

Sub Loot_Corpse 
   /declare LootTotal int local 0 
   /declare LootSlot int local 
   /squelch /target mycorpse 
   /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
      /gsay ** Can't target my corpse. 
      /return 
   }    
   /corpse 
   /delay 1s 
   /loot 
   /delay 1s 
   /if (${Me.State.NotEqual[BIND]}) { 
      /gsay ** Massive lag right now... Aborting looting. 
      /return 
   } 
   :LootLag 
      /if (${LootTotal}!=${Corpse.Items}) { 
         /varset LootTotal ${Corpse.Items} 
         /delay 5 
         /goto :LootLag 
      } 
   /for LootSlot 1 to ${LootTotal} 
   :LootItem 
      /itemnotify loot${LootSlot} rightmouseup 
      /delay 3 
      /if (${Corpse.Item[${LootSlot}].ID}) { 
         /delay 2 
         /goto :LootItem 
      } 
   /next LootSlot 
   /delay 5 
   /gsay ** Done looting my corpse. 
   /notify LootWnd DoneButton leftmouseup 
   /return 

| ################# 
| ################# Tells n Hells 
| ################# 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 

      /if (!${ChatType.Equal[GROUP]} && !${ChatType.Equal[TELL]}) /return 
        
| ################# Heal Requests 
  
     /if (${ChatText.Equal[heal]} || ${ChatText.Equal[heal me]}) { 
         /target clear 
      /delay 2
      /target PC ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellHeal} is incomming !! 
             /call cast ${SpellHeal} 
             } 
      /return 
      } 

      /if (${ChatText.Equal[hot]}) { 
         /target clear 
      /delay 2
      /target PC ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellHoT} is incomming !! 
             /call cast ${SpellHoT} 
             } 
      /return 
      } 

| ################# Mob Requests      

      /if (${ChatText.Equal[slow]} || ${ChatText.Equal[add]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
            /call cast ${SpellSlow} gem9 6s 
            /fake /gsay --> [[ %T ]] is  slowed with --> [[ ${SpellSlow} ]] <--
            } 
      /return 
      } 

      /if (${ChatText.Equal[DoT2]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
 /call cast ${SpellDoT2} gem7 5s 
           /fake  /gsay --> [[  %T ]] <-- is DoTed with --> [[ ${SpellDoT2} ]] <--
            } 
      /return 
      } 


      /if (${ChatText.Equal[atk]}) { 
          /target clear 
      /delay 2
      /target PC ${ChatSender} 
         /delay 2 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
            /call cast "spirit of the leopard" gem5 5s 
            } 
      /return 
      } 
       /if (${ChatText.Equal[haste]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
             /tell ${ChatSender} ${SpellHASTE} is incomming to you ${ChatSender}!!! 
             /call cast "talisman of alacrity" gem5 
        }    
         /return 
      }   
         /if (${ChatText.Equal[might]}) { 
         /target pc ${ChatSender} 
         /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=100) { 
            /fake  /tell ${ChatSender} --> [[ S[irit of Might ]] --> is incomming to you --> [[ ${ChatSender}!!! ]]<--
             /call cast "spirit of might" gem5 5s 
        }    
         /return 
      }   
      /if (${ChatText.Equal[DoT]}) { 
         /assist ${ChatSender} 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<=100) { 
 /call cast ${SpellDoT} gem6 5s 
            /fake /gsay --> [[ %T ]] <-- is DoTed with --> [[ ${SpellDoT} ]] <--
            } 
      /return 
            } 
      /return 
      } 
      /if (${Engaged}) /return    

| ################### Go Home 

 /if (${ChatText.Equal[gate now]} && ${ChatType.Equal[TELL]}) { 
    /call cast ${SpellGATE} gem9  
    /return 
    } 

 /if (${ChatType.Equal[TELL]}) { 
    /1 [${ChatSender}]:${ChatText} 
    /vtell ${ChatController} 001 
    /return 
    } 
/return 

| ################### This will check whenever the player is changing any variable via /echo 

Sub Event_ToggleVariable(string Line, string Command, string Command2) 

   /if (${Command.Equal[malo]} && ${DoMalo}==0) { 
      /varset DoMalo TRUE 
      /echo Do Malo:   ${DoMalo} 
   } else /if (${Command.Equal[malo]}) { 
      /varset DoMalo FALSE 
      /echo Do Malo:   ${DoMalo} 
   } 

   /if (${Command.Equal[slow]} && ${DoSlow}==0) { 
      /varset DoSlow TRUE 
      /echo Do Slow:   ${DoSlow} 
   } else /if (${Command.Equal[slow]}) { 
      /varset DoSlow FALSE 
      /echo Do Slow:   ${DoSlow} 
   } 
    
   /if (${Command.Equal[fastslow]} && ${FastSlow}==0) { 
      /varset FastSlow TRUE 
      /echo Do Fast Slow:   ${FastSlow} 
   } else /if (${Command.Equal[fastslow]}) { 
      /varset FastSlow FALSE 
      /echo Do Fast Slow:   ${FastSlow} 
   } 
    
   /if (${Command.Equal[DoT2]} && ${DoDoT2}==0) { 
      /varset DoDoT2 TRUE 
      /echo Do DoT2:   ${DoDoT2} 
   } else /if (${Command.Equal[DoT2]}) { 
      /varset DoDoT2 FALSE 
      /echo Do DoT2:   ${DoDoT2} 
   }    
    
   /if (${Command.Equal[pet]} && ${SummonPet}==0) { 
      /varset SummonPet TRUE 
      /echo Summon Pet:   ${SummonPet} 
   } else /if (${Command.Equal[pet]}) { 
      /varset SummonPet FALSE 
      /echo Summon Pet:   ${SummonPet} 
   }    
    
   /if (${Command.Equal[dot]} && ${DoDoT}==0) { 
      /varset DoDoT TRUE 
      /echo Do DoT:   ${DoDoT} 
   } else /if (${Command.Equal[dot]}) { 
      /varset DoDoT FALSE 
      /echo Do DoT:   ${DoDoT} 
   } 
    
   /if (${Command.Equal[buffs]} && ${DoBuffs}==0) { 
      /varset DoBuffs TRUE 
      /echo Do Buffs:   ${DoBuffs} 
   } else /if (${Command.Equal[buffs]}) { 
      /varset DoBuffs FALSE 
      /echo Do Buffs:   ${DoBuffs} 
   } 
    
   /if (${Command.Equal[sow]} && ${DoSow}==0) { 
      /varset DoSow TRUE 
      /echo Do Sow:   ${DoSow} 
   } else /if (${Command.Equal[sow]}) { 
      /varset DoSow FALSE 
      /echo Do Sow:   ${DoSow} 
   } 
    
   /if (${Command.Equal[nuke]} && ${DoNuke}==0) { 
      /varset DoNuke TRUE 
      /echo Do Nuke:   ${DoNuke} 
   } else /if (${Command.Equal[nuke]}) { 
      /varset DoNuke FALSE 
      /echo Do Nuke:   ${DoNuke} 
   } 
    
   /if (${Command.Equal[heal]} && ${DoHeal}==0) { 
      /varset DoHeal TRUE 
      /echo Do Heal:   ${DoNuke} 
   } else /if (${Command.Equal[heal]}) { 
      /varset DoHeal FALSE 
      /echo Do Heal:   ${DoNuke} 
   } 

   /if (${Command.Equal[verbose]} && ${Verbose}==0) { 
      /varset Verbose TRUE 
      /echo Verbose:   ${Verbose} 
   } else /if (${Command.Equal[verbose]}) { 
      /varset Verbose FALSE 
      /echo Verbose:   ${Verbose} 
   } 

   /if (${Command.Equal[buffpet]} && ${BuffPet}==0) { 
      /varset BuffPet TRUE 
      /echo Buff Pet:   ${BuffPet} 
   } else /if (${Command.Equal[buffpet]}) { 
      /varset BuffPet FALSE 
      /echo Buff Pet:   ${BuffPet} 
   } 
    
   /if (${Command.Equal[assistat]}) { 
      /varset AssistAt ${Command2} 
      /fake /gsay Assisting at range:  --> [[ ${AssistAt} _ (Longer range then 100 is futile) ]] <--
   } 
    
   /if (${Command.Equal[dotat]}) { 
      /varset CastDoTat ${Command2} 
      /echo Casting ${SpellDoT} at ${CastDoTat}% 
   } 
    
   /if (${Command.Equal[DoT2at]}) { 
      /varset DoT2at ${Command2} 
      /echo DoT2ing Mobs at ${DoT2at}% 
   } 
    
   /if (${Command.Equal[nukeat]}) { 
      /varset NukeAt ${Command2} 
      /echo Starting to Nuke Mobs at ${NukeAt}% 
   } 
    
   /if (${Command.Equal[combatat]}) { 
      /varset CombatAt ${Command2} 
      /echo Initiate Combat at ${CombatAt}% (Malo / Slow) ]] 
   } 
    
   /if (${Command.Equal[healtankat]}) { 
      /varset TankHeal ${Command2} 
      /fake /gsay Healing --> [[ ${M_Assist} ]] <-- at --> [[ ${TankHeal}% ]] <--
   } 
    
   /if (${Command.Equal[healmeleeat]}) { 
      /varset MeleeHeals ${Command2} 
      /fake /gsay Healing all Melee classes at --> [[ ${MeleeHeals}% ]] <--
   } 
    
   /if (${Command.Equal[healcastersat]}) { 
      /varset CasterHeals ${Command2} 
      /fake /gsay Healing all Caster classes at --> [[ ${CasterHeals}% ]] <--
   } 
    
   /if (${Command.Equal[assist]}) { 
      /varset M_Assist ${Command2} 

      /sq /target pc ${M_Assist} 
      /if (!${Target.ID}) { 
         /echo ${M_Assist} is not here dude ! 
         /return 
      } 
        
      /fake /gsay I will assist: --> [[  ${M_Assist} ]] <-- And Heal Him AT --> [[ ${TankHeal}% ]] <--
   } 
    
   /if (${Command.Equal[healat]}) { 
      /varset HealGRPat ${Command2} 
      /fake /gsay Healing any group member below --> [[ ${HealGRPat}% HPs ]] <-- 
   } 

 /return
also if your shaman has low mana pool you may want to remove spirit or leapord from pet buff list its a 1min30sec buff and therefor gets cast alot but i have over 10k mana so /shrug like the dps for faster kills

oki bbcode wont allow fakelink links to show it shows them as link lol but if u have fakelink u know how to add the [ [ ] ] boxes around them or if someone can tell me how to disable the code links inside code brakets