Incorporating Spell_Routines.inc into a macro

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Ski
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Aug 17, 2005 5:16 pm

Incorporating Spell_Routines.inc into a macro

Post by Ski » Wed Aug 17, 2005 6:22 pm

Ok I am new to this stuff and know very little , BUT I followed all the directions in wiki. lol
My page needs reviewing.

http://www.macroquest2.com/wiki/index.php/Macro_Help

I put an explanation that I THOUGHT was right but I dont know lol, but the wiki post was informative (maybe) not inquisitive.

Ok heres my question. When adding a Spell_Routine.inc to any macro How is it exactly done.

I tried saving a Spell_Routine.inc to my macro folder. I named it Spell_Routine.inc
The cleric mac Im trying to use keeps saying unable to open Spell_Routine.inc in my macro folder.
Any help would be appreciated. If I did this process wrong please let me know. I spent a good 1.5 hours trying to do it correctly to not piss anyone off.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Aug 17, 2005 6:27 pm

#include Spell_Routines.inc

does not work with Spell_Routine.inc.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

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 » Thu Aug 18, 2005 7:07 am

If the file is named spell_routine.inc, then the #include should also be spell_routine.inc. If you're using something like AFCleric, then it's probably looking for spell_routines.inc, which doesn't exist if you named it spell_routine.inc.
[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]

User avatar
pinkfloydx33
a ghoul
a ghoul
Posts: 140
Joined: Sat Jun 19, 2004 1:16 pm

Post by pinkfloydx33 » Thu Aug 18, 2005 10:26 am

Information on the #include command is available here: [[Pound_Commands]]

paulstacio
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Jul 23, 2006 6:10 pm
Location: Oklahoma
Contact:

I have simmular question about spell_routines.ini

Post by paulstacio » Mon Jul 31, 2006 9:55 am

My question is what do i have to do to this file to get it to work. what values do i need to include and where. this calls for /call cast, /call equipitem , /call swap item etc. what do i have to do to talor this with my spells , aa's, epics, items etc

I am unsure it i have to go through and place a spell in each slot that says {"spellname"} item, AA etc or make another subrutine IE. Spells {"spellname"}="complete healing"
spellname2=Prious remedy
spellname3=Prious Elixor etc. continueing till all spells in my spell book are ascoated with a code

or do i have to go through and replace "spellname" with the name of the spell. I know this is problly trivial to you but I no nuthing about macros and have very basic computer knowledge. Rusty did a great job on this I know and made it so it can work on probly any macro but i need help in getting it to work on afcleric.mac . thake the asumption I have no clue and help me fill in my blanks or at least point me in a direction that I can do it my self. I includer the spell_rutines.inc for referance

