New and improved Duid.mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

a_large_rat01
orc pawn
orc pawn
Posts: 10
Joined: Thu Jan 02, 2003 3:43 am

New and improved Duid.mac

Post by a_large_rat01 » Fri Jan 03, 2003 4:14 am

Hi all,
I have taken Nuad's Druid.mac and gave it some more features that I wanted/needed.
New features are:
- Pet support :!: Buffs/heals/etc
- Auto heal for Master/Pet/Myself
- Auto self rebuff
- Auto Mana check, check if enough mana before casting
- Report if loom
- If Master/Pet/Mob out of range go to target to cast (should work but not tested yet)

ToDo's:
- Defend myself when attacked (eg root, walk away and snare then sit again)

Please feel free to give comments ideas so that I can make this macro much better. :D

Have fun,

a_large_rat01 :wink:

Druid.mac

Code: Select all

| Druid.mac - Druid Powerlevel Script, optimized for LVL 55+ Druids 
| Written by: Nuad 
| Updated by: Lurker_005 
| Updated by: a_lage_rat01 (Added autoheal master, his pet, myself, pet code to buff/heal even new pet, 
|             added root and ensnare break message, manacheck) 
| 
| THIS IS AN ONGOING, UNFINISHED WORK... 03-01-2003 
| 
| Start with /macro druid <Controller Name> <Type> <GoodFriend> e.g. /macro druid Buranda 1 Myfriend 
| 
| Spells for PLing (Type 1)........: Heal, DS, Skin, Chloro, STR, SoW, Snare, Root 
| Spells for Hunting (Type 2)......: Heal, DS, Skin, Winged, STR, SoW, Breath, Evac 
| or if indoors (Type 3)...........: Heal, DS, Skin, Winged, STR, Immolate, Breath, Evac 
| or if a Nuke is required (Type 4): Heal, DS, Skin, Winged, STR, Nuke, Debuff, Evac 
| 
|#include SpellSub.mac 
#turbo 
#include spellcast2.mac 
#include Spellbook.mac 
#chat tell 
#event ArmOff "Your Drones of Doom spell has worn off." 
#event EpicOff "Your Wrath of Nature spell has worn off." 
#event BreathOff "Your Breath of Ro spell has worn off." 
#event WingedOff "Your Winged Death spell has worn off." 
#event ImmoOff "Your Immolate spell has worn off." 
#event RegenOff "You have stopped regenerating." 
#event SowOff "The spirit of wolf leaves you." 
#event SkinOff "Your skin turns to normal." 
#event Snarebroke "Your ensnare spell has worn off" 
#event Rootbroke "The roots fall away" 

#define Master v30 
#define SpellGroup v34 
#define MasterPet v98 
#define MasterPetID v95 
#define GoodFriend v97 
#define Manaflag v96 

Sub Main 
    /filter macros all 
    /varset Master $p0 
    /varset SpellGroup $p1 
	/varset GoodFriend $p2 
    /varset Manaflag 0 
    /varset v29 0 
    /call MemSpells $SpellGroup 
| Get Pet info 
    /target $Master 
    /varset MasterPetID "$target(pet)" 
| If Master has a pet	
    /if n $MasterPetID!=0 { 
| get pets name (problem is that name has a number in it eg. Konan00) 
| I dont know if this works with charmed pets, could be that they dont have a number, I still have to check this 
      /varset v94 "$spawn($MasterPetID,name)" 
      /varset v93 0 
      /varcalc v93 $strlen($v94) - 2
      /varset MasterPet "$mid(0,$v93,$v94)" 
| Cutoff the last 2 charaters and there we have his name
      /tell $Master Ready to go and know you have $MasterPet as pet 
    } else { 
      /tell $Master Ready to go and you dont have a pet 
    } 
| Main loop to check events and check status of Master, his pet and me
    :loop  
| Handle events
      /doevents  
| Check Mana to see if I have enough if not tell Master 
	  /if n $char(mana,pct)<10 { 
        /call ManaStat
      } else { 
        /varset Manaflag 0 
      }
      /if n $Manaflag==1 { 
| If Mana to low dont even check the rest
	    /goto :loop 
      }
