// niklata's BM macro // Intelligent fully beneficial macro that requires only one spell tab. // Currently supports life/creature spells. Item spell support is now included, // but is not very heavily tested. // Less fizzles in the first cycle will likely result if you prebuff as necessary // before the macro begins. // Requires Decal plugin to be active. // I will extend to cast spells directly and get rid of the tab cycling nonsense // (and add rotating beneficial cycles!) once the Decal plugin supports direct casts. // Timings are very aggressive; increase delays as necessary to fit the latency of your // connection and computer. // Starting conditions: // Focusing object held. // Tabs: // Tab One: // 1) S2M I // 2) Vuln Self I // 3) Leader Self II // 4) Life Self II // 5) Vuln Self II // 6) Focus Self III // 7) End Self III - purely for my own buffing purposes, no exp // 8) Vuln Self III // 9) Will Self IV // 10) Vuln Self IV // 11) Mana Conv Self V // 12) Vuln Self V // 13) Creature Self VI // 14) Acid Vuln Self I // 15) Revit Self II // 16) Acid Vuln Self II // 17) S2M III // 18) Acid Vuln Self III // 19) Revit Self IV // 20) Acid Vuln Self IV // 21) Rejuv Self V // 22) Acid Vuln Self V // 23) Mana Renewal Self VI // If you use item magic, adjust UseItem and LastItem appropriately and add: // 24) Hide Value II // 25) Hide Value III // 26) Hide Value IV // 27) Hide Value V // 28) Hide Value VI Constants // Adjust to suit your character, use buffed values from your cycle... MaxHealth = 126 MaxStam = 178 MaxMana = 282 // Tolerance for amount of quantity to be below max during/after regain cycle. StamSlack = 5 ManaSlack = 30 MinMana = 60 // Should equal the cost of your most expensive spell, to save comp burn // Min time per cycle, in ms MinCycleDel = 160000 MinLifeDel = 130000 MinItemDel = 130000 MinCreatureDel = 130000 MinRestTime = 15000 // Total spells per cycle, *NOT* including S2M I NumSpells = 22 // Number of last creature/life/item spell in cycle, *NOT* including S2M I LastCreature = 12 LastLife = 22 LastItem = 27 UseItem=0 // Max number of times to try to cast a spell from fizzles MaxTries = 5 // END OF USER ADJUSTABLE VARIABLES; ADJUST BELOW AT YOUR OWN RISK! // Max number of spells capable of being handled MaxSpells = 30 // Index of current spell in cycle CurrentSpell = 3 // Timing variables CycleStart = 0 LifeStart = 0 CreatureStart = 0 ItemStart = 0 // Time to wait by spell level L1Delay = 2500 L2Delay = 3000 L3Delay = 3500 L4Delay = 4000 L5Delay = 4500 L6Delay = 5000 // Time to wait after a failure from busy BusyDelay = 500 // Time to wait from charging error ChargeDelay = 2000 Temp = 0 CyclePos = 0 FirstCycle = 1 End // This line is necessary to select the proper window SetActiveWindow Asheron's Call Procedure Select_Spell Keys ^{PGUP} Keys ^{DEL} Loop $MaxSpells If {Loop No} = $CurrentSpell Break End Keys {PGDN} End End Procedure Casting_Mode If _CombatState = "Spellcast" Else Keys ` Delay 4000 End End Procedure Peace_Mode If _CombatState = "Standing" Else Keys ` Delay 4000 End End Procedure Lie_Down Delay 1000 If _CombatState = "Standing" Else Keys ` Delay 1500 End Keys B Delay 3000 End // Vestigal? Do I even need this? Procedure Bow_Dance Delay 1000 RandomTurn Delay 1000 End // Assumes character is in casting mode. Procedure S2M Compute $Temp = $MaxMana - $ManaSlack If _MyMana > $Temp //Say No need to cast S2M. Exit End Call Casting_Mode Keys ^{DEL} Keys 1 End // Assumes character is already lying down. Procedure Regain_Stam Loop 1000 Compute $Temp = $MaxStam - $StamSlack If _MyStamina > $Temp Break End Delay 2000 End End // Assumes caster is already in casting mode. Procedure Regain_Mana Compute $Temp = $MaxStam - $StamSlack // Check to see if we already have enough mana for S2M If _MyStamina > $Temp // If so, S2M Call S2M Else // No, so regain mana to nearly full by rest-cycling. Call Lie_Down Loop 1000 Call Regain_Stam Call S2M Compute $Temp = $MaxMana - $ManaSlack If _MyMana > $Temp Break End Call Lie_Down End Call Casting_Mode // Must exit function in casting mode! Call Select_Spell Delay 2000 End End // Assumes caster is already in casting mode. Procedure Regain_Mana_Once Compute $Temp = $MaxStam - $StamSlack // Check to see if we already have enough mana for S2M If _MyStamina > $Temp // If so, S2M Call S2M Else // No, so regain mana to nearly full by rest-cycling. Call Lie_Down Call Regain_Stam Call S2M Call Casting_Mode // Must exit function in casting mode! Call Select_Spell Delay 1000 End End // Dynamically delay, taking into account the time it takes to select a spell... // Adjust as necessary if you change spell orders/add spells/etc. Procedure Spell_Delay If $CyclePos < 10 Delay 2500 Exit End If $CyclePos < 13 Delay 3500 Exit End If $CyclePos < 20 Delay 2500 Exit End Delay 3500 End // Attempts to cast a spell. If not enough mana, regains it and casts. Procedure Cast_Spell Loop $MaxTries If _MyMana < $MinMana Delay 2000 Call Regain_Mana_Once Delay 2000 End Keys {END} Call Spell_Delay If _Failure = "Insufficient Mana" // OOM: get mana back, count as fizzle Call Regain_Mana_Once Continue End If _Failure = "Too Busy" // Not yet ready to cast, count as fizzle Continue End If _Failure = "Fizzle" // Fizzled Continue End If _Failure = "Charge" // Shouldn't happen, count as fizzle Continue End Break End End // Handles the exp-generating spell cycle. Procedure Spell_Cycle Loop $NumSpells Compute $CyclePos = {Loop No} Call Select_Spell Call Cast_Spell If $LastCreature = $CyclePos //Say Resetting Creature Timer Compute $CreatureStart = {ElapsedMSec} // Reset creature timer Loop 1000 // Wait for timer on life spells If $FirstCycle = 1 If $UseItem = 0 Compute $FirstCycle = 0 End Break End Compute $Temp = {ElapsedMSec} - $MinLifeDel If $Temp > $LifeStart Break End // Rest if there's enough time to do so efficiently. Compute $Temp = {ElapsedMSec} - $LifeStart If $Temp > $MinRestTime //Say Resting before Life Cycle Call Regain_Mana_Once End Delay 500 End End If $LastLife = $CyclePos //Say Resetting Life Timer Compute $LifeStart = {ElapsedMSec} // Reset life timer If $UseItem = 1 Loop 1000 // Wait for timer on item spells If $FirstCycle = 1 Compute $FirstCycle = 0 Break End Compute $Temp = {ElapsedMSec} - $MinItemDel If $Temp > $ItemStart Break End // Rest if there's enough time to do so efficiently. Compute $Temp = {ElapsedMSec} - $ItemStart If $Temp > $MinRestTime //Say Resting before Item Cycle Call Regain_Mana_Once End Delay 500 End End End If $LastItem = $CyclePos And $UseItem = 1 //Say Resetting Item Timer Compute $ItemStart = {ElapsedMSec} // Reset item timer End Inc CurrentSpell End End // Main loop, bowdance every 5 cycles. Simple is Good. Loop 1000 Loop 5 SetConst CurrentSpell = 3 Compute $CycleStart = {ElapsedMSec} Call Casting_Mode Call Spell_Cycle // Wait until it's time for creature magic, rest if there's enough spare time. Loop 100 Compute $Temp = {ElapsedMSec} - $MinCreatureDel If $Temp > $CreatureStart Break End Compute $Temp = {ElapsedMSec} - $CreatureStart If $Temp > $MinRestTime //Say Resting before Creature Cycle Call Regain_Mana_Once End Delay 500 End End Call Bow_Dance End