:| spell_routines.inc
|
| Written by Rusty~
| Last Modified 11/07/2004
|
| Features:
| - Casts spells, clicks items, or uses AA abilities for you
| - Allows back to back casting without waiting on spell gems to pop all the way up
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left
| is greater than 7 seconds, else it will move forward a bit to interrupt, then move you back
| ** IMPORTANT: if you don't want to interrupt a spell while mounted, put this at the top of your macro: **
| ** /declare noInterrupt int outer 1 **
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0)
| If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED
| - Lets you call a custom subroutine while waiting for spell to finish casting
| Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true
| - This file also includes a sub named Interrupt. You can call this to interrupt any spell you're casting instantly.
| - You can also use the SwapItem sub included in this to swap items to certain slots
| - Added EquipItem sub to easily equip items in your main Inventory slots.
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top:
| /declare noInvis int outer 1
| This will make it return CAST_INVIS if you're invis
|
| Below is a list of outer scope variables you can access in your macros:
| refreshTime - How much time is left till you're done recovering from casting
| castEndTime - How much time left till you're done casting the current spell... usable in custom spell Subs
| spellNotHold - 1 if your last spell didn't take hold, 0 otherwise
| spellRecastTime1-9 - How much time left till that spell is back up
|
|======================================================================================================================
| EquipItem: An easier way to equip items you have in bags ( useful for weapons or focus items )
| slot name is optional. If not given, it will equip it in the first possible spot
|
| Usage:
| /call EquipItem "item name|slotname"
|
| Returns: "old item name|slotname"
| Examples:
|
| To Equip Sharp Ended Broken Lever when you have Serpent of Vindication equiped:
| /call EquipItem "Sharp Ended Broken Lever"
| It will return "Staff of Vindication|mainhand"
| To reequip the original item, you can save the return in a variable, and then use it later like this:
| /varset oldPrimary ${Macro.Return}
| | ... do stuff here with your new item equiped
| /call EquipItem ${oldPrimary}
|
|======================================================================================================================
| SwapItem: a subroutine which is used in the Cast sub itself. You don't need to do this to cast an item in a bag
| but you can call it in your macro to SwapItems (such as weapons or focus items)
| Usage:
| /call SwapItem "item name" slotname|slotID
| Examples:
|
| To swap Darkblade of the Warlord to your main hand:
| /call SwapItem "Darkblade of the Warlord" mainhand
|
| To swap stat food in one bag with other food in another bag:
| /call SwapItem "Bristlebanes Party Platter" ${FindItem[halas 10lb meat pie].InvSlot}
|
|======================================================================================================================
| Cast: the main subroutine that casts spells or items for you
| Usage:
| /call Cast "spellname|itemname|AAname|AA#" [item|alt|gem#] [give up time][s|m] [custom subroutine name]
| Examples:
|
| To cast Howl of Tashan and mem it in slot 3 if not memmed:
| /call Cast "Howl of Tashan" gem3
|
| To cast Arcane Rune and keep trying for 7 seconds, in case of interrupts.
| /call Cast "Arcane Rune" gem5 7s
|
| To click Grim Aura earring that's in a bag:
| /call Cast "Shrunken Goblin Skull Earring" item
|
| To use AA ability Eldritch Rune:
| /call Cast "Eldritch Rune" alt
| or
| /call Cast "173" alt
|
| To call a subroutine that interrupts CH if target gets healed before it lands:
| /call Cast "Complete Healing" gem1 0 CheckHP
| Then in your macro have somewhere:
| Sub CheckHP
| /if ( ${Target.PctHPs}>=80 ) /call Interrupt
| /return
|
| Returns these values:
|----------------------+----------------------------------------------------------------------+
| CAST_CANCELLED | Spell was cancelled by ducking (either manually or because mob died) |
| CAST_CANNOTSEE | You can't see your target |
| CAST_IMMUNE | Target is immune to this spell |
| CAST_INTERRUPTED | Casting was interrupted and exceeded the given time limit |
| CAST_INVIS | You were invis, and noInvis is set to true |
| CAST_NOTARGET | You don't have a target selected for this spell |
| CAST_NOTMEMMED | Spell is not memmed and you gem to mem was not specified |
| CAST_NOTREADY | AA ability or spell is not ready yet |
| CAST_OUTOFMANA | You don't have enough mana for this spell! |
| CAST_OUTOFRANGE | Target is out of range |
| CAST_RESISTED | Your spell was resisted! |
| CAST_SUCCESS | Your spell was cast successfully! (yay) |
| CAST_UNKNOWNSPELL | Spell/Item/Ability was not found |
|----------------------+----------------------------------------------------------------------+

#event BeginCast "You begin casting#*#"
#event Collapse "Your gate is too unstable, and collapses.#*#"
#event FDFail "#1# has fallen to the ground.#*#"
#event Fizzle "Your spell fizzles#*#"
#event Immune "Your target is immune to changes in its attack speed#*#"
#event Immune "Your target is immune to changes in its run speed#*#"
#event Immune "Your target cannot be mesmerized#*#"
#event Interrupt "Your casting has been interrupted#*#"
#event Interrupt "Your spell is interrupted#*#"
#event NoHold "Your spell did not take hold#*#"
#event NoLOS "You cannot see your target.#*#"
#event NoTarget "You must first select a target for this spell!#*#"
#event NotReady "Spell recast time not yet met.#*#"
#event OutOfMana "Insufficient Mana to cast this spell!#*#"
#event OutOfRange "Your target is out of range, get closer!#*#"
#event Recover "You haven't recovered yet...#*#"
#event Recover "Spell recovery time not yet met#*#"
#event Resisted "Your target resisted the #1# spell#*#"
#event Resisted2 "You resist the #1# spell#*#"
#event Standing "You must be standing to cast a spell#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"


Sub Cast(string spellName,string spellType,timer giveUpTimer,string mySub)
/declare castTime float local
/if ( ${spellType.Equal[item]} ) {
/varset castTime ${FindItem[${spellName}].CastTime}
} else /if ( ${spellType.Equal[alt]} ) {
/varset castTime ${AltAbility[${spellName}].Spell.MyCastTime}
} else {
/varset castTime ${Spell[${spellName}].MyCastTime}
}
/if ( ${Me.Invis} && ${noInvis} ) {
/return
}
:wait_for_stop
/if ( !${Defined[spellType]} ) /declare spellType string local spell
/if ( ${Me.Casting.ID} ) {
/if ( ${Defined[mySub]} ) /call ${mySub}
/goto :wait_for_stop
}
/if ( ${Me.Speed} ) {
:wait_for_stop2
/if ( ${Defined[mySub]} ) /call ${mySub}
/if ( ${Me.Moving} && ${castTime}>0.1 ) /goto :wait_for_stop2
}
/if ( !${Defined[giveUpTimer]} ) /declare giveUpTimer timer local 0
/if ( !${Defined[spellRecastTime1]} ) {
/if ( !${Defined[noInterrupt]} ) /declare noInterrupt int outer 0
/declare moveBack bool outer false
/declare selfResist int outer
/declare selfResistSpell string outer
/declare castEndTime timer outer
/declare refreshTime timer outer 0
/declare itemRefreshTime float outer 0
/declare startCastingLoc string outer
/declare i int local
/declare castReturn string outer
/declare spellNotHold string outer
/delay 5
/for i 1 to 9
/declare spellRecastTime${i} timer outer
/if ( ${Me.SpellReady[${i}]} ) {
/varset spellRecastTime${i} 0
} else {
/varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
}
/next i
}
/varset spellNotHold 0
/varset selfResist 0
/declare delayTime timer local
/declare swapItemBack bool local false
/declare slotName int local
/declare oldItemName string local
/declare slotID int local
/declare oldSlotID int local
/declare spellID int local
/declare charges int local

/if ( ${Window[SpellBookWnd].Open} ) /keypress spellbook
/if ( ${Me.Ducking} ) /keypress duck
/if ( !${Me.Standing} ) /stand

/doevents Recover
/doevents BeginCast
/doevents Fizzle
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents Collapse
/doevents NoTarget
/doevents NotReady
/varset castReturn CAST_SUCCESS

/if ( ${spellType.Equal[item]} ) /goto :cast_item
/if ( ${spellType.Equal[alt]} ) /goto :cast_alt

:cast_spell
/if ( !${Int[${Me.Book[${spellName}]}]} ) {
/echo Spell: "${spellName}" was not found in your book
/return CAST_UNKNOWNSPELL
}
/if ( !${Me.Gem[${spellName}]} ) {
:mem_spell
/if ( ${Cursor.ID} ) {
/autoinventory
/delay 5
/goto :mem_spell
}
/if ( ${spellType.Left[3].Equal[gem]} ) {
/memspell ${spellType.Right[1]} "${spellName}"
} else {
/return CAST_NOTMEMMED
}
/delay 6s ${Me.Gem[${spellName}]}
/if ( !${Me.Gem[${spellName}]} ) {
/echo Spell mem interrupted...
/return CAST_INTERRUPTED
}
:wait_for_mem

/delay 15s ${Me.SpellReady[${spellName}]}
/if ( !${Me.SpellReady[${spellName}]} ) {
/if ( ${giveUpTimer} ) /goto :wait_for_mem
/return CAST_NOTREADY
}
}
/varset spellType spell
/if ( ${spellName.Find[illusion: ]} && ${Me.AltAbilityReady[project illusion]} ) /call Cast "project illusion" alt

/varset giveUpTimer ${giveUpTimer.OriginalValue}
/declare recoverWaitTime timer local 30

:cast_spell_loop
:wait_for_spell
/if ( ${Me.SpellReady[${spellName}]} ) {
/varset spellRecastTime${Me.Gem[${spellName}]} 0
/goto :skip_delay
}
/if ( ${spellRecastTime${Me.Gem[${spellName}]}} ) {
/if ( !${giveUpTimer} ) /return CAST_NOTREADY
/if ( ${Defined[mySub]} ) /call ${mySub}
/goto :wait_for_spell
}
/if ( !${refreshTime} ) /goto :skip_delay
:wait_on_refresh
/if ( ${Me.SpellReady[${spellName}]} ) /varset refreshTime 0
/if ( ${refreshTime}>0 ) {
/if ( ${Defined[mySub]} ) /call ${mySub}
/goto :wait_on_refresh
}
/varcalc delayTime 10*(1.5-${Spell[${spellName}].MyCastTime})
:cast_delay_loop
/if ( ${delayTime}>0 ) {
/if ( ${Defined[mySub]} ) /call ${mySub}
/goto :cast_delay_loop
}
:skip_delay
/varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
/cast "${spellName}"

/if ( ${Me.Casting.ID} ) {
/varset spellID ${Me.Casting.ID}
/varcalc castEndTime ${Me.Casting.MyCastTime}*10
/if ( ${castEndTime}<${Math.Calc[${Me.Casting.CastTime}*5]} ) /varcalc castEndTime ${Me.Casting.CastTime}*5
/echo Casting: ${Me.Casting.Name}${If[!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
}

/varset moveBack false

/call WaitCast ${mySub}

/if ( ${moveBack} ) {
/keypress back hold
/delay 4
/keypress back
/delay 15 !${Me.Moving}
}

/if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
/echo Spell was cancelled...
/return CAST_CANCELLED
}

/doevents Recover
/doevents BeginCast
/doevents Fizzle
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents Collapse
/doevents NoTarget
/doevents NotReady

/if ( !${spellID} ) /varset spellID ${Spell[${spellName}].ID}
/if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
/if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
/if ( ${castReturn.Equal[CAST_FIZZLE]} ) {
/echo Spell Fizzled. Recasting...
/goto :cast_spell_loop
}
/if ( ${castReturn.Equal[CAST_RECOVER]} ) {
/if ( !${recoverWaitTime} ) {
/varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
/if ( !${giveUpTimer} ) /return CAST_NOTREADY
}
/goto :cast_spell_loop
}
/if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_spell_loop
/if ( ${castReturn.Equal[CAST_STUNNED]} ) {
/if ( ${Me.Stunned} ) {
/delay 3s !${Me.Stunned}
} else {
/delay 7
}
/goto :cast_spell_loop
}
/if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
/if ( ${giveUpTimer} ) {
/echo Spell was interrupted. Recasting...
/goto :cast_spell_loop
}
/echo Spell was interrupted...
/return CAST_INTERRUPTED
}
}
/if ( !${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} ) {
/varcalc refreshTime 10*${Spell[${spellID}].RecoveryTime}
/varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
}
/if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
/varset giveUpTimer 200
/goto :cast_spell_loop
}
/return ${castReturn}