| Check Masters HP if under 65% heal him
      /if n $spawn($id($Master),hp,pct)<65 { 
|       /stand 
        /target $Master 
        /call HealSub 
        /sit 
	  }
| Check if Master still has or gained a pet and heal him if his HP under 65% 
      /varset MasterPetID "$target(pet)" 
      /if n $MasterPetID!=0 { 
        /call AutoPet 
	  } 
| Check HP and heal myself 
	  /if n $char(hp,pct)<30 { 
        /call SelfHeal 
      } 
    /goto :loop 
/return 

Sub AutoPet 
| Sub to check HP of pet and heal
   /if n $spawn($MasterPetID,hp,pct)<65 { 
      /varset v94 "$spawn($MasterPetID,name)" 
      /varset v93 0 
      /varcalc v93 $strlen($v94) - 2
      /varset MasterPet "$mid(0,$v93,$v94)" 
|     /stand 
      /target $MasterPet 
      /call HealSub 
      /sit 
   } 
/return 

Sub ManaStat 
| Sub to show tell Master if mana is low
   /if n $Manaflag!=1 { 
     /tell $Master Low on mana , Mana: $char(mana,pct), HP: $char(hp,pct) 
     /varset Manaflag 1 
   }
/return 

Sub Event_Chat 
   /varset v33 $p1 
| Check if Tell is from the Controller, a goodfriend or someone else
   /if "$v33"~~"$GoodFriend" { 
     /tell $p1 Talk to $Master U n00b 
     /delay 2 
     /tell $Master Tell from $p1 to $char(name) , i told him to talk to you 
     /return 
   } 

   /if "$v33"!="$Master" { 
     /mqlog Tell from $p1 : $p2 
     /tell $p1 Sorry i'm really busy at the moment and not aviable for tells 
     /delay 2 
     /tell $Master Tell from $p1 to $char(name) , i told him that i'm busy 
     /return
   } 

| Tell Master my Mana/HP status 
   /if $p2~~"status" { 
      /tell $Master Mana: $char(mana,pct), HP: $char(hp,pct) 
   /return 
   } 

