- Joined
- Jun 7, 2007
- Messages
- 816
- Reaction score
- 3
- Points
- 18
In an effort to share with the community, here are some essential subs i wrote to help in my macros ...... enjoy .. feedback and not flames welcome.
These subs are used to determine the best haste / clarity / DS / heal potion you can use based on your level and what you have in inventory... and uses it.
It assumes you are using spell_routines.inc or mq2cast for the "/call cast" lines.
There are global declares that need to be made like "doCrackCheck" / "doDSCheck" .. etc.. that i use to call the subs within my macros... but this can easily be edited to remove that, however i suggest keeping these varset lines and declaring their variables globaly so you don't keep calling the subs if you don't have any potions on you.
example:
/declare doCrackCheck bool outer TRUE
/if (doCrackCheck) /call SelfClarityCheck
If you don't have any clerity potions at all on you, the varset line in the SelfClarityCheck sub will turn off any further checking for clarity potions.
These subs are used to determine the best haste / clarity / DS / heal potion you can use based on your level and what you have in inventory... and uses it.
It assumes you are using spell_routines.inc or mq2cast for the "/call cast" lines.
There are global declares that need to be made like "doCrackCheck" / "doDSCheck" .. etc.. that i use to call the subs within my macros... but this can easily be edited to remove that, however i suggest keeping these varset lines and declaring their variables globaly so you don't keep calling the subs if you don't have any potions on you.
example:
/declare doCrackCheck bool outer TRUE
/if (doCrackCheck) /call SelfClarityCheck
If you don't have any clerity potions at all on you, the varset line in the SelfClarityCheck sub will turn off any further checking for clarity potions.
Code:
|--------------------------------------------------------------------------------
|SUB: UseHealPotion
|--------------------------------------------------------------------------------
Sub UseHealPotion
/declare MyBestHealPotion string local
/declare LevelMark string local
/if (${Me.Level}>=1 && (${FindItem[Distillate of Divine Healing I].ID})) /varset LevelMark I
/if (${Me.Level}>=5 && (${FindItem[Distillate of Divine Healing II].ID})) /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Divine Healing III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Divine Healing IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Divine Healing V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Divine Healing VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Divine Healing VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Divine Healing VII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Divine Healing IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Divine Healing X].ID})) /varset LevelMark X
/if (${Me.Level}>=70 && (${FindItem[Distillate of Divine Healing XI].ID})) /varset LevelMark XI
/if (${Me.Level}>=75 && (${FindItem[Distillate of Divine Healing XII].ID})) /varset LevelMark XII
/if (${Me.Level}>=80 && (${FindItem[Distillate of Divine Healing XIII].ID})) /varset LevelMark XIII
/if (${Me.Level}>=85 && (${FindItem[Distillate of Divine Healing XIV].ID})) /varset LevelMark XIV
/varset MyBestHealPotion "Distillate of Divine Healing ${LevelMark}"
/echo Checking for self healing potions.
/if (${FindItem[${MyBestHealPotion}].ID}) {
/echo Using potion: ${MyBestHealPotion}
/call cast ${MyBestHealPotion} item
/if (${Cursor.ID}) /autoinventory
} else {
/echo I do not have any heal potions !
}
/doevents
/return
|--------------------------------------------------------------------------------
Code:
|--------------------------------------------------------------------------------
|SUB: UseHoTPotion
|--------------------------------------------------------------------------------
Sub UseHoTPotion
/declare MyBestHoTPotion string local
/declare LevelMark string local
/if (${Me.Level}>=1 && (${FindItem[Distillate of Celestial Healing I].ID})) /varset LevelMark I
/if (${Me.Level}>=5 && (${FindItem[Distillate of Celestial Healing II].ID})) /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Celestial Healing III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Celestial Healing IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Celestial Healing V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Celestial Healing VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Celestial Healing VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Celestial Healing VII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Celestial Healing IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Celestial Healing X].ID})) /varset LevelMark X
/if (${Me.Level}>=70 && (${FindItem[Distillate of Celestial Healing XI].ID})) /varset LevelMark XI
/if (${Me.Level}>=75 && (${FindItem[Distillate of Celestial Healing XII].ID})) /varset LevelMark XII
/if (${Me.Level}>=80 && (${FindItem[Distillate of Celestial Healing XIII].ID})) /varset LevelMark XIII
/if (${Me.Level}>=85 && (${FindItem[Distillate of Celestial Healing XIV].ID})) /varset LevelMark XIV
/varset MyBestHoTPotion "Distillate of Celestial Healing ${LevelMark}"
/echo Checking for self healing potions.
/if (${FindItem[${MyBestHoTPotion}].ID}) {
/echo Using potion: ${MyBestHoTPotion}
/call cast ${MyBestHoTPotion} item
/if (${Cursor.ID}) /autoinventory
} else {
/echo I do not have any HoT potions !
}
/doevents
/return
|--------------------------------------------------------------------------------
Code:
|--------------------------------------------------------------------------------
|SUB: SelfClarityCheck
|--------------------------------------------------------------------------------
Sub SelfClarityCheck
/declare MyBestClarityPotion string local
/declare LevelMark string local
/if (${Me.Level}>=1 && (${FindItem[Distillate of Clarity I].ID})) /varset LevelMark I
/if (${Me.Level}>=5 && (${FindItem[Distillate of Clarity II].ID})) /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Clarity III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Clarity IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Clarity V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Clarity VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Clarity VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Clarity VII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Clarity IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Clarity X].ID})) /varset LevelMark X
/if (${Me.Level}>=70 && (${FindItem[Distillate of Clarity XI].ID})) /varset LevelMark XI
/if (${Me.Level}>=75 && (${FindItem[Distillate of Clarity XII].ID})) /varset LevelMark XII
/if (${Me.Level}>=80 && (${FindItem[Distillate of Clarity XIII].ID})) /varset LevelMark XIII
/if (${Me.Level}>=85 && (${FindItem[Distillate of Clarity XIV].ID})) /varset LevelMark XIV
/varset MyBestClarityPotion "Distillate of Clarity ${LevelMark}"
/if (!${Me.Buff[Chaotica].ID} && !${Me.Buff[Koadic's Endless Intellect].ID} && !${Me.Buff[Tranquility].ID} && !${Me.Buff[Voice of Quellious].ID} && !${Me.Buff[Aura of Quellious].ID} && !${Me.Buff[Clairvoyance].ID} && !${Me.Buff[Voice of Clairvoyance].ID} && !${Me.Buff[Seer's Intuition].ID} && !${Me.Buff[Seer's Intuition Rk. II].ID} && !${Me.Buff[Seer's Intuition Rk. III].ID} && !${Me.Buff[Voice of Intuition].ID} && !${Me.Buff[Voice of Intuition Rk. II].ID} && !${Me.Buff[Voice of Intuition Rk. III].ID} && !${Me.Buff[Seer's Cognizance].ID} && !${Me.Buff[Seer's Cognizance Rk. II].ID} && !${Me.Buff[Seer's Cognizance Rk. III].ID} && !${Me.Buff[Voice of Cognizance].ID} && !${Me.Buff[Voice of Cognizance Rk. II].ID} && !${Me.Buff[Voice of Cognizance Rk. III].ID} && !${Me.Buff[Prescience].ID} && !${Me.Buff[Prescience Rk. II].ID} && !${Me.Buff[Prescience Rk. III].ID} && !${Me.Buff[Voice of Prescience].ID} && !${Me.Buff[Voice of Prescience Rk. II].ID} && !${Me.Buff[Voice of Prescience Rk. III].ID}) {
/if (!${Me.Buff[Elixir of Clarity ${LevelMark}].ID}) {
/echo I am without mind candy !
/echo Checking for self clarity potions.
/if (${FindItem[${MyBestClarityPotion}].ID}) {
/echo Using potion: (${MyBestClarityPotion})
/call cast ${MyBestClarityPotion} item
/if (${Cursor.ID}) /autoinventory
} else {
/echo I do not have any clarity potions !
/varset doCrackCheck FALSE
}
}
}
/doevents
/return
|--------------------------------------------------------------------------------
Code:
|--------------------------------------------------------------------------------
|SUB: SelfDSCheck
|--------------------------------------------------------------------------------
Sub SelfDSCheck
/declare MyBestDSPotion string local
/declare LevelMark string local
/if (${Me.Level}>=1 && (${FindItem[Distillate of Skinspikes I].ID})) /varset LevelMark I
/if (${Me.Level}>=5 && (${FindItem[Distillate of Skinspikes II].ID})) /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Skinspikes III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Skinspikes IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Skinspikes V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Skinspikes VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Skinspikes VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Skinspikes VII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Skinspikes IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Skinspikes X].ID})) /varset LevelMark X
/if (${Me.Level}>=70 && (${FindItem[Distillate of Skinspikes XI].ID})) /varset LevelMark XI
/if (${Me.Level}>=75 && (${FindItem[Distillate of Skinspikes XII].ID})) /varset LevelMark XII
/if (${Me.Level}>=80 && (${FindItem[Distillate of Skinspikes XIII].ID})) /varset LevelMark XIII
/if (${Me.Level}>=85 && (${FindItem[Distillate of Skinspikes XIV].ID})) /varset LevelMark XIV
/varset MyBestDSPotion "Distillate of Skinspikes ${LevelMark}"
/if (!${Me.Buff[Distillate of Skinspikes].ID}) {
/echo I am without DS !
/echo Checking for self DS potions.
/if (${FindItem[${MyBestDSPotion}].ID}) {
/echo Using potion: ${MyBestDSPotion}
/call cast ${MyBestDSPotion} item
/if (${Cursor.ID}) /autoinventory
} else {
/echo I do not have any DS potions !
/varset doDSCheck FALSE
}
}
/doevents
/return
|--------------------------------------------------------------------------------
Code:
|--------------------------------------------------------------------------------
|SUB: SelfHasteCheck
|--------------------------------------------------------------------------------
Sub SelfHasteCheck
/declare MyBestHastePotion string local
/declare LevelMark string local
/if (${Me.Level}>=1 && (${FindItem[Distillate of Alacrity I].ID})) /varset LevelMark I
/if (${Me.Level}>=5 && (${FindItem[Distillate of Alacrity II].ID})) /varset LevelMark II
/if (${Me.Level}>=10 && (${FindItem[Distillate of Alacrity III].ID})) /varset LevelMark III
/if (${Me.Level}>=20 && (${FindItem[Distillate of Alacrity IV].ID})) /varset LevelMark IV
/if (${Me.Level}>=30 && (${FindItem[Distillate of Alacrity V].ID})) /varset LevelMark V
/if (${Me.Level}>=40 && (${FindItem[Distillate of Alacrity VI].ID})) /varset LevelMark VI
/if (${Me.Level}>=50 && (${FindItem[Distillate of Alacrity VII].ID})) /varset LevelMark VII
/if (${Me.Level}>=55 && (${FindItem[Distillate of Alacrity VIII].ID})) /varset LevelMark VIII
/if (${Me.Level}>=60 && (${FindItem[Distillate of Alacrity IX].ID})) /varset LevelMark IX
/if (${Me.Level}>=65 && (${FindItem[Distillate of Alacrity X].ID})) /varset LevelMark X
/varset MyBestHastePotion "Distillate of Alacrity ${LevelMark}"
/if (!${Me.Buff[Celerity].ID} && !${Me.Buff[Swift Like the Wind].ID} && !${Me.Buff[Talisman of Celerity].ID} && !${Me.Buff[Swift Like the Wind].ID} && !${Me.Buff[Aanya's Quickening].ID} && !${Me.Buff[Wonderous Rapidity].ID} && !${Me.Buff[Visions of Grandeur].ID} && !${Me.Buff[Speed of the Brood].ID} && !${Me.Buff[Speed of Vallon].ID} && !${Me.Buff[Vallon's Quickening].ID} && !${Me.Buff[Speed of Salik].ID} && !${Me.Buff[Hastening of Salik].ID} && !${Me.Buff[Speed of Ellowind].ID} && !${Me.Buff[Speed of Ellowind Rk. II].ID} && !${Me.Buff[Speed of Ellowind Rk. III].ID} && !${Me.Buff[Hastening of Ellowind].ID} && !${Me.Buff[Hastening of Ellowind Rk. II].ID} && !${Me.Buff[Hastening of Ellowind Rk. III].ID} && !${Me.Buff[Speed of Erradien].ID} && !${Me.Buff[Speed of Erradien Rk. II].ID} && !${Me.Buff[Speed of Erradien Rk. III].ID} && !${Me.Buff[Hastening of Erradien].ID} && !${Me.Buff[Hastening of Erradien Rk. II].ID} && !${Me.Buff[Hastening of Erradien Rk. III].ID}) {
/if (!${Me.Buff[Elixir of Speed ${LevelMark}].ID}) {
/echo I am without haste !
/echo Checking for self haste potions.
/if (${FindItem[${MyBestHastePotion}].ID}) {
/echo Using potion: ${MyBestHastePotion}
/call cast ${MyBestHastePotion} item
/if (${Cursor.ID}) /autoinventory
} else {
/echo I do not have any haste potions !
/varset doHasteCheck FALSE
}
}
}
/doevents
/return
|--------------------------------------------------------------------------------