:cast_item
/if ( !${FindItem[${spellName}].InvSlot} ) {
/echo Cannot find item: ${spellName}
/return CAST_UNKNOWNSPELL
}
/if ( ${FindItem[${spellName}].InvSlot}>21 ) {
/varset swapItemBack true
/if ( ${FindItem[${spellName}].WornSlot[1]} && ${FindItem[${spellName}].EffectType.Find[worn]} ) {
/varset slotName ${FindItem[${spellName}].WornSlot[1]}
} else /if ( ${FindItem[${spellName}].InvSlot}>29 ) {
/varset slotName 29
} else {
/varset slotName ${FindItem[${spellName}].InvSlot}
}
/varset slotID ${InvSlot[${slotName}].ID}
/varset oldSlotID ${FindItem[${spellName}].InvSlot.ID}
/varset oldItemName ${InvSlot[${slotID}].Item.Name}
/call SwapItem "${spellName}" ${slotID}
}
:cast_item_loop
:wait_item_loop
/if ( ${itemRefreshTime} > ${MacroQuest.Running} ) {
/delay 1
/goto :wait_item_loop
}
/varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+000]}
/varset charges ${FindItem[${spellName}].Charges}
/varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
/cast item "${spellName}"
/if ( ${Me.Casting.ID} ) {
/varcalc castEndTime ${FindItem[${spellName}].CastTime}*10
/echo Casting: ${FindItem[${spellName}].Spell.Name}${If[!${FindItem[${spellName}].Spell.TargetType.Equal[PB AE]} && !${FindItem[${spellName}].Spell.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
}
/if ( ${charges}>0 ) /delay 1s ${FindItem[${spellName}].Charges}!=${charges}

/call WaitCast ${mySub}

/if ( ${swapItemBack} ) {
/if ( ${FindItem[${spellName}].ID} ) {
/call SwapItem "${spellName}" ${oldSlotID}
} else /if ( ${FindItem[${oldItemName}].ID} ) {
/call SwapItem "${oldItemName}" ${slotID}
}
/if ( ${Cursor.Container} ) /autoinventory
}

/if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
/echo Spell was cancelled...
/return CAST_CANCELLED
}

/doevents BeginCast
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents Collapse
/doevents NoTarget
/doevents NotReady

/if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
/if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
/if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_item
/if ( ${castReturn.Equal[CAST_STUNNED]} ) {
/if ( ${Me.Stunned} ) {
/delay 3s !${Me.Stunned}
} else {
/delay 7
}
/goto :cast_item
}
/if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
/if ( ${giveUpTimer} ) {
/echo Spell was interrupted. Recasting...
/goto :cast_item
}
/echo Spell was interrupted...
/return CAST_INTERRUPTED
}
}
/if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
/varset giveUpTimer 200
/goto :cast_item
}
/return ${castReturn}


:cast_alt
/if ( !${Me.AltAbilityReady[${spellName}]} ) /return CAST_NOTREADY
/echo Using AA Ability: ${AltAbility[${spellName}].Name}
/alt activate ${AltAbility[${spellName}].ID}
/if ( ${AltAbility[${spellName}].Spell.MyCastTime}>=0.5 ) /delay 1s ${Me.Casting.ID}
/call WaitCast ${mySub}

/if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
/echo Spell was cancelled...
/return CAST_CANCELLED
}

/doevents BeginCast
/doevents Interrupt
/doevents Standing
/doevents FDFail
/doevents OutOfRange
/doevents NoLOS
/doevents Resisted2
/doevents Resisted
/doevents Immune
/doevents Stunned
/doevents NoTarget

/if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
/if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_alt
/if ( ${castReturn.Equal[CAST_STUNNED]} ) {
/if ( ${Me.Stunned} ) {
/delay 3s !${Me.Stunned}
} else {
/delay 7
}
/goto :cast_alt
}
/if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
/if ( ${giveUpTimer} ) {
/echo Spell was interrupted. Recasting...
/goto :cast_alt
}
/echo Spell was interrupted...
/return CAST_INTERRUPTED
}
}
/return ${castReturn}


Sub EquipItem(string WhatWhere)
/declare DestName string local
/declare ItemName string local ${String[${WhatWhere}].Arg[1,|]}
/declare SlotName string local ${String[${WhatWhere}].Arg[2,|]}
/if (${SlotName.Equal[NULL]}) /varset SlotName ${InvSlot[${FindItem[=${ItemName}].WornSlot[1]}].Name}
/if (${FindItem[=${ItemName}].InvSlot}<22 || !${FindItem[=${ItemName}].WornSlot[${SlotName}]}) /return
/if (!${InvSlot[${SlotName}].Item.Name.Equal[NULL]}) /varset DestName "${InvSlot[${SlotName}].Item.Name}|${SlotName}"
/call SwapItem "${ItemName}" "${SlotName}"
/return ${DestName}

| Sub EquipItem(string itemName,string slotName)
/if ( !${Defined[slotName]} ) /declare slotName string local ${FindItem[${itemName}].WornSlot[1]}
/declare oldItem string local ${Me.Inventory[${slotName}].Name}
/call SwapItem "${itemName}" ${slotName}
/return "${oldItem}" ${slotName}

Sub SwapItem(string itemName,string slotName)
/if ( ${InvSlot[${slotName}].Item.Name.Equal[${itemName}]} ) /return
/declare slotID int local
/declare oldSlotID int local
/declare oldItem string local
/declare i int local
/varset slotID ${InvSlot[${slotName}].ID} | slotID = slot you're swapping item to
/varset oldSlotID ${FindItem[${itemName}].InvSlot.ID} | oldSlotID = slot the item was originally in
/varset oldItem ${InvSlot[${slotName}].Item.Name} | oldItem = name of item in the slot you're swapping WITH
/if ( !${slotID} ) {
/echo Invalid slot name: ${slotName}
/return
}
/if ( !${oldSlotID} ) {
/echo Could not find item ${itemName}
/return
}
:auto_inv
/if ( ${Cursor.ID} && !${Cursor.Name.Equal[${itemName}]} ) {
/if ( ${Cursor.Container} ) {
/for i 1 to 8
/if ( !${InvSlot[pack${i}].Item.Container} ) {
/nomodkey /itemnotify pack${i} leftmouseup
}
/next i
} else {
/autoinventory
}
/goto :auto_inv
}


:pick_up_item
| if the item is in a bag and it's not open, then open it!
/if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup

| if the slot you're putting it in is inside a bag and it's not open, then open it!
/if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

| ok.. pick up the item now!
/squelch /nomodkey /shiftkey /itemnotify ${InvSlot[${oldSlotID}]} leftmouseup

| if item isn't on your cursor, try again!
/if ( !${Cursor.Name.Equal[${itemName}]} ) {
/if ( ${Cursor.ID} && !${Cursor.Container} ) /autoinventory
/goto :pick_up_item
}
:exchange_items
/if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
/if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

| put the item in the new slot, and pick up whatever item was there
/squelch /nomodkey /shiftkey /itemnotify ${slotID} leftmouseup