| Switch pet ( havn't check but this should go auto now with pet HP check )
   /if $p2~~"newpet" { 
      /target $Master 
      /varset MasterPetID "$target(pet)" 
      /if n $MasterPetID!=0 { 
        /varset v94 "$spawn($MasterPetID,name)" 
        /varset v93 0 
        /varcalc v93 $strlen($v94) - 2
        /varset MasterPet "$mid(0,$v93,$v94)" 
        /tell $Master Ready to go and know you have $MasterPet $MasterPetID as pet 
      } else { 
        /tell $Master Sorry but you dont have a pet 
      } 
   /return 
   } 

| Show commands to Master
   /if $p2~~"help" { 
      /call Help 
   /return 
   } 
| Mem spell set 
   /if $p2~~"type1" { 
      /call MemSpells 1 
   /return 
   } 
   /if $p2~~"type2" { 
      /call MemSpells 2 
   /return 
   } 
   /if $p2~~"type3" { 
      /call MemSpells 3 
   /return 
   } 
   /if $p2~~"type4" { 
      /call MemSpells 4 
   /return 
   } 
| Goto Master   
   /if $p2~~"come" { 
     /call GoMaster 
     /return 
   } 
| Log 
   /if $p2~~"home" { 
     /call GoHome 
     /return 
   }

|  /stand 
   /target $Master 
	 /call CastCommand "$p2"
   /sit 
   /doevents 
/return 

Sub CastCommand
     /if $p0~~"healpet" /call HealSubPet
     /if $p0~~"healme" /call HealSub 
     /if $p0~~"dspet" /call  DsSubPet      
     /if $p0~~"dsme" /call  DsSub 
     /if $p0~~"skinpet" /call SkinSubPet 
     /if $p0~~"skinme" /call SkinSub 
     /if $p0~~"regenpet" /call RegenSubPet 
     /if $p0~~"regenme" /call RegenSub 
     /if $p0~~"strpet" /call StrengthSubPet 
     /if $p0~~"strme" /call StrengthSub 
     /if $p0~~"sowpet" /call SoWSubPet 
     /if $p0~~"sowme" /call SoWSub 
     /if $p0~~"snare" /call SnareSub 
     /if $p0~~"root" /call RootSub 
     /if $p0~~"self" /call SelfBuff 
     /if $p0~~"evac" /call Evac 
     /if $p0~~"sheal" /call SelfHeal 
     /if $p0~~"rotg" /call Chest 
     /if $p0~~"drones" /call Arm 
     /if $p0~~"epic" /call Epic 
     /if $p0~~"winged" /call Winged 
     /if $p0~~"breath" /call Breath 
     /if $p0~~"immo" /call Immo 
     /if $p0~~"nuke" /call Nuke 
     /if $p0~~"debuff" /call Debuff 
/return

Sub GoMaster 
   /stand 
   /target $Master 
   /face nopredict 
   /varset v90 $target(id) 
   /varset t0 5m 
   /tell $Master I'm coming 
   :CloserAFM 
      /doevents 
      /if "$target(id)"!="$v90" /goto :EndAFM 
      /if n $target(distance)>14 /call AutoRun 1 
      /if n $target(distance)<15 /goto :EndAFM 
      /face nopredict 
      /doevents 
      /if n $t0==0 /press esc 
   /goto :CloserAFM 

   :EndAFM 
   /call AutoRun 0 
   /tell $Master stopped 
   /doevents 
   /sit
/return 

Sub GoTarget 
   /stand 
   /face nopredict 
   /varset v90 $target(id) 
   /varset t0 5m 
   /tell $Master OMW to %T 
   :CloserAFT 
      /doevents 
      /if "$target(id)"!="$v90" /goto :EndAFT 
      /if n $target(distance)>14 /call AutoRun 1 
      /if n $target(distance)<15 /goto :EndAFT 
      /face nopredict 
      /doevents 
      /if n $t0==0 /press esc 
   /goto :CloserAFT 

   :EndAFT 
   /call AutoRun 0 
   /tell $Master stopped 
   /doevents 
|   /sit
/return 

Sub GoTargetNEW
| $p0 is minimum distance needed to cast 
   /if n $p0>0 { 
     /varset v91 $p0
   } else { 
     /varset v91 15
   }
   /stand 
   /face nopredict 
   /varset v90 $target(id) 
   /varset t0 5m 
   /tell $Master OMW to %T 
   :CloserAFN 
      /doevents 
      /if "$target(id)"!="$v90" /goto :EndAFN 
      /if n $target(distance)>$calc($v91-2) /call AutoRun 1 
      /if n $target(distance)<$calc($v91) /goto :EndAFN 
      /face nopredict 
      /doevents 
      /if n $t0==0 /press esc 
   /goto :CloserAFN 

   :EndAFN 
   /call AutoRun 0 
   /tell $Master stopped 
   /doevents 
|   /sit
/return 

Sub AutoRun 
   /if $p0==$v80 /return 
   /varset v80 $p0 
   /if $p0==1 /sendkey down up 
   /if $p0==0 /sendkey up up 
/return 

Sub GoHome 
   /sit 
   /tell $Master Camping... CU 
   /camp desktop 
   /endmacro 
/return 

Sub HealSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet 
	/if n $spell("$v41",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v41",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v41",range) 
	} 
    /tell $Master INC Heal for %T 
	:ReHealPet
    /call cast "$v41" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v41",range) 
      /doevents 
	  /goto :ReHealPet
	} 
    /tell $Master Healing done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return    

Sub HealSub 
	/if n $spell("$v41",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v41",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v41",range) 
	} 
    /tell $Master INC Heal for %T 
	:ReHeal
	/call cast "$v41" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v41",range) 
      /doevents 
	  /goto :ReHeal
	} 
    /tell $Master Healing done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return    

