Util Macro (v1.0.0 - 2004-06-26)
Posted: Sat Jun 26, 2004 12:46 pm
This is a util macro I created. I intend to fill it up with new utils as time goes. I have created 4 hotkeys for the 4 utils that I use for my beastlord.
Code is here: http://www.halsvik.net/d/?/public/util.mac
-Wolf5
Code is here: http://www.halsvik.net/d/?/public/util.mac
-Wolf5
Code: Select all
| Macro: util.mac v1.0.1 - 2004-07-05
| This macro is drawn out from Natural Beastlord Hunter. It's purpose is to grow
| and be a utility macro.
| It contains 4 "utilities" so far (best suited for Beastlords atm).
|
| "/macro util 1" will buff yourself with buffs from your list.
| "/macro util 2" will create pet and buff it up
| "/macro util 3" will buff self, create pet and buff it up
| "/macro util 4" will heal yourself up to max.
|
| Just make hotkeys in EQ to run these :-)
#include spellcast.inc
#define HEAL_BELOW_PCT 90
#define HEAL_SPELL "Healing"
#define HEAL_GEM 4
#define HEAL_PET_BELOW_PCT 70
#define HEAL_PET_SPELL "Sha's Restoration"
#define HEAL_PET_GEM 5
#define PET_SPELL "Spirit of Zehkes"
#define PET_GEM 7
|----------------------------------------------------------------------------
|SUB: Main - Declarations and Initialization
|----------------------------------------------------------------------------
Sub Main
|Buffs to be kept up on self (max 15) - "Buff" or "Buff|GemSlot"
/declare MyBuffs[7] string outer
/varset MyBuffs[1] "Spirit of Wolf|8"
/varset MyBuffs[2] "Chloroplast|6"
/varset MyBuffs[3] "Deftness|4"
/varset MyBuffs[4] "Furious Strength|4"
/varset MyBuffs[5] "Spiritual Radiance|3"
/varset MyBuffs[6] "Health|3"
/varset MyBuffs[7] "Frenzy|6"
|Buffs to be kept up on petf (max 15) - "Buff" or "Buff|GemSlot"
/declare PetBuffs[4] string outer
/varset PetBuffs[1] "Spirit of Wolf|8"
/varset PetBuffs[2] "Bond of the Wild|3"
/varset PetBuffs[3] "Spirit of the Storm|6"
/varset PetBuffs[4] "Deftness|4"
/if ( ${Param0.Equal["1"]}) {
/call MaintainSelfBuffs
/echo DONE BUFFING ME
}
/if ( ${Param0.Equal["2"]}) {
/call MaintainPetBuffs
/echo DONE BUFFING PET
}
/if ( ${Param0.Equal["3"]}) {
/call MaintainPetBuffs
/call MaintainSelfBuffs
/echo DONE BUFFING ALL
}
/if ( ${Param0.Equal["4"]}) {
/call HealMyself
/echo Done healing
}
/return
|----------------------------------------------------------------------------
|SUB: HealPet - Heal pet if needed
|----------------------------------------------------------------------------
Sub HealPet
|Heal pet?
/if ( ${Me.Pet.PctHPs}<HEAL_PET_BELOW_PCT ) {
/if ( ${Me.Pet.ID} ) {
/target ${Me.Pet.CleanName}
/call Cast "HEAL_PET_SPELL" gemHEAL_PET_GEM
/if ( !${Me.Sitting} ) /sit
/return 0
}
}
/return 1
|----------------------------------------------------------------------------
|SUB: HealMyself
|----------------------------------------------------------------------------
Sub HealMyself
|Heal?
/if ( ${Me.PctHPs}<HEAL_BELOW_PCT ) {
:AGAIN
/if ( !${Target.Name.Equal[${Me.Name}]} ) /target ${Me.Name}
/call Cast "HEAL_SPELL" gemHEAL_GEM
|/if ( !${Me.Sitting} ) /sit
|/keypress ESC
/delay 1
/if ( ${Me.PctHPs}<HEAL_BELOW_PCT ) /goto :AGAIN
/return 0
}
/return 1
|----------------------------------------------------------------------------
|SUB: MaintainPetBuffs - Heal pet and keep its buffs up
|----------------------------------------------------------------------------
Sub MaintainPetBuffs
/if ( !${Me.Pet.ID} ) {
/echo Creating new pet
/call Cast "PET_SPELL" gemPET_GEM
/return 0
}
|KeepUpBuffsOnPet
/declare iCount int local
/declare t string local
/for iCount 1 to ${PetBuffs.Size}
/call SplitString tmp_tmp ${PetBuffs[${iCount}]} "|"
/varset t ${Me.PetBuff[${tmp_tmp[1]}]}
/if ( ${t.Equal[NULL]} ) {
/if ( !${Target.ID}!=${Me.Pet.ID} ) {
/target ${Me.Pet.Name}
}
|Cast with gemselection or default
/if ( ${tmp_tmp.Size}>1 ) {
/call Cast "${tmp_tmp[1]}" gem${tmp_tmp[2]}
} else {
/call Cast "${tmp_tmp[1]}"
}
|/delay 5
|Return to top - so we dont keep buffing if being attacked
|/return 0
}
/next iCount
/return 1
|----------------------------------------------------------------------------
|SUB: MaintainSelfBuffs - Keep buffs up
|----------------------------------------------------------------------------
Sub MaintainSelfBuffs
|KeepUpBuffsOnMe
/declare iCount int local
/declare t string local
/for iCount 1 to ${MyBuffs.Size}
/call SplitString tmp_tmp ${MyBuffs[${iCount}]} "|"
/varset t ${Me.Buff[${tmp_tmp[1]}]}
/if ( ${t.Equal[NULL]} ) {
/if ( !${Target.ID}!=${Me.ID} ) {
/target ${Me.Name}
}
|Cast with gemselection or default
/if ( ${tmp_tmp.Size}>1 ) {
|/echo Cast "${tmp_tmp[1]}" gem${tmp_tmp[2]}
/call Cast "${tmp_tmp[1]}" gem${tmp_tmp[2]}
} else {
|/echo Cast "${tmp_tmp[1]}"
/call Cast "${tmp_tmp[1]}"
}
|/delay 5
|Return to top - so we dont keep buffing if being attacked
|/return 0
}
/next iCount
/return 1
|----------------------------------------------------------------------------
|SUB: SplitString - A generic string splitter.
|----------------------------------------------------------------------------
Sub SplitString(string varname, string inputstring, string splitter)
|A variable with name in varname will be declared and filled
/declare i int local
/declare i2 int local
/declare c int local
/declare stringcnt int local
/varcalc stringcnt ${inputstring.Count["|"]} + 1
/if (!${Defined[${varname}]}) {
/declare ${varname}[${stringcnt}] string global
} else {
/deletevar ${varname}
/declare ${varname}[${stringcnt}] string global
}
/varset c 1
:nextsubstring
/varcalc i ${inputstring.Find["${splitter}"]} - 1
|/echo ${inputstring}:${splitter} ${inputstring.Find["${splitter}"]}
/if ( ${i}>-1 ) {
|/echo iii: ${inputstring.Length} ${inputstring} ${i}
| /varcalc i2 ${inputstring.Length} - ${i} +1
/varcalc i2 ${inputstring.Length} - ${i} - 1
| /varcalc i2 ${inputstring.Length} - ${i} - 1 BUGFIX?????
/varset ${varname}[${c}] ${inputstring.Left[${i}]}
/varcalc c ${c} + 1
|/echo stringarray[${c}] ${inputstring.Left[${i}]}
/varset inputstring ${inputstring.Right[${i2}]}
/goto :nextsubstring
} else {
|/echo stringarray[${c}] ${inputstring}
/varset ${varname}[${c}] ${inputstring}
}
/return