| if it didnt get exchanged, try again!
/if ( ${Cursor.ID} && !${Cursor.Name.Equal[${oldItem}]} && !${Cursor.Name.Equal[${itemName}]} && !${Cursor.Container} ) /autoinventory
/if ( !${InvSlot[${slotID}].Item.Name.Equal[${itemName}]} ) /goto :exchange_items
:drop_item
/if ( !${Cursor.Container} || ( ${InvSlot[${oldSlotID}]}<30 && ${InvSlot[${oldSlotID}]}>=22 ) ) {
/if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
/if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
/squelch /nomodkey /itemnotify ${oldSlotID} leftmouseup
/if ( ${Cursor.ID} ) {
/if ( !${Cursor.Name.Equal[${oldItem}]} ) /autoinventory
/goto :drop_item
}
}
:close_pack
/if ( ${InvSlot[${oldSlotID}].Pack} && ${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
/squelch /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
/goto :close_pack
}
/if ( ${InvSlot[${slotID}].Pack} && ${Window[${InvSlot[${slotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
/squelch /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
/goto :close_pack
}
/return

Sub Interrupt
/if ( ${Me.Mount.ID} ) /dismount
/stopcast
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANCELLED
/return ${Macro.Return}


Sub WaitCast(string mySub)
/declare currentTarget int local ${Target.ID}
/declare currentTargetType string local ${Target.Type}
:wait_cast_loop
/if ( ${Bool[${mySub}]} ) /call ${mySub}
/if ( ${Me.Casting.ID} ) {
/if ( ${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]} ) {
/if ( !${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} && ( !${Me.Mount.ID} || !${noInterrupt} ) ) {
/if ( !${Me.Mount.ID} || ${castEndTime}>70 ) {
/call Interrupt
} else /if ( ${Me.Casting.RecastTime}>3 ) {
/varset castReturn CAST_CANCELLED
/keypress forward hold
/delay 6
/keypress forward
/varset moveBack true
}
}
}
/if ( ${Me.State.Equal[DUCK]} ) /varset castReturn CAST_CANCELLED
/delay 1
/goto :wait_cast_loop
}
/return

Sub Event_Fizzle
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_FIZZLE
/return

Sub Event_Resisted(string line,string name)
/if ( ${selfResist} && ${name.Equal[${selfResistSpell}]} ) {
/varset selfResist 0
/return
}
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESISTED
/return

Sub Event_Resisted2(string line,string name)
/if ( ${Defined[selfResist]} ) {
/varset selfResist 1
/varset selfResistSpell ${name}
}
/return

Sub Event_Interrupt
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_INTERRUPTED
/return

Sub Event_Recover
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_RECOVER
/return

Sub Event_Immune
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_IMMUNE
/return

Sub Event_Stunned
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_STUNNED
/return

Sub Event_NoLOS
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANNOTSEE
/return

Sub Event_Standing
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESTART
/return

Sub Event_Collapse
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_COLLAPSE
/return

Sub Event_OutOfMana
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFMANA
/return

Sub Event_OutOfRange
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFRANGE
/return

Sub Event_NoTarget
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTARGET
/return

Sub Event_NotReady
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTREADY
/return

Sub Event_NoHold
/if ( ${Defined[spellNotHold]} ) /varset spellNotHold 1
/return

Sub Event_BeginCast
/if ( ${Defined[castReturn]} ) /varset castReturn CAST_SUCCESS
/return

Sub Event_FDFail(string line,string name)
/if ( ${name.Equal[${Me.Name}]} && ${Defined[castReturn]} ) {
/if ( !${Me.Standing} ) /stand
/varset castReturn CAST_RESTART
}
/return

Yunto?
a grimling bloodguard
a grimling bloodguard
Posts: 502
Joined: Sat Nov 19, 2005 12:05 pm

Re: I have simmular question about spell_routines.ini

Post by Yunto? » Mon Jul 31, 2006 10:24 am

paulstacio wrote:My question is what do i have to do to this file to get it to work. what values do i need to include and where. this calls for /call cast, /call equipitem , /call swap item etc. what do i have to do to talor this with my spells , aa's, epics, items etc
Its not a macro. Its an include file.

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Mon Jul 31, 2006 2:37 pm

be nice if you used code brackets
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

User avatar
A_Enchanter_00
a snow griffon
a snow griffon
Posts: 473
Joined: Mon Dec 12, 2005 4:37 pm
Location: A server near you

Post by A_Enchanter_00 » Mon Jul 31, 2006 3:29 pm

as wiki tells you.

Code: Select all

#include spell_routines.inc
Sub Main
  /call Cast "Complete Healing" gem1
/return
A_Enchanter_00

Author of:
MQ2AdvPath / ISXEQAdvPath
MQ2Cast ( Author also s0rcier )
MQ2CastTimer
MQ2VoiceCommand

[quote]
If you like my work and want to give somthing back, just click [url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=aenchanter00%40gmail%2ecom&item_name=A_Enchanter_00&no_shipping=2&no_note=1&tax=0&currency_code=USD&lc=DK&bn=PP%2dDonationsBF&charset=UTF%2d8][color=green]HERE[/color][/url] to use PAYPAL.
[/quote]

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Mon Jul 31, 2006 4:07 pm

the top 1/4 of the spell_routine ini tells you HOW to use it, gives you detailed examples of every possible way to use it.

drzoon
a hill giant
a hill giant
Posts: 239
Joined: Tue May 04, 2004 5:38 pm

Post by drzoon » Mon Jul 31, 2006 4:56 pm

I've updated the wiki page ([[Spell_Routines.inc]]) with some instructions (mostly just those that are at the top of the file itself, formatted a bit better).

paulstacio
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Jul 23, 2006 6:10 pm
Location: Oklahoma
Contact:

Post by paulstacio » Mon Jul 31, 2006 5:22 pm

Thanks thats simple enough even I understand it :D

paulstacio
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Jul 23, 2006 6:10 pm
Location: Oklahoma
Contact:

Post by paulstacio » Mon Jul 31, 2006 8:36 pm

I changed AFCleric.mac a bit to include my cleric epic 1.5 Harmony of the Soul do you think this will work. Thanks :shock:


#include spell_routines.inc
#include ChatParse.inc
|#include mokaddon.inc

#Event IRCchat "<#1#> #2#"
#Chat Chat
#Chat tell
#chat group

Sub Main

|------------READ THIS SECTION AND EDIT IF NEEDED-----------|

/declare mychannel string outer ChangeMeLine13
/declare usegroupchat int outer 0
/declare useircchat int outer 0
/declare autohealmode int outer 3
/declare healspell string outer Complete Healing
/declare healspellrange int outer 100
/declare patchheal string outer Pious Remedy
/declare patchhealrange int outer 200
/declare hotspell string outer Pious Elixir
/declare hotspellrange int outer 100
/declare daspell string outer Divine Barrier
/declare yaulpspell string outer Yaulp VII
/declare usegroupheal int outer 1
/declare groupheal string outer Word of Vivification
/declare grouphealrange int outer 70
/declare announce int outer 1
/declare autosit int outer 1
/declare distancetosit int outer 40
/declare autointerrupt int outer 1
/declare onlyhealfd int outer 1
/declare interrupt2healself int outer 1
/declare interrupt2healselfhp int outer 50
/declare noInvis int outer 1
/declare defaultstophealpoint int outer 80
/declare acbuff string outer Ward of Valiance
/declare longhpbuff string outer Conviction
/declare singlesymbuff string outer Symbol of Balikor
/declare groupsymbuff string outer Balikor's Mark
/declare spellhastebuff string outer Blessing of Devotion
/declare groupspellhastebuff string outer Aura of Devotion
/declare rgcspell string outer Remove Greater Curse
/declare healpetmode int outer 2
/declare pethealpoint int outer 65
/declare manatohealpet int outer 25
/declare pethealspell string outer Complete Healing
/declare pethealspellrange int outer 100
/declare nukeone string outer Ancient Pious Conscience
/declare nuketwo string outer Reproach
/declare stunone string outer Sound of Divinity
/declare stuntwo string outer Shock of Wonder
| /declare mokaddon int outer 1
/declare harmsoul string outer harmony of the Soul outer 25
|** Tweak Heals Here - tankhealpoint is for War/Pal/SK other
than MT, casterhotpoint and casterpatchpoint refer to
wiz/mag/enc/dru, necshmpatchpoint refers to necros and
shamans, defaultpatchpoint refers to all other classes. **|

/declare selfhealpoint int outer 70
/declare dacastpoint int outer 29
/declare tankhealpoint int outer 65
/declare casterhotpoint int outer 85
/declare casterpatchpoint int outer 60
/declare necshmpatchpoint int outer 50
/declare defaultpatchpoint int outer 70
/declare healpotpoint int outer 15

|**---------------Divine Arbitration Config-----------------|
Fine tune div arb interruptions. interrupt2divarb is the
threshold for interrupting other spells for target/self HP
dropping below divarbpoint. interrupt2divarb is in 1/10th
seconds, so if 16 is used, spells with more than 1.6 seconds
left would be interrupted if divarbpoint HP is reached. **|
/declare usedivarb int outer 1
/declare divarbpoint int outer 25
/declare healafterdivarb int outer 1
/declare interrupt2divarb int outer 14

|**-----------------Harmony of the Soul Config--------------|
Fine tune Harm Soul interruptions. interrupt2harmsoul is the
threshold for interrupting other spells for target/self HP
dropping below divarbpoint. interrupt2harmsoul is in 1/10th
seconds, so if 08 is used, spells with more than 0.8 seconds
left would be interrupted if harmsoul HP is reached. **|
/declare useharmsoul int outer 1
/declare harmsoulpoint int outer 25
/declare healafterharmsoul int outer 1
/declare interrupt2harmsoul int outer 14


|**---------------------TrickyDA Config---------------------|
The following are HP buffs cleric will click off, in order,
to get above 40% HP and avoid low HP aggro. Clr will then
click off DA and resume duties, beg new buffs, etc. To
enable, set trickyda to 1, 0 will disable **|

/declare trickyda int outer 1
/if (${trickyda}==1) {
/declare intcount int outer 0
/declare trickybuff[20] string outer
/varset trickybuff[1] Virtue
/varset trickybuff[2] Hand of Virtue
/varset trickybuff[3] Conviction
/varset trickybuff[4] Hand of Conviction
/varset trickybuff[5] Focus of Soul
/varset trickybuff[6] Focus of the Seventh
/varset trickybuff[7] Wunshi's Focusing
/varset trickybuff[8] Talisman of Wunshi
/varset trickybuff[9] Protection of the 9
/varset trickybuff[10] Blessing of the Nine
/varset trickybuff[11] Steeloak Skin
/varset trickybuff[12] Blessing of Steeloak
/varset trickybuff[13] Symbol of Kazad
/varset trickybuff[14] Kazad`s Mark
/varset trickybuff[15] Symbol of Balikor
/varset trickybuff[16] Balikor's Mark
/varset trickybuff[17] Brell's Stalwart Shield
/varset trickybuff[18] Brell's Brawny Bulwark
/varset trickybuff[19] Spiritual Vigor
/varset trickybuff[20] Spiritual Vitality
}
|-------------------End TrickyDA Config---------------------|



|------------------------END EDITING------------------------|

/declare healpct int outer 70
/declare tankname string outer ${Target}
/declare tanknameid int outer
/declare tankclass string outer
/declare minorhurt int outer 0
/declare majorhurt int outer 0
/declare worsthurt string outer NULL
/declare worsthurtid int outer
/declare worsthp int outer 100
/declare worstclass string outer NULL
/declare gmember int outer
/declare nohotforua string outer NULL
/declare nohotforub string outer NULL
/declare nohotforuc string outer NULL
/declare nohotforud string outer NULL
/declare rodwait int outer 0
/declare following int outer 0
/declare follname string outer NULL
/declare pallycount int outer 0
/declare stophealpoint int outer ${defaultstophealpoint}
/declare buffbeg int outer 0
/declare oomspam int outer 1
/declare lomspam int outer 1
/declare duckspam int outer 1
/declare duckfdspam int outer 1
/declare duckselfspam int outer 1
/declare nomtspam int outer 1
/declare ghealhurtcount int outer 0
/declare divarboor int outer 0
/declare aetime int outer 0
/declare manastonecycle int outer 0
/declare olditem string outer
/declare oldprimary string outer

/if (${useircchat}==0) /join ${mychannel}
/if (${useircchat}==1) {
/iconnect 192.168.0.1 6667 #${mychannel} ${Me}
/i nick ${Me}
/timed 50 /i join #${mychannel}
}

/if (${FindItem[="Harmony of the Soul"].ID}) /call EquipItem "Harmony of the Soul"
/if (!${Target.ID}) {
/echo Target the Tank when you run this macro to designate him as MT
/end
} else {
/varset tanknameid ${Target.ID}
/varset tankclass ${Target.Class.Name}
}

/if (${Defined[Param0]}) {
/varset healpct ${Param0}
} else /echo No Heal% specified, defaulting to 80%

/if (!${Defined[Param1]}) {
/echo Usage: /mac AFCleric % healspell
/echo Example: /mac AFCleric 70 Complete Heal
/echo Defaulting to ${healspell} at ${healpct}%
} else {
/if (!${Defined[Param2]}) {
/varset healspell ${Param1}
} else /if (!${Defined[Param3]}) {
/varset healspell ${Param1} ${Param2}
} else /if (!${Defined[Param4]}) {
/varset healspell ${Param1} ${Param2} ${Param3}
} else {
/varset healspell ${Param1} ${Param2} ${Param3} ${Param4}
}
}

/echo AFCleric Active, running in Autohealmode ${autohealmode}
/echo Casting ${healspell} on ${tankname} at ${healpct}% HP
/if (${autohealmode}==0) /echo ONLY ${tankname} will be healed
/if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed
/if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed
/if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group

:tankwatchloop
/if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0
/if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) {
/if (${SpawnCount[${tankname} ${tankclass}]}==1) {
/varset tanknameid ${Spawn[${tankname} ${tankclass}].ID}
/echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid}
}
/if (${SpawnCount[${tankname} ${tankclass}]}>1) {
/if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
/beep
/varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID}
/echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro
} else {
/beep
/echo Need to restart macro to correctly identify the MT
}
}
}
/if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) {
/if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
/varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID}
/echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro
}
}
/if ((!${Target.ID})||(${Target.ID}!=${tanknameid})) {
/if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) {
/target id ${tanknameid}
/delay 6 ${Target.ID}==${tanknameid}
}
}
/if (!${Spawn[${tanknameid}].ID}) {
/if (${nomtspam}==1) {
/e Warning No Designated MT is available
/timed 300 /varset nomtspam 1
/varset nomtspam 0
}
}
/if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) {
/g ${Me.PctMana}m
/varset lomspam 0
/timed 300 /varset lomspam 1
}
/if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) {
/g oom
/varset oomspam 0
/timed 300 /varset oomspam 1
/call MedTime
}
/if (${GameState.Equal[CHARSELECT]}) /end
/if (${Target.ID}==${tanknameid}) {
/varset stophealpoint ${Math.Calc[${healpct}*1.1]}
/if ((${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) {
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/delay 15 ${Me.SpellReady[${patchheal}]}
}
/if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})&&(${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) {
/if (${announce}==1) /g Casting ${healspell} on %T
/call Cast "${healspell}" gem1 1s CheckHP
/delay 15 ${Me.SpellReady[${healspell}]}
}
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
}
/if ((${autosit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
/if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand
}
/if ((${autosit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
/if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand
}
/if (${autohealmode}==0) {
/call CheckEvents
/goto :tankwatchloop
}
/if ((${autohealmode}>=1)&&(${Me.PctHPs}<=${selfhealpoint})) /call Healself
/if (${autohealmode}>=2) {
/if ((${Target.PctHPs}>${healpct})||(${Target.Distance}>${healspellrange})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tanknameid})) {
/call Healgroup
}
}
/if ((${autohealmode}<2)&&(${Me.PctHPs}>${selfhealpoint})&&(${Me.PctMana}<=98)) /call MedTime
/call CheckEvents
/goto :tankwatchloop
/return


Sub Healself
/if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
/if (${Me.PctHPs}>${selfhealpoint}) /return
/varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
/if ((!${Target.ID})||(${Target.PctHPs}>=${Math.Calc[1.1*${healpct}]})||(${Target.PctHPs}<=1)||(${Target.ID}!=${tanknameid})) {
/if ((${Me.PctHPs}<=${selfhealpoint})&&(${Me.PctHPs}>${dacastpoint})) {
/target myself
/delay 6 ${Target.Name.Equal[${Me}]}
/if (${Target.Name.Equal[${Me}]}) {
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/delay 15 ${Me.SpellReady[${patchheal}]}
}
}
/if ((${Me.PctHPs}<=${dacastpoint})&&(${Me.SpellReady[${daspell}]})) {
/if (${announce}==1) /g Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS
:retryda
/call Cast "${daspell}"
/delay 1
/if ((!${Me.Buff[${daspell}].ID})&&(${Me.SpellReady[${daspell}]})) /goto :retryda
/if ((${trickyda}==1)&&(${Me.Buff[${daspell}].ID})) /call TrickyDA
:dawait
/if (${Me.Buff[${daspell}].ID}) {
/delay 1s !${Me.Buff[${daspell}].ID}
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/goto :dawait
}
}
}
/if (${Me.PctHPs}<=${Math.Calc[${selfhealpoint}*0.7]}) {
/target myself
/delay 6 ${Target.Name.Equal[${Me}]}
/if (${Target.Name.Equal[${Me}]}) {
/if (${announce}==1) /g Casting ${patchheal} on %T
/varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
/call Cast "${patchheal}" gem2 1s CheckHP
/delay 15 ${Me.SpellReady[${patchheal}]}
}
}
/varset stophealpoint ${defaultstophealpoint}
/return


Sub Healgroup
:healgroup
/varset worsthurt NULL
/varset worsthp 100
/varset worstclass NULL
/varset minorhurt 0
/varset majorhurt 0
/varset ghealhurtcount 0
/for gmember 0 to ${Group}
/if (${onlyhealfd}==0) {
/if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
/if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) {
/varset worsthurt ${Group.Member[${gmember}].Name}
/varset worsthurtid ${Group.Member[${gmember}].ID}
/varset worsthp ${Group.Member[${gmember}].PctHPs}
/varset worstclass ${Group.Member[${gmember}].Class.Name}
}
}
}
/if (${onlyhealfd}==1) {
/if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
/if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
/varset worsthurt ${Group.Member[${gmember}].Name}
/varset worsthurtid ${Group.Member[${gmember}].ID}
/varset worsthp ${Group.Member[${gmember}].PctHPs}
/varset worstclass ${Group.Member[${gmember}].Class.Name}
}
/if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]})||(${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) {
/if ((${Group.Member[${gmember}].State.Equal[feign]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
/varset worsthurt ${Group.Member[${gmember}].Name}
/varset worsthurtid ${Group.Member[${gmember}].ID}
/varset worsthp ${Group.Member[${gmember}].PctHPs}
/varset worstclass ${Group.Member[${gmember}].Class.Name}
}
}
}
}
/if ((${Group.Member[${gmember}].Distance}<=${grouphealrange})&&(${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1
/if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=65)) /varcalc minorhurt ${minorhurt}+1
/if ((${Group.Member[${gmember}].PctHPs}<=65)&&(${Group.Member[${gmember}].PctHPs}>=1)) /varcalc majorhurt ${majorhurt}+1
/next gmember
/if (${autohealmode}==3) {
/if ((!${Target.ID})||(${Target.Name.NotEqual[${tankname}]})) /if (${Spawn[${tanknameid}].ID}) {
/target id ${tanknameid}
/delay 6 ${Target.ID}==${tanknameid}
/delay 1
/if ((${Target.ID}==${tanknameid})&&(${Target.PctHPs}<=${healpct})&&(${Target.Distance}<=${healspellrange})) /return
}
/if (${Me.PctHPs}<=${selfhealpoint}) /return
}
/if ((${majorhurt}==0)&&(${minorhurt}==0)) {
/if (${Spawn[${tanknameid}].ID}) {
/target id ${tanknameid}
/delay 6 ${Target.ID}==${tanknameid}
/delay 1
}
/if (((${Target.ID}==${tanknameid})&&(${Target.PctHPs}>${healpct}))||(!${Spawn[${tanknameid}].ID})||(${Spawn[${tanknameid}].Type.Equal[corpse]})) {
/if ((${healpetmode}>0)&&(${Me.PctMana}>=${manatohealpet})) /call HealPet
/if (${mokaddon}==1) /if (${Target.ID}==${tanknameid}) /call AutoMOK
/if (${Me.PctMana}<=98) /call MedTime
}
/call CheckEvents
/return
}
/if ((${usedivarb}==1)&&(${worsthp}<=${divarbpoint})&&(${Me.AltAbilityReady[divine arbitration]})) /call Divarbcast
/if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3)&&(${usegroupheal}==1)) {
/if (${announce}==1) /g Inc Grp Heal, get close
/call Cast "${groupheal}" gem4 1s
/delay 15 ${Me.SpellReady[${groupheal}]}
/call CheckEvents
/return
}
/if (${worsthurtid}==${tanknameid}) /return
/if (${worsthurtid}==${Me.ID}) {
/call Healself
/call CheckEvents
/return
}
/if ((${worstclass.Equal[Warrior]})||(${worstclass.Equal[Paladin]})||(${worstclass.Equal[Shadow Knight]})) {
/if ((${worsthp}<=${tankhealpoint})&&(${worsthp}>=${Math.Calc[0.7*${tankhealpoint}]})&&(${majorhurt}<=1)&&(${minorhurt}<=1)) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
/if (${announce}==1) /g Casting ${healspell} on %T
/call Cast "${healspell}" gem1 1s CheckHP
/delay 15 ${Me.SpellReady[${healspell}]}
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/return
}
/if (${worsthp}<=${tankhealpoint}) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/delay 15 ${Me.SpellReady[${patchheal}]}
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/return
}
} else /if ((${worstclass.Equal[Magician]})||(${worstclass.Equal[Wizard]})||(${worstclass.Equal[Enchanter]})||(${worstclass.Equal[Druid]})) {
/if ((${worsthp}<=${casterhotpoint})&&(${worsthp}>${casterpatchpoint})) {
/if ((${worsthurt.Equal[${nohotforua}]})||(${worsthurt.Equal[${nohotforub}]})||(${worsthurt.Equal[${nohotforuc}]})||(${worsthurt.Equal[${nohotforud}]})) /return
/if (${nohotforua.Equal[NULL]}) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset nohotforua ${Target.Name}
/if (${announce}==1) /g Casting ${hotspell} on %T
/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
/call Cast "${hotspell}" gem3 1s CheckHP
/timed 200 /varset nohotforua NULL
/delay 15 ${Me.SpellReady[${hotspell}]}
} else /if (${nohotforub.Equal[NULL]}) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset nohotforub ${Target.Name}
/if (${announce}==1) /g Casting ${hotspell} on %T
/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
/call Cast "${hotspell}" gem3 1s CheckHP
/timed 200 /varset nohotforub NULL
/delay 15 ${Me.SpellReady[${hotspell}]}
} else /if (${nohotforuc.Equal[NULL]}) {
/target id${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset nohotforuc ${Target.Name}
/if (${announce}==1) /g Casting ${hotspell} on %T
/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
/call Cast "${hotspell}" gem3 1s CheckHP
/timed 200 /varset nohotforuc NULL
/delay 15 ${Me.SpellReady[${hotspell}]}
} else /if (${nohotforud.Equal[NULL]}) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset nohotforud ${Target.Name}
/if (${announce}==1) /g Casting ${hotspell} on %T
/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
/call Cast "${hotspell}" gem3 1s CheckHP
/timed 200 /varset nohotforud NULL
/delay 15 ${Me.SpellReady[${hotspell}]}
}
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/return
}
/if ((${worsthp}<=${casterpatchpoint})&&(${worsthp}>=1)) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/delay 15 ${Me.SpellReady[${patchheal}]}
/return
}
/varset stophealpoint ${defaultstophealpoint}
} else /if ((${worstclass.Equal[Necromancer]})||(${worstclass.Equal[Shaman]})) {
/if ((${worsthp}<=${necshmpatchpoint})&&(${worsthp}>=1)) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/varset stophealpoint ${Math.Calc[${necshmpatchpoint}+5]}
/if (${announce}==1) /g Casting ${patchheal} on %T
/call Cast "${patchheal}" gem2 1s CheckHP
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/delay 15 ${Me.SpellReady[${patchheal}]}
/return
}
} else /if ((${worsthp}<=${defaultpatchpoint})&&(${worsthp}>=1)) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/if (${announce}==1) /g Casting ${patchheal} on %T
/varset stophealpoint ${Math.Calc[${defaultpatchpoint}+5]}
/call Cast "${patchheal}" gem2 1s CheckHP
/varset stophealpoint ${defaultstophealpoint}
/call CheckEvents
/delay 15 ${Me.SpellReady[${patchheal}]}
/return
}
/varset stophealpoint ${defaultstophealpoint}
/if ((${healpetmode}==2)&&(${Me.PctMana}>${manatohealpet})) /call HealPet
| /if (${mokaddon}==1) /if (${Target.ID}==${tanknameid}) /call AutoMOK
/return


Sub Divarbcast
/varset divarboor 0
/for gmember 0 to ${Group}
/if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1
/next gmember
/if (${Math.Calc[${Group}-${divarboor}]}>=2) {
/if (${announce}==1) /g Inc Divine Arbitration
/call Cast "Divine Arbitration" alt 2s
/if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
/if (${announce}==1) /g Inc Grp Heal, get close
/call Cast "${groupheal}" gem4 2s
/delay 15 ${Me.SpellReady[${groupheal}]}
}
}
/return


Sub HealPet
/varset worsthurt NULL
/varset worsthp 100
/for gmember 0 to ${Group}
/if (${Group.Member[${gmember}].Pet.ID}) {
/if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) {
/if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) {
/varset worsthurt ${Group.Member[${gmember}].Pet.Name}
/varset worsthurtid ${Group.Member[${gmember}].Pet.ID}
/varset worsthp ${Group.Member[${gmember}].Pet.PctHPs}
}
}
}
/next gmember
/if (${worsthurt.NotEqual[NULL]}) {
/target id ${worsthurtid}
/delay 5 ${Target.ID}==${worsthurtid}
/if (!${Target.ID}) /return
/if (${Target.ID}!=${worsthurtid}) /return
/delay 3
/if (${Target.PctHPs}<=${pethealpoint}) {
/if (${announce}==1) /g Casting ${pethealspell} on %T
/varset stophealpoint ${Math.Calc[${pethealpoint}+5]}
/call Cast "${pethealspell}" spell 1s CheckHP
/varset stophealpoint ${defaultstophealpoint}
/delay 15 ${Me.SpellReady[${pethealspell}]}
}
}
/return


Sub CheckEvents
/delay 1
/doevents IRCchat
/doevents Chat
/doevents tell
/return


Sub MedTime
:oomwait
/call CheckEvents
/if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
/if ((!${Spawn[PC enchanter].ID})||(${NearestSpawn[PC enchanter].Distance}>200)) {
/call ClarPotUse
}
}
/If ((${FindItem["Rod of Mystical Transvergance"].InvSlot})&&(${Me.PctMana}<=70)&&(${Me.PctHPs}>=98)&&(${rodwait}==0)) {
/call Cast "Rod of Mystical Transvergance" item
/varset rodwait 1
/timed 3000 /varset rodwait 0
}
/if ((${autosit}==1)&&(${Me.PctMana}<=98)&&(!${Me.Casting.ID})) {
/if ((${Bool[${Me.Standing}]})&&(${NearestSpawn[NPC].Distance}>=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${distancetosit}]})&&(${Me.PctHPs}>90)) /sit
/if ((${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})&&(${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]})) /stand
}
/if ((${Bool[${Me.Standing}]})&&(${autosit}==2)&&(${Me.PctMana}<=98)&&(${Me.PctHPs}>90)&&(!${Me.Casting.ID})) /sit
/if ((${Bool[${Me.Sitting}]})&&(${autosit}>=1)&&(${Me.PctMana}>98)&&(!${Window[SpellBookWnd].Open})) /stand
/if ((${Bool[${Me.Standing}]})&&(!${Me.Mount.ID})&&(${Me.SpellReady[${yaulpspell}]})&&(!${Me.Buff[${yaulpspell}].ID})) {
/if ((!${Me.Buff[Vallon].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Strength of Tunare].ID})) /call Cast "${yaulpspell}"
}
/if (${buffbeg}==1) /call Buffbeg
/if (${Me.PctHPs}<=${selfhealpoint}) /return
/if (${Me.PctMana}<=8) /goto :oomwait
/return


Sub CheckHP
| ${castEndTime} is variable to express time remaining, in deciseconds, from spell_routines.inc
/if (!${Window[CastingWindow].Open}) /return
/if ((${interrupt2healself}==1)&&(${Target.ID}==${tanknameid})) /if ((${Me.PctHPs}>=90)&&(${castEndTime}>=12)) /return
/if ((${interrupt2healself}==0)&&(${Target.ID}==${tanknameid})) /if (${castEndTime}>=12) /return
/if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) {
/if ((${announce}==1)&&(${duckspam}==1)) {
/g Ducking heal on %T
/e Ducking heal on ${Target.Name}
/varset duckspam 0
/timed 60 /varset duckspam 1
}
/call Interrupt
/return
}
/if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) {
/if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) {
/call Interrupt
/call Divarbcast
/return
}
/if ((${announce}==1)&&(${duckselfspam}==1)) {
/g Ducking heal on %T so I can heal my (ChickenShit) self
/e Ducking heal on ${Target} so I can heal myself
/varset duckselfspam 0
/timed 60 /varset duckselfspam 1
}
/call Interrupt
/return
}
/if (${onlyhealfd}==1) {
/if ((${Target.Class.Name.Equal[Necromancer]})||(${Target.Class.Name.Equal[Monk]})) {
/if (${Target.State.NotEqual[feign]}) {
/if ((${announce}==1)&&(${duckfdspam}==1)) {
/g Ducking heal on %T because he isn't staying FD
/e Ducking heal on ${Target.Name} because he isn't staying FD
/varset duckfdspam 0
/timed 40 /varset duckfdspam 1
}
/call Interrupt
/return
}
}
}
/if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${Me.AltAbilityReady[Divine Arbitration]})&&(${castEndTime}>=${interrupt2divarb})) {
/for gmember 0 to ${Group}
/if (${Target.ID}==${Group.Member[${gmember}].ID}) {
/call Interrupt
/call Divarbcast
/return
}
/next gmember
}
/return


Sub TrickyDA
/for intcount 1 to 20
/if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup
/next intcount
/if (${Me.Buff[${daspell}].ID}) {
:waitalittle
/delay 1s ${Me.Buff[${daspell}].Duration}<2
/if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle
}
/varset buffbeg 1
/call Buffbeg
/return


Sub Buffbeg
/if (${buffbeg}==0) /return
/echo Begging for buffs now
/if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
/if (${Spawn[pc guild enchanter].ID}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) {
/tell ${NearestSpawn[PC guild enchanter]} need C plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Enchanter available for C5
}
/if ((!${Me.Buff[Protection of the Nine].ID})&&(!${Me.Buff[Blessing of the Nine].ID})&&(!${Me.Buff[Steeloak Skin].ID})&&(!${Me.Buff[Blessing of Steeloak].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
/if (${Spawn[pc guild druid].ID}) /if (${NearestSpawn[PC guild druid].Distance}<=100) {
/tell ${NearestSpawn[PC guild druid]} need dru crack plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Druid available for DRU crack
}
/if ((!${Me.Buff[Spiritual Dominion].ID})&&(!${Me.Buff[Spiritual Ascendance].ID})) {
/if (${Spawn[pc guild beastlord].ID}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) {
/tell ${NearestSpawn[PC guild beastlord]} need bst crack plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Beastlord available for BST crack
}
/if ((!${Me.Buff[Kazad`s Mark].ID})&&(!${Me.Buff[Symbol of Kazad].ID})&&(!${Me.Buff[Symbol of Balikor].ID})&&(!${Me.Buff[Balikor's Mark].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
/if (${Spawn[pc guild cleric].ID}) /if (${NearestSpawn[PC guild cleric].Distance}<=100) {
/tell ${NearestSpawn[PC guild cleric]} need sym plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Cleric available for Symbol
}
/if ((!${Me.Buff[Brell's Stalwart Shield].ID})&&(!${Me.Buff[Brell's Brawny Bulwark].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Spiritual Vitality].ID})) {
/if (${Spawn[pc guild paladin].ID}) /if (${NearestSpawn[PC guild paladin].Distance}<=100) {
/tell ${NearestSpawn[PC guild paladin]} need BSS plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Paladin available for BSS
}
/if ((!${Me.Buff[Shield of Maelin].ID})&&(!${Me.Buff[Focus of the Seventh].ID})&&(!${Me.Buff[Focus of Soul].ID})&&(!${Me.Buff[Wunshi's Focusing].ID})&&(!${Me.Buff[Talisman of Wunshi].ID})) {
/if (${Spawn[pc guild shaman].ID}) /if (${NearestSpawn[PC guild shaman].Distance}<=100) {
/tell ${NearestSpawn[PC guild shaman]} need focus plz
/delay 20
/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
} else /e No guild Shaman available for Focus
}
/varset buffbeg 0
/return


Sub FindExactPC(string name)
/declare nameid int local
/declare counter int local 1
:FindNext
/if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
/varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
/if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
/target id ${nameid}
/delay 1s ${Target.ID}==${nameid}
/if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
}
/varcalc counter ${counter}+1
/if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return NOT_FOUND


Sub HealPotUse
|** Call from a frequent subroutine. Use a variable to trigger it at a specific health
Example of a call for this routine, for use at 15% health as a backup for normal heals:
/if (!${Defined[healpotpoint]}) /declare healpotpoint int outer 15
/if (${Me.PctHPs}<=${healpotpoint}) /call HealPotUse
**|
/if (!${Defined[healpottimer]}) /declare healpottimer int outer 1
/if (!${Defined[healpotname]}) /declare healpotname string outer NULL
/if (${healpottimer}==0) /return
/if (!${FindItem[Healing Potion].ID}) {
/varset healpotname NULL
/return
}
/if (!${FindItem[=${healpotname}].ID}) /varset healpotname NULL
/if (${FindItem[=Healing Potion X].ID}) {
/if (${announce}==1) /g WHEW -----> Healing Potion Used
/varset healpotname Healing Potion X
/goto :casthealpot
}
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IX].ID}) /varset healpotname Healing Potion IX
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VIII].ID}) /varset healpotname Healing Potion VIII
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VII].ID}) /varset healpotname Healing Potion VII
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion VI].ID}) /varset healpotname Healing Potion VI
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion V].ID}) /varset healpotname Healing Potion V
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion IV].ID}) /varset healpotname Healing Potion IV
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion III].ID}) /varset healpotname Healing Potion III
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion II].ID}) /varset healpotname Healing Potion II
/if (${healpotname.Equal[NULL]}) /if (${FindItem[=Healing Potion I].ID}) /varset healpotname Healing Potion I
:casthealpot
/call Cast "${healpotname}" item
/varset healpottimer 0
/timed 1200 /varset healpottimer 1
/return