Sub DsSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet 
	/if n $spell("$v42",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v42",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v42",range) 
	} 
    /tell $Master INC Damage Shield for %T 
	:ReDsSubPet 
	/call cast "$v42" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v42",range) 
      /doevents 
	  /goto :ReDsSubPet 
	} 
    /tell $Master DS Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub DsSub 
	/if n $spell("$v42",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v42",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v42",range) 
	} 
    /tell $Master INC Damage Shield for %T 
	:ReDs 
    /call cast "$v42" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v42",range) 
      /doevents 
	  /goto :ReDs 
	} 
    /tell $Master DS Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return 

Sub SkinSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet
	/if n $spell("$v43",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v43",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v43",range) 
	} 
    /tell $Master INC Skin for %T 
	:ReSkinSubPet 
    /call cast "$v43" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v43",range) 
      /doevents 
	  /goto :ReSkinSubPet 
	} 
    /tell $Master Skin Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub SkinSub 
	/if n $spell("$v43",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v43",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v43",range) 
	} 
    /tell $Master INC Skin for %T 
	:ReSkin 
    /call cast "$v43" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v43",range) 
      /doevents 
	  /goto :ReSkin 
	} 
    /tell $Master Skin Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return 
    
Sub RegenSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet 
	/if n $spell("$v44",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v44",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
	} 
    /tell $Master INC Regeneration for %T 
	:ReRegenSubPet 
    /call cast "$v44" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
      /doevents 
	  /goto :ReRegenSubPet 
	} 
    /tell $Master Regeneration Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub RegenSub 
	/if n $spell("$v44",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v44",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
	} 
    /tell $Master INC Regeneration for %T 
	:ReRegen 
    /call cast "$v44" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
      /doevents 
	  /goto :ReRegen 
	} 
    /tell $Master Regeneration Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return 

Sub StrengthSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet 
	/if n $spell("$v45",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v45",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v45",range) 
	} 
    /tell $Master INC STR for %T 
	:ReStrengthSubPet 
    /call cast "$v45" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v45",range) 
      /doevents 
	  /goto :ReStrengthSubPet 
	} 
    /tell $Master STR Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub StrengthSub 
	/if n $spell("$v45",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v45",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v45",range) 
	} 
    /tell $Master INC STR for %T 
	:ReStrength 
    /call cast "$v45" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v45",range) 
      /doevents 
	  /goto :ReStrength 
	} 
    /tell $Master STR Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return 
    
Sub SoWSubPet 
    /if n $MasterPetID==0 { 
      /tell $Master Sorry but you dont have a pet 
	  /return
	}
    /target $MasterPet 
	/if n $spell("$v46",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v46",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
	} 
    /tell $Master INC SoW for %T 
	:ReSoWSubPet 
    /call cast "$v46" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
      /doevents 
	  /goto :ReSoWSubPet 
	} 
    /tell $Master SoW Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
	/target $Master 
/return 

Sub SoWSub 
	/if n $spell("$v46",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /if n $spell("$v46",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
	} 
    /tell $Master INC SoW for %T 
	:ReSoW 
    /call cast "$v46" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
      /doevents 
	  /goto :ReSoW 
	} 
    /tell $Master SoW Buff done, Mana: $char(mana,pct), HP: $char(hp,pct) 
/return 
    
Sub SnareSub 
	/if n $spell("$v47",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v47",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
	} 
    /tell $Master Ensnaring %T 
	:ReSnare 
    /call cast "$v47" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
      /doevents 
	  /goto :ReSnare 
	} 
    /tell $Master %T is ensnared, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub RootSub 
	/if n $spell("$v48",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v48",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v48",range) 
	} 
    /tell $Master Rooting %T 
	:ReRoot 
    /call cast "$v48" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v48",range) 
      /doevents 
	  /goto :ReRoot 
	} 
    /tell $Master %T is rooted, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub SelfBuff 
	/if n $calc($spell("$v46",mana)+$spell("$v43",mana))>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /target myself 
    /tell $Master Casting SoW now on myself 
    /call cast "$v46" 
    /target myself 
    /tell $Master Casting SLN now on myself 
    /call cast "$v43" 
    /tell $Master Selfbuffs done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub Evac 
	/if n $spell("$v48",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
   /target $Master 
   /invite $Master 
   /tell $Master You have 8 Seconds now to press Follow 
   /call cast "$v48" 
   /tell $Master EVAC INC 
/return 

Sub SelfHeal 
   /if n $spell("$v41",mana)>$char(mana,cur) { 
     /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
     /return
   } 
   /stand
   /target myself 
   /tell $Master INC Heal for %T 
   /call cast "$v41" 
   /tell $Master Healing done, Mana: $char(mana,pct) HP: $char(hp,pct) 
   /target $Master 
/return 

Sub Chest
   /stand 
   /tell $Master INC RotG, no other actions possible in the next 10 Seconds! 
   /press i 
   /click right equip chest 
   /delay 95 
   /press i 
   /tell $Master RotG done, Mana: $char(mana,pct) HP: $char(hp,pct) 
/return 

Sub Arm 
   /stand 
   /assist $Master 
   /delay 6 
   /if n $spell("Drones of Doom",range)<$target(distance) { 
     /tell $Master %T Out of range
     /call GoTarget 
   } 
   /varset v31 $target(name) 
   /tell $Master INC Drones of Doom on %T, no other actions possible in the next 10 Seconds! 
   /press i 
   /click right equip arms 
   /delay 85 
   /press i 
   /tell $Master Drones of Doom on %T done, Mana: $char(mana,pct) HP: $char(hp,pct) 
   /target $Master 
/return 

Sub Epic 
   /stand
   /assist $Master 
   /delay 6 
   /tell $Master INC Epic DoT on %T, no other actions possible in the next 10 Seconds! 
   /press i 
   /click right equip primary 
   /delay 95 
   /press i 
   /tell $Master Epic DoT on %T done, Mana: $char(mana,pct) HP: $char(hp,pct) 
   /target $Master 
/return 

Sub Winged 
	/if n $spell("$v44",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v44",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
	} 
    /tell $Master Winged Death goes to %T 
    :ReWing
    /call cast "$v44"    
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v44",range) 
      /doevents 
	  /goto :ReWing 
	} 
    /tell $Master Winged Death on %T done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub Breath 
	/if n $spell("$v47",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v47",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
	} 
    /tell $Master Breath of Ro goes to %T 
    :ReBreath 
    /call cast "$v47" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
      /doevents 
	  /goto :ReBreath 
	} 
    /tell $Master Breath of Ro on %T done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub Immo 
	/if n $spell("$v46",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v46",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
	} 
    /tell $Master Immolate goes to %T 
	:ReImmo 
    /call cast "$v46" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
      /doevents 
	  /goto :ReImmo 
	} 
    /tell $Master Immolate on %T done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub Nuke 
	/if n $spell("$v46",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v46",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
	} 
    /tell $Master Nuking %T 
    :ReNuke 
    /call cast "$v46"  
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v46",range) 
      /doevents 
	  /goto :ReNuke 
	} 
    /tell $Master Nuke on %T done, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

Sub Debuff 
	/if n $spell("$v47",mana)>$char(mana,cur) { 
      /tell $Master Sorry to low on mana to '$p2', Mana: $char(mana,pct), HP: $char(hp,pct) 
	  /return
    } 
    /stand 
    /assist $Master 
    /delay 6 
    /if n $spell("$v47",range)<$target(distance) { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
	} 
    /tell $Master Debuffing %T 
    :ReDebuff 
    /call cast "$v47" 
    /if n $return==4 { 
	  /tell $Master %T Out of range
	  /call GoTargetNEW $spell("$v47",range) 
      /doevents 
	  /goto :ReDebuff 
	} 
    /tell $Master %T successfully debuffed, Mana: $char(mana,pct), HP: $char(hp,pct) 
    /target $Master 
/return 

| Events are handled here 
Sub Event_ArmOff 
   /tell $Master Drones of Doom from $char(name) has worn off. 
/return 

Sub Event_EpicOff 
   /tell $Master Epic DoT from $char(name) has worn off. 
/return 

Sub Event_BreathOff 
   /tell $Master Breath of Ro from $char(name) has worn off. 
/return 

Sub Event_WingedOff 
   /tell $Master Winged Death from $char(name) has worn off. 
/return 

Sub Event_ImmoOff 
   /tell $Master Immolate from $char(name) has worn off. 