Sub ClarPotUse
|** Call from the rebuff or buffbeg subroutine if no enc clarity effects are available
Example of a call for this routine:
/if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
/if ((!${Spawn[PC enchanter].ID})||(${NearestSpawn[PC enchanter].Distance}>200)) {
/call ClarPotUse
}
}
**|
/if (!${Defined[clarpottimer]}) /declare clarpottimer int outer 1
/if (!${Defined[clarpotname]}) /declare clarpotname string outer NULL
/if (${clarpottimer}==0) /return
/if (!${FindItem[Elixir of Clarity].ID}) {
/varset clarpotname NULL
/return
}
/if (!${FindItem[=${clarpotname}].ID}) /varset clarpotname NULL
/if (${FindItem[=Elixir of Clarity X].ID}) /varset clarpotname Elixir of Clarity X
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IX].ID}) /varset clarpotname Elixir of Clarity IX
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VIII].ID}) /varset clarpotname Elixir of Clarity VIII
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VII].ID}) /varset clarpotname Elixir of Clarity VII
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity VI].ID}) /varset clarpotname Elixir of Clarity VI
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity V].ID}) /varset clarpotname Elixir of Clarity V
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity IV].ID}) /varset clarpotname Elixir of Clarity IV
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity III].ID}) /varset clarpotname Elixir of Clarity III
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity II].ID}) /varset clarpotname Elixir of Clarity II
/if (${clarpotname.Equal[NULL]}) /if (${FindItem[=Elixir of Clarity I].ID}) /varset clarpotname Elixir of Clarity I
/if ((!${Me.Buff[Elixir of Clarity X].ID})&&(!${Me.Buff[Elixir of Clarity IX].ID})&&(!${Me.Buff[Elixir of Clarity VIII].ID})&&(!${Me.Buff[Elixir of Clarity VII].ID})&&(!${Me.Buff[Elixir of Clarity VI].ID})&&(!${Me.Buff[Elixir of Clarity V].ID})&&(!${Me.Buff[Elixir of Clarity IV].ID})&&(!${Me.Buff[Elixir of Clarity III].ID})&&(!${Me.Buff[Elixir of Clarity II].ID})&&(!${Me.Buff[Elixir of Clarity I].ID})) {
/call Cast "${clarpotname}" item
/varset clarpottimer 0
/timed 26700 /varset clarpottimer 1
}
/return


Sub Event_Chat(string ChatType,string Sender,string ChatText)
/if ((!${ChatType.Equal[${mychannel}]})&&(!${ChatType.Equal[TELL]})&&(!${ChatType.Equal[group]})) /return
/if (${usegroupchat}==0) /if (${ChatType.Equal[group]}) /return
/call ChatParse ${ChatType} ${Sender} "${ChatText}"
/return


Sub Event_IRCchat(string Line,string Sender,string ChatText)
/call ChatParse IRC ${Sender} "${ChatText}"
/return

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Mon Jul 31, 2006 8:40 pm

Untill you use CODE brackets who gives a fuck.

paulstacio
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Jul 23, 2006 6:10 pm
Location: Oklahoma
Contact:

Post by paulstacio » Mon Jul 31, 2006 10:47 pm

expound code braquets where? and I give a Fuck hehehe :roll:

ascii38
a grimling bloodguard
a grimling bloodguard
Posts: 506
Joined: Sat Jul 17, 2004 8:06 pm

Post by ascii38 » Tue Aug 01, 2006 12:22 am