/return 

sub Event_Snarebroke 
   /tell $Master Ensnare from $char(name) has worn off. 
/return 

sub Event_Rootbroke 
   /tell $Master Root from $char(name) has worn off. 
/return 

Sub Event_RegenOff 
   /tell $Master My HP Regeneration Buff needs to be recast. 
/return 

| SoW & Skin selfbuffs are auto renewed if enough Mana

sub Event_SowOff 
   /if n $spell("$v46",mana)>$char(mana,cur) { 
     /tell $Master My SoW has worn off but to low on mana to recast, Mana: $char(mana,pct), HP: $char(hp,pct) 	  
	 /return
   } 
   /stand
   /target myself 
   /tell $Master Casting SoW now on myself 
   /call cast "$v46" 
   /tell $Master Selfsow done, Mana: $char(mana,pct), HP: $char(hp,pct) 
   /target $Master 
   /sit
/return 

sub Event_SkinOff 
   /if n $spell("$v43",mana)>$char(mana,cur) { 
     /tell $Master My Skinbuff has worn off but to low on mana to recast, Mana: $char(mana,pct), HP: $char(hp,pct) 
	 /return
   } 
   /stand
   /target myself 
   /tell $Master Casting SLN now on myself 
   /call cast "$v43" 
   /tell $Master Selfskin done, Mana: $char(mana,pct), HP: $char(hp,pct) 
   /target $Master 
   /sit
/return 

Sub MemSpells 
|put spell group mem commans here, by group 
| Spells for PLing (Type 1)........: Heal, DS, Skin, Chloro, STR, SoW, Snare, Root 
| Spells for Hunting (Type 2)......: Heal, DS, Skin, Winged, STR, SoW, Breath, Evac 
| or if indoors (Type 3)...........: Heal, DS, Skin, Winged, STR, Immolate, Breath, Evac 
| or if a Nuke is required (Type 4): Heal, DS, Skin, Winged, STR, Nuke, Debuff, Evac 
/if n $p0>4 /return 

/varset SpellGroup $p0 

/if n $SpellGroup==1 { 
|   /echo loading spellgroup 1 
   /varset v41 "Superior Healing" 
   /varset v42 "Shield of Thorns" 
   /varset v43 "Skin Like Nature" 
   /varset v44 "Chloroplast" 
   /varset v45 "Storm Strength" 
   /varset v46 "Spirit of Wolf" 
   /varset v47 "Ensnare" 
   /varset v48 "Ensnaring Roots"    
   } 
/if n $SpellGroup==2 { 
|   /echo loading spellgroup 2 
   /varset v41 "Greater Healing" 
   /varset v42 "Shield of Thorns" 
   /varset v43 "Winged Death" 
   /varset v44 "Chloroplast" 
   /varset v45 "Storm Strength" 
   /varset v46 "Spirit of Wolf" 
   /varset v47 "Breath of Ro" 
   /varset v48 "Lesser Succor"    
   } 
/if n $SpellGroup==3 { 
|   /echo loading spellgroup 3 
   /varset v41 "Greater Healing" 
   /varset v42 "Shield of Thorns" 
   /varset v43 "Winged Death" 
   /varset v44 "Chloroplast" 
   /varset v45 "Storm Strength" 
   /varset v46 "Immolate" 
   /varset v47 "Breath of Ro" 
   /varset v48 "Lesser Succor"    
   } 
/if n $SpellGroup==4 { 
|   /echo loading spellgroup 4 
   /varset v41 "Greater Healing" 
   /varset v42 "Shield of Thorns" 
   /varset v43 "Winged Death" 
   /varset v44 "Chloroplast" 
   /varset v45 "Storm Strength" 
   /varset v46 "Starfire" 
   /varset v47 "Nullify Magic" 
   /varset v48 "Lesser Succor"    
   } 
/call MemorizeSpell "$v41" 1 
/call MemorizeSpell "$v42" 2 
/call MemorizeSpell "$v43" 3 
/call MemorizeSpell "$v44" 4 
/call MemorizeSpell "$v45" 5 
/call MemorizeSpell "$v46" 6 
/call MemorizeSpell "$v47" 7 
/call MemorizeSpell "$v48" 8 
/return 

Sub Help 
| unfinished yet 
    /tell $Master heal, healpet, ds, dspet, skin, skinpet, regen, regenpet, str, strpet, sow, sowpet 
    /delay 1 
    /tell $Master newpet, snare, root, come, self, home, evac, sheal, status, rotg 
    /delay 1 
    /tell $Master drones, epic, winged, breath, immo, nuke, debuff, help, type1, type2, type3, type4 
/return
Spellcast2.mac ( This hasn't been changed, just including to make complete )

Code: Select all

|** SpellCast.mac 
** This will cast a spell reliably for you... 
** Usage: 
** /call Cast "spellname" 
** It will return the following values: 
** CAST_SUCCESS 
** CAST_UNKNOWNSPELL 
** CAST_OUTOFMANA 
** CAST_OUTOFRANGE 
** CAST_CANNOTSEE 
** CAST_STUNNED 
** CAST_RESISTED 
**| 

#event Fizzle "Your spell fizzles!" 
#event Interrupt "Your spell is interrupted." 
#event Recover "You haven't recovered yet..." 
#event Resisted "You target resisted the" 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event NoLOS "You cannot see your target." 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event Collapse "Your gate is too unstable, and collapses." 

#define CastStatus v59 
#define CastTimer t7 

#define CAST_SUCCESS 0 
#define CAST_UNKNOWNSPELL 1 
#define CAST_RESTART 2 
#define CAST_OUTOFMANA 3 
#define CAST_OUTOFRANGE 4 
#define CAST_CANNOTSEE 5 
#define CAST_STUNNED 6 
#define CAST_RESISTED 7 

Sub Cast 
  /if n $char(gem,"$p0")==0 /return CAST_UNKNOWNSPELL 
  :StartCast 
  /if n $char(gem,"$p0")&0 /call WaitForRefresh "$p0" 
  /cast "$p0" 
  /varset CastTimer $int($spell("$p0",casttime)*10+$spell("$p0",recoverytime)*10) 
  /varset CastStatus CAST_SUCCESS 
  :WaitCast 
     /doevents Fizzle 
     /doevents Interrupt 
     /doevents Recover 
     /doevents Standing 
     /doevents OutOfRange 
     /doevents OutOfMana 
     /doevents NoLOS 
     /doevents Resisted 
     /if n $CastStatus==CAST_RESTART /goto :StartCast 
     /if n $CastStatus&CAST_RESTART /return $CastStatus 
  /if n $CastTimer&0 /goto :WaitCast 
  /varset CastTimer 0 
/return CAST_SUCCESS 

Sub WaitForRefresh 
   :LoopWaitForRefresh 
      /delay 0 
   /if n $char(gem,"$p0")&0 /goto :LoopWaitForRefresh 
/return 

Sub Event_Fizzle 
   /varset CastStatus CAST_RESTART 
/return 

Sub Event_Interrupt 
   /varset CastStatus CAST_RESTART 
/return 

Sub Event_Recover 
   /varset CastStatus CAST_RESTART 
   /delay 5 
/return 

Sub Event_Standing 
   /varset CastStatus CAST_RESTART 
   /stand 
/return 

Sub Event_Collapse 
   /varset CastStatus CAST_RESTART 
/return 

Sub Event_OutOfMana 
   /varset CastStatus CAST_OUTOFMANA 
/return 

Sub Event_OutOfRange 
   /varset CastStatus CAST_OUTOFRANGE 
/return 

Sub Event_NoLOS 
   /varset CastStatus CAST_CANNOTSEE 
/return 

Sub Event_Stunned 
   /varset CastStatus CAST_STUNNED 
/return 

Sub Event_Resisted 
   /varset CastStatus CAST_RESISTED 
/return 
THE END

User avatar
Nuad
a ghoul
a ghoul
Posts: 93
Joined: Thu Jun 27, 2002 11:43 am
Location: Berlin, Germany

Post by Nuad » Mon Jan 06, 2003 8:43 am

Great to see my good old Macro growing and growing... :)