Macro Bot.mac Updates and Bug Fixes by [40oz]

I really applaud all you guys for putting in so much time to get this bot macro working again. Have any of you tried moving to the bot plugin now?

I've moved most of my guys there now and have worked out most of the kinks with my ini - and boy is it so much faster.

I had tried to move to the plugin a couple of years ago and found no real driver, but the macro breaking outright was just enough motivation to move to something that worked that wasn't the KA macro

I have spent some time playing with the plugin too, but I don't like its level of custom-ability. Furthermore, I have yet to notice much, if any, dps improvement or anything like that.
 
Not sure what you have done since my last version, but testing just now shows that assist IS broken, it is no longer reading from INI or using xtarget1 as it should. And healsingle has been broken (was fixed). Still testing.

Edit,

I'm not sure why you have that check for assist PC, the macro is (by default) to use xtarget1 as the kill target. Even if you are using one of the other assisttypes, you should still be able to have assist PC read from the INI.

Hmmmm, you version ever goes as far as to delete AssistPC= line from the INI.
 
anyone got any further on this?
 
While this macro is still a while off being ready for use again. I have fixed the buff subroutines:

Code:
|Buff start

#chat bc
#chat EQBC

#event EQBC                  	"<#1#> #2#"
#event EQBC                   	"[#1#(msg)] #2#"
#event CastSpell  	      	"#1# tells the group#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the group#*#, '#2#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2#'"
#event CastSpell              	"#1# tells you#*#, '#2# on #3#'"
#event CastSpell              	"#1# tells you#*#, '#2#'"
#event CastSpell              	"#1# told you, '#2#'"
#event CastSpell            	"#1# told you, '#2# on #3#'"
#event InvisOn                  "#*#invison#*#"
#event InvisUndeadOn            "#*#ivuon#*#"
#event InvisOff                 "#*#invisoff#*#"
#event LevitateOn            	"#*#levon#*#"
#event LevitateOff              "#*#levoff#*#"
#event BuffWornOff 		"Your #1# spell has worn off of #2#."

Sub BuffLoad
	/varset CurrentSub Buff
	/if (!${Defined[BuffLoaded]}) /declare BuffLoaded bool outer FALSE
	/if (${BuffLoaded}) /return
	/call Debug 3 "Entering ${CurrentSub}Load"
	/varset BuffLoaded TRUE
	/declare i int local 3
	/declare b int local
	/declare x string local
	
	|** Changed to if/then/else because it can't be all of them. **|
	/if (${Select[${Me.Class.ShortName},SHD,MNK,ROG,BER,WAR,NEC]}) {
		/varset i 1
	} else /if (${Select[${Me.Class.ShortName},SHM,PAL,BST,MAG]}) {
		/varset i 7
	} else 	/if (${Select[${Me.Class.ShortName},RNG,CLR,ENC]}) {
		/varset i 10
	} else /if (${Select[${Me.Class.ShortName},BRD]}) {
		/varset i 1
	}
	
	/if (!${Defined[BuffXTargets]}) /declare BuffXTargets bool outer ${Ini[MyIni,Buff,BuffXTargets,FALSE]}
	/if (!${BuffXTargets}) /mmoini "MyIni" "Buff" "BuffXTargets" "FALSE"
	/if (!${Defined[BuffPets]}) /declare BuffPets bool outer ${Ini[MyIni,Buff,BuffPets,FALSE]}
	/if (!${BuffPets}) /mmoini "MyIni" "Buff" "BuffPets" "FALSE"
	/if (!${Defined[AutoInvis]}) /declare AutoInvis bool outer ${Ini[MyIni,Buff,AutoInvis,FALSE]}
	/if (!${AutoInvis}) /mmoini "MyIni" "Buff" "AutoInvis" "FALSE"
	/if (!${Defined[AutoBreakInvis]}) /declare AutoBreakInvis bool outer ${Ini[MyIni,Buff,AutoBreakInvis,FALSE]}
	/if (!${AutoBreakInvis}) /mmoini "MyIni" "Buff" "AutoBreakInvis" "FALSE"
	
	/varset tempsubtotal ${Ini[MyIni,${CurrentSub},${CurrentSub}Total]}
	
	/if (${NeedLoad} && !${tempsubtotal}) {
		/for b 1 to ${AAInvis.Count[|]} 
			/if (${Me.AltAbility[${AAInvis.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvis.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem"
		/varset x
		/for b 1 to ${AAInvisUndead.Count[|]} 
			/if (${Me.AltAbility[${AAInvisUndead.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvisUndead.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem"
		/varset x
		/for b 1 to ${AALevitate.Count[|]}
			/if (${Me.AltAbility[${AALevitate.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AALevitate.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem"
		/call SpellLoad "${CurrentSub}" ${i} "|1|3|4|5|6|25|24|30|" "|0|TRUE|PH|PH|PH|PH|BER,BRD,BST,CLR,DRU,ENC,MAG,MNK,NEC,PAL,RNG,ROG,SHD,SHM,WAR,WIZ|PH|"
	}

	/call SpellLoad2 "${CurrentSub}" "3|4|5|6|25|24|30|"
	/declare BuffArray[50,2] string outer 0
	/declare BuffQueueString string outer
	/declare BuffTimerString string outer
	/declare MyBuffString string outer
	/declare TargetBuff[45,5] string outer
	/declare TargetBuffCount int outer
	/declare UnknownBuff bool outer
	/declare BuffParsePH string outer
	/declare MyBuffCount int outer


	/declare MyBuff[50,4] string outer
	/for i 1 to ${BuffTotal}
		/declare BuffType${i} string outer
		/if (!${Defined[BuffSpellIcon${i}]}) /declare BuffSpellIcon${i} string outer
		/call BuffParse "${BuffSpellIcon${i}}" ${i}
		/varset BuffQueueString ${BuffQueueString}${BuffSpellIcon${i}}|
	/next i
	
	/if (!${Defined[BuffCheckTimer]}) /declare BuffCheckTimer timer outer 1s
	/if (!${Defined[BuffString1]}) /declare BuffString1 string outer
	/if (!${Defined[BuffString2]}) /declare BuffString2 string outer
	/if (!${Defined[BuffTimerString]}) /declare BuffTimerString string outer
	/if (!${Defined[iTargetBuff]}) /declare iTargetBuff int outer
	/if (!${Defined[InitialBuffList]}) /declare InitialBuffList string outer
	/if (!${Defined[ChatSenderHold]}) /declare ChatSenderHold string outer
	/if (!${Defined[SpellHold]}) /declare SpellHold string outer
	/if (!${Defined[timehold]}) /declare timehold timer outer
	/if (!${Defined[InvisSpell]}) /declare InvisSpell string outer ${Ini[MyIni,${CurrentSub},InvisSpell]}
	/if (!${Defined[InvisSpellGem]}) /declare InvisSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisSpellGem]}
	/if (!${Defined[InvisUndeadSpell]}) /declare InvisUndeadSpell string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpell]}
	/if (!${Defined[InvisUndeadSpellGem]}) /declare InvisUndeadSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpellGem]}
	/if (!${Defined[LevitateSpell]}) /declare LevitateSpell string outer ${Ini[MyIni,${CurrentSub},LevitateSpell]}
	/if (!${Defined[LevitateSpellGem]}) /declare LevitateSpellGem string outer ${Ini[MyIni,${CurrentSub},LevitateSpellGem]}
	/if (!${Defined[BuffExtension]}) /declare BuffExtension float outer
	
	|** Convert to if else statement, it can't be both, no need to evaluate both every time. Also adjusted for AugSlot2 and Augslot3 to avoid false negative.**|
	|** Was using Depreciated syntax, updated from ${InvSlot[back].AugSlot1} to current **|
	|** There was no base case (IE: You have neither aug slot or no back item. This is what was making the timer 0.) **|
	|** Added a boolean check to see if the back item had a spell on it to avoid a false positive for lower level characters **|
	/if (${Bool[${Me.Inventory[back].Spell}]}) {
		/if (${Me.Inventory[back].AugSlot1} == 7 || ${Me.Inventory[back].AugSlot2} == 7 || ${Me.Inventory[back].AugSlot3} == 7) {
			/varset BuffExtension 1.26
		} else /if (${Me.Inventory[back].AugSlot1} == 8 || ${Me.Inventory[back].AugSlot2} == 8 || ${Me.Inventory[back].AugSlot3} == 8) {
			/varset BuffExtension 1.35
		}
	} else {
		/varset BuffExtension 1
	}
	
	|** Calculate Spell Casting Reinforcement in reverse order in /if then else statements to reduce total needed parses at higher levels **|
	/if (${Me.AltAbility[Spell Casting Reinforcement]}>=28) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=20) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=12) {
		/varcalc BuffExtension ${BuffExtension}+.15
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=6) {
		/varcalc BuffExtension ${BuffExtension}+.10
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=2) {
		/varcalc BuffExtension ${BuffExtension}+.05
	}
	
	/call Debug 3 "Leaving ${CurrentSub}Load"
/return

Sub Buff
	/varset CurrentSub Buff
	/call Debug 3 "Entering Sub ${CurrentSub} The real one."
	/if (!${Defined[${CurrentSub}Loaded]}) {
		/call Debug 3 "${CurrentSub}Loaded not defined, calling BuffLoad"
		/call BuffLoad
	}
	
	/declare i int local
	/declare b int local
	/if (!${BuffTotal}||${Me.Hovering}||${Window[tradewnd].Open}||${Window[lootwnd].Open}) /return
	/if (${${CurrentSub}Conditions.NotEqual[123456]}) /varset ${CurrentSub}Conditions ${Ini[MyIni,${CurrentSub},${CurrentSub}Conditions,123456]}
	/if (!${${CurrentSub}Conditions}) /return
	/for b 1 to ${BuffTotal}
		/if (!${BuffUse${b}}) /goto :skipbuff
		/if (${BuffConditions${b}.NotEqual[123456]}) /varset BuffConditions${b} ${Ini[MyIni,Buff,BuffConditions${b},1]}
		/if (!${Defined[${Me.ID}_Buff${b}]}) /declare ${Me.ID}_Buff${b} timer outer 0
		/if	(!${${Me.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Me.Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.ID} ${b}
		/if (${BuffPets} && ${Me.Pet.ID} && ${BuffClasses${b}.Find[${Me.Pet.Class.ShortName}]} && ${Spawn[${Me.Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Me.Pet.ID} ${b}
		/if (!${Group}) /goto :skipgroup
		/for i 1 to ${Group}
			/if (!${Defined[${Group.Member[${i}].ID}_Buff${b}]}) /declare ${Group.Member[${i}].ID}_Buff${b} timer outer 0
			/if (!${${Group.Member[${i}].ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Class.ShortName}]} && ${Spawn[${Group.Member[${i}].ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].ID} ${b}
			/if (!${Defined[${Group.Member[${i}].Pet.ID}_Buff${b}]}) /declare ${Group.Member[${i}].Pet.ID}_Buff${b} timer outer 0
			/if (${BuffPets} && !${Group.Member[${i}].Pet.Name.Find[Familiar]} && !${Group.Member[${i}].Pet.Name.Find[_pet]} && ${Group.Member[${i}].Pet.ID} && !${${Group.Member[${i}].Pet.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Pet.Class.ShortName}]} && ${Spawn[${Group.Member[${i}].Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].Pet.ID} ${b}
		/next i

		:skipgroup
		/if (!${BuffConditions${b}}) /goto :skipbuff
		/for i 2 to ${XTarget.Max}
			/if (!${Defined[${Me.XTarget[${i}].ID}_Buff${b}]}) /declare ${Me.XTarget[${i}].ID}_Buff${b} timer outer 0
			/if (${BuffXTargets}) {
				/if (${Me.XTarget[${i}].ID}) {
					/if (!${${Me.XTarget[${i}].ID}_Buff${b}} && (${Select[${Spawn[${Me.XTarget[${i}].ID}].Type},pc,mercenary]}||${Spawn[${Me.XTarget[${i}].ID}].Master.Type.Equal[pc]}) && ${Spawn[${Me.XTarget[${i}].ID}].Distance}<=100 && ${Me.XTarget[${i}].Type.NotEqual[auto hater]} && ${BuffClasses${b}.Find[${Me.XTarget[${i}].Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.XTarget[${i}].ID} ${b}
				}
			}
		/next i

		:skipbuff
	/next b

	/for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_Buff${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}}) {
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/if (${Spawn[${BuffArray[${i},1]}].ID} && ${Spawn[${BuffArray[${i},1]}].Distance}<100) {
			/call Debug 3 "/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}""
			/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}"
		}
	/next i
	/call Debug 3 "Leaving Sub ${CurrentSub}"
/return

Sub BuffList(int TNameID, int iB)
	/varset CurrentSub BuffList
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/call BuffCheck ${TNameID}
	/declare i int local
	/if (${Me.Book[${BuffSpellName${iB}}]} && !${If[${Me.SpellReady[${BuffSpellName${iB}}]},TRUE,FALSE]} && ${BuffSpellGem${iB}.Find[gem]}) {
		/memorize "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}"
		:gemwait
		/doevents
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/delay 2
		/if (!${Me.SpellReady[${BuffSpellName${iB}}]}) /goto :gemwait
	}
	/if ((${Me.SpellReady[${BuffSpellName${iB}}]}||${Me.AltAbilityReady[${BuffSpellName${iB}}]}||${FindItem[${BuffSpellName${iB}}].ItemSlot} && !${FindItem[${BuffSpellName${iB}}].Timer}) && !${${TNameID}_Buff${iB}}) {
		/if (${Spawn[id ${TNameID}].Type.Equal[corpse]}) /return
		/if (${Spawn[id ${TNameID}].ID}) /squelch /tar id ${TNameID}
		/delay 1s ${Target.ID}==${TNameID}
		/call ${EchoSub} "${Pink} ${BuffSpellName${iB}} --> ${White} ${Target.CleanName}"
    	/if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
		/if (!${Defined[BuffListAnnounce]}) /declare BuffListAnnounce bool outer FALSE
    	/if (${BuffListAnnounce} && ${AnnounceChannel.NotEqual[NULL]}) /docommand /${AnnounceChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
    	/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && ${Me.AltAbilityReady[Tranquil Blessings]} && (${Me.CombatState.Equal[Active]}||${Me.CombatState.Equal[RESTING]})) /alt act ${Me.AltAbility[Tranquil Blessings].ID}
		/call Cast "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}" 0 CheckStuff
		/delay 30s !${Me.Casting.ID}
		/if (!${Defined[${TNameID}_Buff${iB}]}) {
			/declare ${TNameID}_Buff${iB} timer outer
			/call Debug 3 "Defined a new timer for ${TNameID}_Buff${iB} for ${${TNameID}_Buff${iB}}"
		}
		/if (${Macro.Return.Equal[CAST_NOTHOLD]}||${Macro.Return.Equal[CAST_SUCCESS]}) {
			/if (!${Defined[${TNameID}_Buff${iB}]}) /declare ${TNameID}_Buff${iB} timer outer
			/varset ${TNameID}_Buff${iB} ${Spell[${BuffSpellName${iB}}].Duration}s
			/varset ${TNameID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
			/call Debug 3 "${Math.Calc[${${TNameID}_Buff${iB}}/10/60].Int} Minute timer set."
			/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && (${SpawnCount[group ${Target.CleanName}]}||!${Target.ID})) {
				/for i 0 to ${Group}
					/if (${Group.Member[${i}].Distance}<${Spell[${BuffSpellName${iB}}].AERange}) {
						/if (!${Defined[${Group.Member[${i}].ID}_Buff${iB}]}) /declare ${Group.Member[${i}].ID}_Buff${iB} timer outer
						/varset ${Group.Member[${i}].ID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
					}
				/next i
			}
		}
		/call Debug 3 "Leaving Sub ${CurrentSub}"
		/call BuffCheck ${TNameID}
	}
/return

Sub BuffQueue(buffid,buffnum)
	/call Debug 3 "Entering Sub BuffQueue"
	/varset CurrentSub BuffQueue
	/if (!${Defined[${buffid}BuffCheck]}) {
		/call Debug 3 "${buffid}BuffCheck undefined, calling BuffCheck on buffid ${buffid}"
		/call BuffCheck ${buffid}
	}
	/call Debug 3 "BuffQueue ${Spawn[${buffid}]} - ${BuffSpellIcon${buffnum}}"
	/declare i int local
	/declare j int local
	
    /for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_${BuffArray[${i},2]}}) {
			/if (${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) {
				/call BuffList ${BuffArray[${i},1]} ${BuffArray[${i},2]}
			}
			/call Debug 3 "BuffQueue Removing ${Spawn[${BuffArray[${i},1]}]} ${BuffSpellName${BuffArray[${i},2]}} from BuffQueue"
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${BuffArray[${i},1].Equal[${buffid}]} && ${BuffArray[${i},2].Equal[${buffnum}]}) /goto :skipq
		/if (${BuffArray[${i},1].Equal[0]} && !${j}) /varset j ${i}
	/next i
	/varset BuffArray[${j},1] ${buffid}
	/varset BuffArray[${j},2] ${buffnum}
	:skipq
	/call Debug 3 "Leaving BuffQueue"
/return

Sub BuffCheck(int iID)
	/call Debug 3 "Entering Sub BuffCheck - iID: ${iID}"
	/call Debug 3 "Checking Buff for ${Spawn[${iID}]}"
	/varset CurrentSub BuffCheck
	/if (!${Defined[${iID}BuffCheck]}) /declare ${iID}BuffCheck int outer 1
	/declare x int local
	/declare t int local
	/declare d int local
	/declare b int local
	/declare q int local
	/declare i int local
	/squelch /tar id ${iID}
	/delay 1s ${Target.ID}==${iID}
	/delay 1s
	/declare z int
	/for z 1 to 45
		/varset TargetBuffCount 0
		/if (${Target.BuffDuration[${z}]}) /call BuffParse "${Target.Buff[${z}].Name.Arg[1,Rk.]}"
		/for q 1 to ${BuffTotal}
			/if (${BuffSpellIcon${q}.Find[${Target.Buff[${z}].Name.Arg[1,Rk.]}]}||${BuffType${q}.Find[${TargetBuff[${x},2]}]}) {
				/if (!${Defined[${iID}_Buff${q}]}) /declare ${iID}_Buff${q} timer outer
				/varset ${iID}_Buff${q} ${Math.Calc[6*${Target.BuffDuration[${z}]}].Int}
			}
		/next q
	/next z
	
	|** I'm trying to wrap my head about this, but I'm not understanding the point of it ~Chatwiththisname~ 
	 ** 40oz: not sure, looks like a way to setup timers to hand out buffs, 
	 **       but if the timer is never set to a time, it will never do anything
	 **|
	/for i 1 to ${BuffTotal}
		/for x 1 to ${BuffType${i}.Count[|]}
			/if (${${Target.ID}BuffString.Find[${BuffType${i}.Arg[${x},|]}]}) /goto :skip 
		/next x
		/if (!${Defined[${Target.ID}_Buff${i}]}) /declare ${Target.ID}_Buff${i} timer outer
		|/echo ${Target} needs ${BuffSpellIcon${i}}
		:skip
	/next i
/return

Sub BuffParse(buffname,int mybuff)
	/varset CurrentSub BuffParse
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/declare i int local
	/declare icon int local
	/varset BuffParsePH ${buffname}
	/varset UnknownBuff TRUE
	/if (!${Defined[${Target.ID}BuffString]}) /declare ${Target.ID}BuffString string outer
	/if (${Spell[${buffname}].Slot[1].Find[Increase Max Hitpoints]}) /call BuffArray Shielding ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Max Hitpoints]}) /call BuffArray ACHP ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[3].Find[Increase Max Hitpoints]}) /call BuffArray Symbol ${Spell[${buffname}].Icon} 3 ${mybuff} 
	/if (${Spell[${buffname}].Slot[4].Find[Increase Max Hitpoints]}) /call BuffArray HybridHP ${Spell[${buffname}].Icon} 4 ${mybuff} 
	/if (${Spell[${buffname}].Slot[5].Find[Increase Attack Speed]}) /call BuffArray Haste ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[1].Find[Increase Attack Speed]}) /call BuffArray Haste2 ${Spell[${buffname}].Icon} 1 ${mybuff} 
	/if (${Spell[${buffname}].Slot[2].Find[Increase Mana by]}) /call BuffArray Clarity ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Hitpoints by]} && ${Spell[${buffname}].Slot[1].Find[per tick]}) /call BuffArray Regen ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase ATK by ]}) /call BuffArray Attack ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase AC by ]}) /call BuffArray AC1 ${Spell[${buffname}].Icon} 2 ${mybuff}	
	/if (${Spell[${buffname}].Slot[3].Find[Increase AC by ]}) /call BuffArray AC2 ${Spell[${buffname}].Icon} 3 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Damage Shield by ]}) /call BuffArray DS1 ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Damage Shield by ]}) /call BuffArray DS2 ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Mitigate Melee Damage by ]}) /call BuffArray Mitigate ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${UnknownBuff} && ${mybuff}) /call BuffArray Unknown ${Spell[${buffname}].Icon} 0 ${mybuff}
/return

Sub BuffArray(buffarrayname,int buffarrayicon,int buffarrayslot,int myarraybuff)
	/varset CurrentSub BuffArray
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/varset UnknownBuff FALSE
	/if (!${myarraybuff}) {
		/if (!${Defined[${Target.ID}_${Spell[${BuffParsePH}].ID}]}) /declare ${Target.ID}_${Spell[${BuffParsePH}].ID} string outer
		/varset ${Target.ID}_${Spell[${BuffParsePH}].ID} ${${Target.ID}_${Spell[${BuffParsePH}].ID}}${buffarrayname}|
		/varset ${Target.ID}BuffString ${${Target.ID}BuffString}${buffarrayname}|
		/varcalc TargetBuffCount ${TargetBuffCount}+1
		/varset TargetBuff[${TargetBuffCount},1] ${Target.CleanName}
		/varset TargetBuff[${TargetBuffCount},2] ${buffarrayname}
		/varset TargetBuff[${TargetBuffCount},3] ${buffarrayicon}
		/varset TargetBuff[${TargetBuffCount},4] ${buffarrayslot}
		/varset TargetBuff[${TargetBuffCount},5] ${BuffParsePH}
	}

	/if (${myarraybuff}) {
		/varset MyBuffString ${MyBuffString}${buffarrayname}|
		/varcalc MyBuffCount ${MyBuffCount}+1
		/varset MyBuff[${MyBuffCount},1] ${BuffSpellIcon${myarraybuff}}
		/varset MyBuff[${MyBuffCount},2] ${buffarrayname}
		/varset MyBuff[${MyBuffCount},3] ${buffarrayicon}
		/varset MyBuff[${MyBuffCount},4] ${buffarrayslot}
		/varset BuffType${myarraybuff} ${BuffType${myarraybuff}}${buffarrayname}|
	}
/return

Sub Event_BuffWornOff(Line,string SpellWornOff,string ChatSender)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
   	/varset ChatSenderHold ${Spawn[${ChatSender}].CleanName.Replace[ ,]}
   	/varset SpellHold ${SpellWornOff}
   	/declare b int local
   	/declare bf int local
   	/for b 1 to ${BuffTotal}
  		/if (${SpellHold.Find[${BuffSpellIcon${b}}]}||${SpellHold.Find[${BuffSpellName${b}}]}) {
			/varset bf ${b}
			/goto :buffdetected
		}
	/next b
   	/if (!${bf}) /return

   	:buffdetected
   	/if (!${Defined[${Spawn[${ChatSender}].ID}_Buff${bf}]}) /declare ${Spawn[${ChatSender}].ID}_Buff${bf} timer outer
   	/varset ${Spawn[${ChatSender}].ID}_Buff${bf} 0
/return

Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${EQBCCommand.Left[2].Equal[//]}) /return
  	/if (${EQBCCommand.Left[1].Equal[/]}) {
    	/docommand ${EQBCCommand}
  	} else {
    	/call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
  	}
/return

Sub Event_CastSpell(string line,string ChatSender,string SName,string TName)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
	/varset ChatSenderHold ${ChatSender}
 	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
	/if (${SName.Equal[ivuon]}) {
		/call Event_InvisUndeadOn
		/return
	}
	/if (${SName.Equal[invison]}) {
		/call Event_InvisOn
		/return
	}
	/if (${SName.Equal[invisoff]}) {
		/call Event_InvisOff
		/return
	}
	/if (${SName.Equal[levon]}) {
		/call Event_LevitateOn
		/return
	}
	/if (${SName.Equal[levoff]}) {
		/call Event_LevitateOff
		/return
	}
	/if (${SName.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "1"
		/return
	}
	/if (${SName.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSenderHold}"
		/return
	}
	/if (${SName.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "0"
		/return
	}

	/declare b int local
	/for b 1 to ${BuffTotal}
		/if (${BuffAlias${b}.Find[|${SName}|]}) {
			/if (${TName.Length}) {
				/if (${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[pc ${TName}].ID}" "${b}"
				/if (!${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[${TName}].ID}" "${b}"
			} else {
				/if (!${line.Find[ on ]}) {
					/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[pc ${ChatSenderHold}].ID}" "${b}"
					/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[${ChatSenderHold}].ID}" "${b}"
				}
				/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[pc ${ChatSenderHold}].ID}
				/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[${ChatSenderHold}].ID}
			}
		}
	/next b

/return

Sub Event_InvisOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisSpell}]} || ${InvisSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisSpell}]} || ${InvisSpellGem.Equal[item]} && !${FindItem[${InvisSpell}].Timer}) {
  		/if (${Spell[${InvisSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisSpell}].ID}
  	  	/if (!${InvisSpellGem.Equal[alt]}) /call Cast "${InvisSpell}" ${InvisSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisUndeadOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[item]} && !${FindItem[${InvisUndeadSpell}].Timer}) {
  		/if (${Spell[${InvisUndeadSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisUndeadSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisUndeadSpell}].ID}
  	  	/if (!${InvisUndeadSpellGem.Equal[alt]}) /call Cast "${InvisUndeadSpell}" ${InvisUndeadSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisOff
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
    /declare invisid int local
    /if (${Target.ID}) /varset invisid ${Target.ID}
    /squelch /tar clear
    /squelch /attack on
    /delay 1
    /squelch /attack off
    /if (${invisid} && ${Spawn[${invisid}.Type.NotEqual[corpse]}) /squelch /tar id ${invisid}
    /if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloud of Indifference].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloud of Indifference].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisUndeadSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloak of Shadows].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloak of Shadows].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Group Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Group Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Shauri's Sonorous Clouding].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shauri's Sonorous Clouding].ID}-1].Int} leftmouseup
/return

Sub Event_LevitateOn
  	/if (${Me.Book[${LevitateSpell}]} || ${LevitateSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${LevitateSpell}]} || ${LevitateSpellGem.Equal[item]} && !${FindItem[${LevitateSpell}].Timer}) {
		/if (${Spell[${LevitateSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
			/delay 3s ${Target.ID}==${Me.ID}
		}

		/if (${LevitateSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${LevitateSpell}].ID}
		/if (!${LevitateSpellGem.Equal[alt]}) /call Cast "${LevitateSpell}" ${LevitateSpellGem} 5s
		/delay 5
  	}
/return

Sub Event_LevitateOff
  	/if (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfect Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[Group Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[${LevitateSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${LevitateSpell}].ID}-1].Int} leftmouseup
/return

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/declare b int local
  	/declare i int local
	/varset ChatSenderHold ${ChatSender}
	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
  	/if (${ChatText.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSender}" "1"
		/return
	}
  	/if (${ChatText.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSender}" "0"
		/return
	}
	/if (${ChatText.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSender}"
		/return
	}

  	/if (!${Spawn[pc ${ChatSender}].ID}) {
		/return
	}
  	/if (${BuffTotal} && ${ChatSender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${ChatSender}].ID}) {
    	/for b 1 to ${BuffTotal}
        	/if (${BuffAlias${b}.Find[${ChatText}]}) {
            	/call BuffList "${Spawn[pc ${ChatSender}].ID}" "${b}"
         	}
    	/next b
    }
/return

|Buff end
 
While this macro is still a while off being ready for use again. I have fixed the buff subroutines:

Code:
|Buff start

#chat bc
#chat EQBC

#event EQBC                  	"<#1#> #2#"
#event EQBC                   	"[#1#(msg)] #2#"
#event CastSpell  	      	"#1# tells the group#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the group#*#, '#2#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2#'"
#event CastSpell              	"#1# tells you#*#, '#2# on #3#'"
#event CastSpell              	"#1# tells you#*#, '#2#'"
#event CastSpell              	"#1# told you, '#2#'"
#event CastSpell            	"#1# told you, '#2# on #3#'"
#event InvisOn                  "#*#invison#*#"
#event InvisUndeadOn            "#*#ivuon#*#"
#event InvisOff                 "#*#invisoff#*#"
#event LevitateOn            	"#*#levon#*#"
#event LevitateOff              "#*#levoff#*#"
#event BuffWornOff 		"Your #1# spell has worn off of #2#."

Sub BuffLoad
	/varset CurrentSub Buff
	/if (!${Defined[BuffLoaded]}) /declare BuffLoaded bool outer FALSE
	/if (${BuffLoaded}) /return
	/call Debug 3 "Entering ${CurrentSub}Load"
	/varset BuffLoaded TRUE
	/declare i int local 3
	/declare b int local
	/declare x string local
	
	|** Changed to if/then/else because it can't be all of them. **|
	/if (${Select[${Me.Class.ShortName},SHD,MNK,ROG,BER,WAR,NEC]}) {
		/varset i 1
	} else /if (${Select[${Me.Class.ShortName},SHM,PAL,BST,MAG]}) {
		/varset i 7
	} else 	/if (${Select[${Me.Class.ShortName},RNG,CLR,ENC]}) {
		/varset i 10
	} else /if (${Select[${Me.Class.ShortName},BRD]}) {
		/varset i 1
	}
	
	/if (!${Defined[BuffXTargets]}) /declare BuffXTargets bool outer ${Ini[MyIni,Buff,BuffXTargets,FALSE]}
	/if (!${BuffXTargets}) /mmoini "MyIni" "Buff" "BuffXTargets" "FALSE"
	/if (!${Defined[BuffPets]}) /declare BuffPets bool outer ${Ini[MyIni,Buff,BuffPets,FALSE]}
	/if (!${BuffPets}) /mmoini "MyIni" "Buff" "BuffPets" "FALSE"
	/if (!${Defined[AutoInvis]}) /declare AutoInvis bool outer ${Ini[MyIni,Buff,AutoInvis,FALSE]}
	/if (!${AutoInvis}) /mmoini "MyIni" "Buff" "AutoInvis" "FALSE"
	/if (!${Defined[AutoBreakInvis]}) /declare AutoBreakInvis bool outer ${Ini[MyIni,Buff,AutoBreakInvis,FALSE]}
	/if (!${AutoBreakInvis}) /mmoini "MyIni" "Buff" "AutoBreakInvis" "FALSE"
	
	/varset tempsubtotal ${Ini[MyIni,${CurrentSub},${CurrentSub}Total]}
	
	/if (${NeedLoad} && !${tempsubtotal}) {
		/for b 1 to ${AAInvis.Count[|]} 
			/if (${Me.AltAbility[${AAInvis.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvis.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem"
		/varset x
		/for b 1 to ${AAInvisUndead.Count[|]} 
			/if (${Me.AltAbility[${AAInvisUndead.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvisUndead.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem"
		/varset x
		/for b 1 to ${AALevitate.Count[|]}
			/if (${Me.AltAbility[${AALevitate.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AALevitate.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem"
		/call SpellLoad "${CurrentSub}" ${i} "|1|3|4|5|6|25|24|30|" "|0|TRUE|PH|PH|PH|PH|BER,BRD,BST,CLR,DRU,ENC,MAG,MNK,NEC,PAL,RNG,ROG,SHD,SHM,WAR,WIZ|PH|"
	}

	/call SpellLoad2 "${CurrentSub}" "3|4|5|6|25|24|30|"
	/declare BuffArray[50,2] string outer 0
	/declare BuffQueueString string outer
	/declare BuffTimerString string outer
	/declare MyBuffString string outer
	/declare TargetBuff[45,5] string outer
	/declare TargetBuffCount int outer
	/declare UnknownBuff bool outer
	/declare BuffParsePH string outer
	/declare MyBuffCount int outer


	/declare MyBuff[50,4] string outer
	/for i 1 to ${BuffTotal}
		/declare BuffType${i} string outer
		/if (!${Defined[BuffSpellIcon${i}]}) /declare BuffSpellIcon${i} string outer
		/call BuffParse "${BuffSpellIcon${i}}" ${i}
		/varset BuffQueueString ${BuffQueueString}${BuffSpellIcon${i}}|
	/next i
	
	/if (!${Defined[BuffCheckTimer]}) /declare BuffCheckTimer timer outer 1s
	/if (!${Defined[BuffString1]}) /declare BuffString1 string outer
	/if (!${Defined[BuffString2]}) /declare BuffString2 string outer
	/if (!${Defined[BuffTimerString]}) /declare BuffTimerString string outer
	/if (!${Defined[iTargetBuff]}) /declare iTargetBuff int outer
	/if (!${Defined[InitialBuffList]}) /declare InitialBuffList string outer
	/if (!${Defined[ChatSenderHold]}) /declare ChatSenderHold string outer
	/if (!${Defined[SpellHold]}) /declare SpellHold string outer
	/if (!${Defined[timehold]}) /declare timehold timer outer
	/if (!${Defined[InvisSpell]}) /declare InvisSpell string outer ${Ini[MyIni,${CurrentSub},InvisSpell]}
	/if (!${Defined[InvisSpellGem]}) /declare InvisSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisSpellGem]}
	/if (!${Defined[InvisUndeadSpell]}) /declare InvisUndeadSpell string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpell]}
	/if (!${Defined[InvisUndeadSpellGem]}) /declare InvisUndeadSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpellGem]}
	/if (!${Defined[LevitateSpell]}) /declare LevitateSpell string outer ${Ini[MyIni,${CurrentSub},LevitateSpell]}
	/if (!${Defined[LevitateSpellGem]}) /declare LevitateSpellGem string outer ${Ini[MyIni,${CurrentSub},LevitateSpellGem]}
	/if (!${Defined[BuffExtension]}) /declare BuffExtension float outer
	
	|** Convert to if else statement, it can't be both, no need to evaluate both every time. Also adjusted for AugSlot2 and Augslot3 to avoid false negative.**|
	|** Was using Depreciated syntax, updated from ${InvSlot[back].AugSlot1} to current **|
	|** There was no base case (IE: You have neither aug slot or no back item. This is what was making the timer 0.) **|
	|** Added a boolean check to see if the back item had a spell on it to avoid a false positive for lower level characters **|
	/if (${Bool[${Me.Inventory[back].Spell}]}) {
		/if (${Me.Inventory[back].AugSlot1} == 7 || ${Me.Inventory[back].AugSlot2} == 7 || ${Me.Inventory[back].AugSlot3} == 7) {
			/varset BuffExtension 1.26
		} else /if (${Me.Inventory[back].AugSlot1} == 8 || ${Me.Inventory[back].AugSlot2} == 8 || ${Me.Inventory[back].AugSlot3} == 8) {
			/varset BuffExtension 1.35
		}
	} else {
		/varset BuffExtension 1
	}
	
	|** Calculate Spell Casting Reinforcement in reverse order in /if then else statements to reduce total needed parses at higher levels **|
	/if (${Me.AltAbility[Spell Casting Reinforcement]}>=28) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=20) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=12) {
		/varcalc BuffExtension ${BuffExtension}+.15
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=6) {
		/varcalc BuffExtension ${BuffExtension}+.10
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=2) {
		/varcalc BuffExtension ${BuffExtension}+.05
	}
	
	/call Debug 3 "Leaving ${CurrentSub}Load"
/return

Sub Buff
	/varset CurrentSub Buff
	/call Debug 3 "Entering Sub ${CurrentSub} The real one."
	/if (!${Defined[${CurrentSub}Loaded]}) {
		/call Debug 3 "${CurrentSub}Loaded not defined, calling BuffLoad"
		/call BuffLoad
	}
	
	/declare i int local
	/declare b int local
	/if (!${BuffTotal}||${Me.Hovering}||${Window[tradewnd].Open}||${Window[lootwnd].Open}) /return
	/if (${${CurrentSub}Conditions.NotEqual[123456]}) /varset ${CurrentSub}Conditions ${Ini[MyIni,${CurrentSub},${CurrentSub}Conditions,123456]}
	/if (!${${CurrentSub}Conditions}) /return
	/for b 1 to ${BuffTotal}
		/if (!${BuffUse${b}}) /goto :skipbuff
		/if (${BuffConditions${b}.NotEqual[123456]}) /varset BuffConditions${b} ${Ini[MyIni,Buff,BuffConditions${b},1]}
		/if (!${Defined[${Me.ID}_Buff${b}]}) /declare ${Me.ID}_Buff${b} timer outer 0
		/if	(!${${Me.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Me.Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.ID} ${b}
		/if (${BuffPets} && ${Me.Pet.ID} && ${BuffClasses${b}.Find[${Me.Pet.Class.ShortName}]} && ${Spawn[${Me.Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Me.Pet.ID} ${b}
		/if (!${Group}) /goto :skipgroup
		/for i 1 to ${Group}
			/if (!${Defined[${Group.Member[${i}].ID}_Buff${b}]}) /declare ${Group.Member[${i}].ID}_Buff${b} timer outer 0
			/if (!${${Group.Member[${i}].ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Class.ShortName}]} && ${Spawn[${Group.Member[${i}].ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].ID} ${b}
			/if (!${Defined[${Group.Member[${i}].Pet.ID}_Buff${b}]}) /declare ${Group.Member[${i}].Pet.ID}_Buff${b} timer outer 0
			/if (${BuffPets} && !${Group.Member[${i}].Pet.Name.Find[Familiar]} && !${Group.Member[${i}].Pet.Name.Find[_pet]} && ${Group.Member[${i}].Pet.ID} && !${${Group.Member[${i}].Pet.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Pet.Class.ShortName}]} && ${Spawn[${Group.Member[${i}].Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].Pet.ID} ${b}
		/next i

		:skipgroup
		/if (!${BuffConditions${b}}) /goto :skipbuff
		/for i 2 to ${XTarget.Max}
			/if (!${Defined[${Me.XTarget[${i}].ID}_Buff${b}]}) /declare ${Me.XTarget[${i}].ID}_Buff${b} timer outer 0
			/if (${BuffXTargets}) {
				/if (${Me.XTarget[${i}].ID}) {
					/if (!${${Me.XTarget[${i}].ID}_Buff${b}} && (${Select[${Spawn[${Me.XTarget[${i}].ID}].Type},pc,mercenary]}||${Spawn[${Me.XTarget[${i}].ID}].Master.Type.Equal[pc]}) && ${Spawn[${Me.XTarget[${i}].ID}].Distance}<=100 && ${Me.XTarget[${i}].Type.NotEqual[auto hater]} && ${BuffClasses${b}.Find[${Me.XTarget[${i}].Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.XTarget[${i}].ID} ${b}
				}
			}
		/next i

		:skipbuff
	/next b

	/for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_Buff${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}}) {
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/if (${Spawn[${BuffArray[${i},1]}].ID} && ${Spawn[${BuffArray[${i},1]}].Distance}<100) {
			/call Debug 3 "/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}""
			/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}"
		}
	/next i
	/call Debug 3 "Leaving Sub ${CurrentSub}"
/return

Sub BuffList(int TNameID, int iB)
	/varset CurrentSub BuffList
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/call BuffCheck ${TNameID}
	/declare i int local
	/if (${Me.Book[${BuffSpellName${iB}}]} && !${If[${Me.SpellReady[${BuffSpellName${iB}}]},TRUE,FALSE]} && ${BuffSpellGem${iB}.Find[gem]}) {
		/memorize "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}"
		:gemwait
		/doevents
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/delay 2
		/if (!${Me.SpellReady[${BuffSpellName${iB}}]}) /goto :gemwait
	}
	/if ((${Me.SpellReady[${BuffSpellName${iB}}]}||${Me.AltAbilityReady[${BuffSpellName${iB}}]}||${FindItem[${BuffSpellName${iB}}].ItemSlot} && !${FindItem[${BuffSpellName${iB}}].Timer}) && !${${TNameID}_Buff${iB}}) {
		/if (${Spawn[id ${TNameID}].Type.Equal[corpse]}) /return
		/if (${Spawn[id ${TNameID}].ID}) /squelch /tar id ${TNameID}
		/delay 1s ${Target.ID}==${TNameID}
		/call ${EchoSub} "${Pink} ${BuffSpellName${iB}} --> ${White} ${Target.CleanName}"
    	/if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
		/if (!${Defined[BuffListAnnounce]}) /declare BuffListAnnounce bool outer FALSE
    	/if (${BuffListAnnounce} && ${AnnounceChannel.NotEqual[NULL]}) /docommand /${AnnounceChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
    	/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && ${Me.AltAbilityReady[Tranquil Blessings]} && (${Me.CombatState.Equal[Active]}||${Me.CombatState.Equal[RESTING]})) /alt act ${Me.AltAbility[Tranquil Blessings].ID}
		/call Cast "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}" 0 CheckStuff
		/delay 30s !${Me.Casting.ID}
		/if (!${Defined[${TNameID}_Buff${iB}]}) {
			/declare ${TNameID}_Buff${iB} timer outer
			/call Debug 3 "Defined a new timer for ${TNameID}_Buff${iB} for ${${TNameID}_Buff${iB}}"
		}
		/if (${Macro.Return.Equal[CAST_NOTHOLD]}||${Macro.Return.Equal[CAST_SUCCESS]}) {
			/if (!${Defined[${TNameID}_Buff${iB}]}) /declare ${TNameID}_Buff${iB} timer outer
			/varset ${TNameID}_Buff${iB} ${Spell[${BuffSpellName${iB}}].Duration}s
			/varset ${TNameID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
			/call Debug 3 "${Math.Calc[${${TNameID}_Buff${iB}}/10/60].Int} Minute timer set."
			/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && (${SpawnCount[group ${Target.CleanName}]}||!${Target.ID})) {
				/for i 0 to ${Group}
					/if (${Group.Member[${i}].Distance}<${Spell[${BuffSpellName${iB}}].AERange}) {
						/if (!${Defined[${Group.Member[${i}].ID}_Buff${iB}]}) /declare ${Group.Member[${i}].ID}_Buff${iB} timer outer
						/varset ${Group.Member[${i}].ID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
					}
				/next i
			}
		}
		/call Debug 3 "Leaving Sub ${CurrentSub}"
		/call BuffCheck ${TNameID}
	}
/return

Sub BuffQueue(buffid,buffnum)
	/call Debug 3 "Entering Sub BuffQueue"
	/varset CurrentSub BuffQueue
	/if (!${Defined[${buffid}BuffCheck]}) {
		/call Debug 3 "${buffid}BuffCheck undefined, calling BuffCheck on buffid ${buffid}"
		/call BuffCheck ${buffid}
	}
	/call Debug 3 "BuffQueue ${Spawn[${buffid}]} - ${BuffSpellIcon${buffnum}}"
	/declare i int local
	/declare j int local
	
    /for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_${BuffArray[${i},2]}}) {
			/if (${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) {
				/call BuffList ${BuffArray[${i},1]} ${BuffArray[${i},2]}
			}
			/call Debug 3 "BuffQueue Removing ${Spawn[${BuffArray[${i},1]}]} ${BuffSpellName${BuffArray[${i},2]}} from BuffQueue"
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${BuffArray[${i},1].Equal[${buffid}]} && ${BuffArray[${i},2].Equal[${buffnum}]}) /goto :skipq
		/if (${BuffArray[${i},1].Equal[0]} && !${j}) /varset j ${i}
	/next i
	/varset BuffArray[${j},1] ${buffid}
	/varset BuffArray[${j},2] ${buffnum}
	:skipq
	/call Debug 3 "Leaving BuffQueue"
/return

Sub BuffCheck(int iID)
	/call Debug 3 "Entering Sub BuffCheck - iID: ${iID}"
	/call Debug 3 "Checking Buff for ${Spawn[${iID}]}"
	/varset CurrentSub BuffCheck
	/if (!${Defined[${iID}BuffCheck]}) /declare ${iID}BuffCheck int outer 1
	/declare x int local
	/declare t int local
	/declare d int local
	/declare b int local
	/declare q int local
	/declare i int local
	/squelch /tar id ${iID}
	/delay 1s ${Target.ID}==${iID}
	/delay 1s
	/declare z int
	/for z 1 to 45
		/varset TargetBuffCount 0
		/if (${Target.BuffDuration[${z}]}) /call BuffParse "${Target.Buff[${z}].Name.Arg[1,Rk.]}"
		/for q 1 to ${BuffTotal}
			/if (${BuffSpellIcon${q}.Find[${Target.Buff[${z}].Name.Arg[1,Rk.]}]}||${BuffType${q}.Find[${TargetBuff[${x},2]}]}) {
				/if (!${Defined[${iID}_Buff${q}]}) /declare ${iID}_Buff${q} timer outer
				/varset ${iID}_Buff${q} ${Math.Calc[6*${Target.BuffDuration[${z}]}].Int}
			}
		/next q
	/next z
	
	|** I'm trying to wrap my head about this, but I'm not understanding the point of it ~Chatwiththisname~ 
	 ** 40oz: not sure, looks like a way to setup timers to hand out buffs, 
	 **       but if the timer is never set to a time, it will never do anything
	 **|
	/for i 1 to ${BuffTotal}
		/for x 1 to ${BuffType${i}.Count[|]}
			/if (${${Target.ID}BuffString.Find[${BuffType${i}.Arg[${x},|]}]}) /goto :skip 
		/next x
		/if (!${Defined[${Target.ID}_Buff${i}]}) /declare ${Target.ID}_Buff${i} timer outer
		|/echo ${Target} needs ${BuffSpellIcon${i}}
		:skip
	/next i
/return

Sub BuffParse(buffname,int mybuff)
	/varset CurrentSub BuffParse
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/declare i int local
	/declare icon int local
	/varset BuffParsePH ${buffname}
	/varset UnknownBuff TRUE
	/if (!${Defined[${Target.ID}BuffString]}) /declare ${Target.ID}BuffString string outer
	/if (${Spell[${buffname}].Slot[1].Find[Increase Max Hitpoints]}) /call BuffArray Shielding ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Max Hitpoints]}) /call BuffArray ACHP ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[3].Find[Increase Max Hitpoints]}) /call BuffArray Symbol ${Spell[${buffname}].Icon} 3 ${mybuff} 
	/if (${Spell[${buffname}].Slot[4].Find[Increase Max Hitpoints]}) /call BuffArray HybridHP ${Spell[${buffname}].Icon} 4 ${mybuff} 
	/if (${Spell[${buffname}].Slot[5].Find[Increase Attack Speed]}) /call BuffArray Haste ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[1].Find[Increase Attack Speed]}) /call BuffArray Haste2 ${Spell[${buffname}].Icon} 1 ${mybuff} 
	/if (${Spell[${buffname}].Slot[2].Find[Increase Mana by]}) /call BuffArray Clarity ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Hitpoints by]} && ${Spell[${buffname}].Slot[1].Find[per tick]}) /call BuffArray Regen ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase ATK by ]}) /call BuffArray Attack ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase AC by ]}) /call BuffArray AC1 ${Spell[${buffname}].Icon} 2 ${mybuff}	
	/if (${Spell[${buffname}].Slot[3].Find[Increase AC by ]}) /call BuffArray AC2 ${Spell[${buffname}].Icon} 3 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Damage Shield by ]}) /call BuffArray DS1 ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Damage Shield by ]}) /call BuffArray DS2 ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Mitigate Melee Damage by ]}) /call BuffArray Mitigate ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${UnknownBuff} && ${mybuff}) /call BuffArray Unknown ${Spell[${buffname}].Icon} 0 ${mybuff}
/return

Sub BuffArray(buffarrayname,int buffarrayicon,int buffarrayslot,int myarraybuff)
	/varset CurrentSub BuffArray
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/varset UnknownBuff FALSE
	/if (!${myarraybuff}) {
		/if (!${Defined[${Target.ID}_${Spell[${BuffParsePH}].ID}]}) /declare ${Target.ID}_${Spell[${BuffParsePH}].ID} string outer
		/varset ${Target.ID}_${Spell[${BuffParsePH}].ID} ${${Target.ID}_${Spell[${BuffParsePH}].ID}}${buffarrayname}|
		/varset ${Target.ID}BuffString ${${Target.ID}BuffString}${buffarrayname}|
		/varcalc TargetBuffCount ${TargetBuffCount}+1
		/varset TargetBuff[${TargetBuffCount},1] ${Target.CleanName}
		/varset TargetBuff[${TargetBuffCount},2] ${buffarrayname}
		/varset TargetBuff[${TargetBuffCount},3] ${buffarrayicon}
		/varset TargetBuff[${TargetBuffCount},4] ${buffarrayslot}
		/varset TargetBuff[${TargetBuffCount},5] ${BuffParsePH}
	}

	/if (${myarraybuff}) {
		/varset MyBuffString ${MyBuffString}${buffarrayname}|
		/varcalc MyBuffCount ${MyBuffCount}+1
		/varset MyBuff[${MyBuffCount},1] ${BuffSpellIcon${myarraybuff}}
		/varset MyBuff[${MyBuffCount},2] ${buffarrayname}
		/varset MyBuff[${MyBuffCount},3] ${buffarrayicon}
		/varset MyBuff[${MyBuffCount},4] ${buffarrayslot}
		/varset BuffType${myarraybuff} ${BuffType${myarraybuff}}${buffarrayname}|
	}
/return

Sub Event_BuffWornOff(Line,string SpellWornOff,string ChatSender)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
   	/varset ChatSenderHold ${Spawn[${ChatSender}].CleanName.Replace[ ,]}
   	/varset SpellHold ${SpellWornOff}
   	/declare b int local
   	/declare bf int local
   	/for b 1 to ${BuffTotal}
  		/if (${SpellHold.Find[${BuffSpellIcon${b}}]}||${SpellHold.Find[${BuffSpellName${b}}]}) {
			/varset bf ${b}
			/goto :buffdetected
		}
	/next b
   	/if (!${bf}) /return

   	:buffdetected
   	/if (!${Defined[${Spawn[${ChatSender}].ID}_Buff${bf}]}) /declare ${Spawn[${ChatSender}].ID}_Buff${bf} timer outer
   	/varset ${Spawn[${ChatSender}].ID}_Buff${bf} 0
/return

Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${EQBCCommand.Left[2].Equal[//]}) /return
  	/if (${EQBCCommand.Left[1].Equal[/]}) {
    	/docommand ${EQBCCommand}
  	} else {
    	/call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
  	}
/return

Sub Event_CastSpell(string line,string ChatSender,string SName,string TName)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
	/varset ChatSenderHold ${ChatSender}
 	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
	/if (${SName.Equal[ivuon]}) {
		/call Event_InvisUndeadOn
		/return
	}
	/if (${SName.Equal[invison]}) {
		/call Event_InvisOn
		/return
	}
	/if (${SName.Equal[invisoff]}) {
		/call Event_InvisOff
		/return
	}
	/if (${SName.Equal[levon]}) {
		/call Event_LevitateOn
		/return
	}
	/if (${SName.Equal[levoff]}) {
		/call Event_LevitateOff
		/return
	}
	/if (${SName.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "1"
		/return
	}
	/if (${SName.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSenderHold}"
		/return
	}
	/if (${SName.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "0"
		/return
	}

	/declare b int local
	/for b 1 to ${BuffTotal}
		/if (${BuffAlias${b}.Find[|${SName}|]}) {
			/if (${TName.Length}) {
				/if (${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[pc ${TName}].ID}" "${b}"
				/if (!${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[${TName}].ID}" "${b}"
			} else {
				/if (!${line.Find[ on ]}) {
					/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[pc ${ChatSenderHold}].ID}" "${b}"
					/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[${ChatSenderHold}].ID}" "${b}"
				}
				/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[pc ${ChatSenderHold}].ID}
				/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[${ChatSenderHold}].ID}
			}
		}
	/next b

/return

Sub Event_InvisOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisSpell}]} || ${InvisSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisSpell}]} || ${InvisSpellGem.Equal[item]} && !${FindItem[${InvisSpell}].Timer}) {
  		/if (${Spell[${InvisSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisSpell}].ID}
  	  	/if (!${InvisSpellGem.Equal[alt]}) /call Cast "${InvisSpell}" ${InvisSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisUndeadOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[item]} && !${FindItem[${InvisUndeadSpell}].Timer}) {
  		/if (${Spell[${InvisUndeadSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisUndeadSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisUndeadSpell}].ID}
  	  	/if (!${InvisUndeadSpellGem.Equal[alt]}) /call Cast "${InvisUndeadSpell}" ${InvisUndeadSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisOff
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
    /declare invisid int local
    /if (${Target.ID}) /varset invisid ${Target.ID}
    /squelch /tar clear
    /squelch /attack on
    /delay 1
    /squelch /attack off
    /if (${invisid} && ${Spawn[${invisid}.Type.NotEqual[corpse]}) /squelch /tar id ${invisid}
    /if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloud of Indifference].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloud of Indifference].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisUndeadSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloak of Shadows].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloak of Shadows].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Group Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Group Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Shauri's Sonorous Clouding].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shauri's Sonorous Clouding].ID}-1].Int} leftmouseup
/return

Sub Event_LevitateOn
  	/if (${Me.Book[${LevitateSpell}]} || ${LevitateSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${LevitateSpell}]} || ${LevitateSpellGem.Equal[item]} && !${FindItem[${LevitateSpell}].Timer}) {
		/if (${Spell[${LevitateSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
			/delay 3s ${Target.ID}==${Me.ID}
		}

		/if (${LevitateSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${LevitateSpell}].ID}
		/if (!${LevitateSpellGem.Equal[alt]}) /call Cast "${LevitateSpell}" ${LevitateSpellGem} 5s
		/delay 5
  	}
/return

Sub Event_LevitateOff
  	/if (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfect Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[Group Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[${LevitateSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${LevitateSpell}].ID}-1].Int} leftmouseup
/return

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/declare b int local
  	/declare i int local
	/varset ChatSenderHold ${ChatSender}
	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
  	/if (${ChatText.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSender}" "1"
		/return
	}
  	/if (${ChatText.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSender}" "0"
		/return
	}
	/if (${ChatText.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSender}"
		/return
	}

  	/if (!${Spawn[pc ${ChatSender}].ID}) {
		/return
	}
  	/if (${BuffTotal} && ${ChatSender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${ChatSender}].ID}) {
    	/for b 1 to ${BuffTotal}
        	/if (${BuffAlias${b}.Find[${ChatText}]}) {
            	/call BuffList "${Spawn[pc ${ChatSender}].ID}" "${b}"
         	}
    	/next b
    }
/return

|Buff end

Wasn't aware it was broken. 30 downloads of my last update. No real input about the buffs, which was what the fix was targeted at. I can look at assisting.

What exactly was broken and what did you fix?
 
Could use more information on assist issues. There are different types of assist.

/assisttype [1|2|3|4] <-- toggles assist type. 1 = /assist, 2 = pick own target, 3 = use XTarget1 as your kill target, 4 = use netbots to pick target

According to the macro these are the assist types available. In cases where assist isn't working, which assist type is being used.

Please verify and get back to me. Thanks.
 
While this macro is still a while off being ready for use again. I have fixed the buff subroutines:

Code:
|Buff start

#chat bc
#chat EQBC

#event EQBC                  	"<#1#> #2#"
#event EQBC                   	"[#1#(msg)] #2#"
#event CastSpell  	      	"#1# tells the group#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the group#*#, '#2#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2# on #3#'"
#event CastSpell  	      	"#1# tells the fellowship#*#, '#2#'"
#event CastSpell              	"#1# tells you#*#, '#2# on #3#'"
#event CastSpell              	"#1# tells you#*#, '#2#'"
#event CastSpell              	"#1# told you, '#2#'"
#event CastSpell            	"#1# told you, '#2# on #3#'"
#event InvisOn                  "#*#invison#*#"
#event InvisUndeadOn            "#*#ivuon#*#"
#event InvisOff                 "#*#invisoff#*#"
#event LevitateOn            	"#*#levon#*#"
#event LevitateOff              "#*#levoff#*#"
#event BuffWornOff 		"Your #1# spell has worn off of #2#."

Sub BuffLoad
	/varset CurrentSub Buff
	/if (!${Defined[BuffLoaded]}) /declare BuffLoaded bool outer FALSE
	/if (${BuffLoaded}) /return
	/call Debug 3 "Entering ${CurrentSub}Load"
	/varset BuffLoaded TRUE
	/declare i int local 3
	/declare b int local
	/declare x string local
	
	|** Changed to if/then/else because it can't be all of them. **|
	/if (${Select[${Me.Class.ShortName},SHD,MNK,ROG,BER,WAR,NEC]}) {
		/varset i 1
	} else /if (${Select[${Me.Class.ShortName},SHM,PAL,BST,MAG]}) {
		/varset i 7
	} else 	/if (${Select[${Me.Class.ShortName},RNG,CLR,ENC]}) {
		/varset i 10
	} else /if (${Select[${Me.Class.ShortName},BRD]}) {
		/varset i 1
	}
	
	/if (!${Defined[BuffXTargets]}) /declare BuffXTargets bool outer ${Ini[MyIni,Buff,BuffXTargets,FALSE]}
	/if (!${BuffXTargets}) /mmoini "MyIni" "Buff" "BuffXTargets" "FALSE"
	/if (!${Defined[BuffPets]}) /declare BuffPets bool outer ${Ini[MyIni,Buff,BuffPets,FALSE]}
	/if (!${BuffPets}) /mmoini "MyIni" "Buff" "BuffPets" "FALSE"
	/if (!${Defined[AutoInvis]}) /declare AutoInvis bool outer ${Ini[MyIni,Buff,AutoInvis,FALSE]}
	/if (!${AutoInvis}) /mmoini "MyIni" "Buff" "AutoInvis" "FALSE"
	/if (!${Defined[AutoBreakInvis]}) /declare AutoBreakInvis bool outer ${Ini[MyIni,Buff,AutoBreakInvis,FALSE]}
	/if (!${AutoBreakInvis}) /mmoini "MyIni" "Buff" "AutoBreakInvis" "FALSE"
	
	/varset tempsubtotal ${Ini[MyIni,${CurrentSub},${CurrentSub}Total]}
	
	/if (${NeedLoad} && !${tempsubtotal}) {
		/for b 1 to ${AAInvis.Count[|]} 
			/if (${Me.AltAbility[${AAInvis.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvis.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisSpellGem"
		/varset x
		/for b 1 to ${AAInvisUndead.Count[|]} 
			/if (${Me.AltAbility[${AAInvisUndead.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AAInvisUndead.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "InvisUndeadSpellGem"
		/varset x
		/for b 1 to ${AALevitate.Count[|]}
			/if (${Me.AltAbility[${AALevitate.Arg[${b},|]}]} && !${Spell[${x}].TargetType.Find[group]}) /varset x ${AALevitate.Arg[${b},|]}
		/next b
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell" "${x}"
		/if (${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem" "alt"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpell"
		/if (!${x.Length})	/mmoini "MyIni" "${CurrentSub}" "LevitateSpellGem"
		/call SpellLoad "${CurrentSub}" ${i} "|1|3|4|5|6|25|24|30|" "|0|TRUE|PH|PH|PH|PH|BER,BRD,BST,CLR,DRU,ENC,MAG,MNK,NEC,PAL,RNG,ROG,SHD,SHM,WAR,WIZ|PH|"
	}

	/call SpellLoad2 "${CurrentSub}" "3|4|5|6|25|24|30|"
	/declare BuffArray[50,2] string outer 0
	/declare BuffQueueString string outer
	/declare BuffTimerString string outer
	/declare MyBuffString string outer
	/declare TargetBuff[45,5] string outer
	/declare TargetBuffCount int outer
	/declare UnknownBuff bool outer
	/declare BuffParsePH string outer
	/declare MyBuffCount int outer


	/declare MyBuff[50,4] string outer
	/for i 1 to ${BuffTotal}
		/declare BuffType${i} string outer
		/if (!${Defined[BuffSpellIcon${i}]}) /declare BuffSpellIcon${i} string outer
		/call BuffParse "${BuffSpellIcon${i}}" ${i}
		/varset BuffQueueString ${BuffQueueString}${BuffSpellIcon${i}}|
	/next i
	
	/if (!${Defined[BuffCheckTimer]}) /declare BuffCheckTimer timer outer 1s
	/if (!${Defined[BuffString1]}) /declare BuffString1 string outer
	/if (!${Defined[BuffString2]}) /declare BuffString2 string outer
	/if (!${Defined[BuffTimerString]}) /declare BuffTimerString string outer
	/if (!${Defined[iTargetBuff]}) /declare iTargetBuff int outer
	/if (!${Defined[InitialBuffList]}) /declare InitialBuffList string outer
	/if (!${Defined[ChatSenderHold]}) /declare ChatSenderHold string outer
	/if (!${Defined[SpellHold]}) /declare SpellHold string outer
	/if (!${Defined[timehold]}) /declare timehold timer outer
	/if (!${Defined[InvisSpell]}) /declare InvisSpell string outer ${Ini[MyIni,${CurrentSub},InvisSpell]}
	/if (!${Defined[InvisSpellGem]}) /declare InvisSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisSpellGem]}
	/if (!${Defined[InvisUndeadSpell]}) /declare InvisUndeadSpell string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpell]}
	/if (!${Defined[InvisUndeadSpellGem]}) /declare InvisUndeadSpellGem string outer ${Ini[MyIni,${CurrentSub},InvisUndeadSpellGem]}
	/if (!${Defined[LevitateSpell]}) /declare LevitateSpell string outer ${Ini[MyIni,${CurrentSub},LevitateSpell]}
	/if (!${Defined[LevitateSpellGem]}) /declare LevitateSpellGem string outer ${Ini[MyIni,${CurrentSub},LevitateSpellGem]}
	/if (!${Defined[BuffExtension]}) /declare BuffExtension float outer
	
	|** Convert to if else statement, it can't be both, no need to evaluate both every time. Also adjusted for AugSlot2 and Augslot3 to avoid false negative.**|
	|** Was using Depreciated syntax, updated from ${InvSlot[back].AugSlot1} to current **|
	|** There was no base case (IE: You have neither aug slot or no back item. This is what was making the timer 0.) **|
	|** Added a boolean check to see if the back item had a spell on it to avoid a false positive for lower level characters **|
	/if (${Bool[${Me.Inventory[back].Spell}]}) {
		/if (${Me.Inventory[back].AugSlot1} == 7 || ${Me.Inventory[back].AugSlot2} == 7 || ${Me.Inventory[back].AugSlot3} == 7) {
			/varset BuffExtension 1.26
		} else /if (${Me.Inventory[back].AugSlot1} == 8 || ${Me.Inventory[back].AugSlot2} == 8 || ${Me.Inventory[back].AugSlot3} == 8) {
			/varset BuffExtension 1.35
		}
	} else {
		/varset BuffExtension 1
	}
	
	|** Calculate Spell Casting Reinforcement in reverse order in /if then else statements to reduce total needed parses at higher levels **|
	/if (${Me.AltAbility[Spell Casting Reinforcement]}>=28) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=20) {
		/varcalc BuffExtension ${BuffExtension}+.20
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=12) {
		/varcalc BuffExtension ${BuffExtension}+.15
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=6) {
		/varcalc BuffExtension ${BuffExtension}+.10
	} else /if (${Me.AltAbility[Spell Casting Reinforcement]}>=2) {
		/varcalc BuffExtension ${BuffExtension}+.05
	}
	
	/call Debug 3 "Leaving ${CurrentSub}Load"
/return

Sub Buff
	/varset CurrentSub Buff
	/call Debug 3 "Entering Sub ${CurrentSub} The real one."
	/if (!${Defined[${CurrentSub}Loaded]}) {
		/call Debug 3 "${CurrentSub}Loaded not defined, calling BuffLoad"
		/call BuffLoad
	}
	
	/declare i int local
	/declare b int local
	/if (!${BuffTotal}||${Me.Hovering}||${Window[tradewnd].Open}||${Window[lootwnd].Open}) /return
	/if (${${CurrentSub}Conditions.NotEqual[123456]}) /varset ${CurrentSub}Conditions ${Ini[MyIni,${CurrentSub},${CurrentSub}Conditions,123456]}
	/if (!${${CurrentSub}Conditions}) /return
	/for b 1 to ${BuffTotal}
		/if (!${BuffUse${b}}) /goto :skipbuff
		/if (${BuffConditions${b}.NotEqual[123456]}) /varset BuffConditions${b} ${Ini[MyIni,Buff,BuffConditions${b},1]}
		/if (!${Defined[${Me.ID}_Buff${b}]}) /declare ${Me.ID}_Buff${b} timer outer 0
		/if	(!${${Me.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Me.Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.ID} ${b}
		/if (${BuffPets} && ${Me.Pet.ID} && ${BuffClasses${b}.Find[${Me.Pet.Class.ShortName}]} && ${Spawn[${Me.Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Me.Pet.ID} ${b}
		/if (!${Group}) /goto :skipgroup
		/for i 1 to ${Group}
			/if (!${Defined[${Group.Member[${i}].ID}_Buff${b}]}) /declare ${Group.Member[${i}].ID}_Buff${b} timer outer 0
			/if (!${${Group.Member[${i}].ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Class.ShortName}]} && ${Spawn[${Group.Member[${i}].ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].ID} ${b}
			/if (!${Defined[${Group.Member[${i}].Pet.ID}_Buff${b}]}) /declare ${Group.Member[${i}].Pet.ID}_Buff${b} timer outer 0
			/if (${BuffPets} && !${Group.Member[${i}].Pet.Name.Find[Familiar]} && !${Group.Member[${i}].Pet.Name.Find[_pet]} && ${Group.Member[${i}].Pet.ID} && !${${Group.Member[${i}].Pet.ID}_Buff${b}} && ${BuffClasses${b}.Find[${Group.Member[${i}].Pet.Class.ShortName}]} && ${Spawn[${Group.Member[${i}].Pet.ID}].Distance}<=100 && (${BuffConditions${b}})) /call BuffQueue ${Group.Member[${i}].Pet.ID} ${b}
		/next i

		:skipgroup
		/if (!${BuffConditions${b}}) /goto :skipbuff
		/for i 2 to ${XTarget.Max}
			/if (!${Defined[${Me.XTarget[${i}].ID}_Buff${b}]}) /declare ${Me.XTarget[${i}].ID}_Buff${b} timer outer 0
			/if (${BuffXTargets}) {
				/if (${Me.XTarget[${i}].ID}) {
					/if (!${${Me.XTarget[${i}].ID}_Buff${b}} && (${Select[${Spawn[${Me.XTarget[${i}].ID}].Type},pc,mercenary]}||${Spawn[${Me.XTarget[${i}].ID}].Master.Type.Equal[pc]}) && ${Spawn[${Me.XTarget[${i}].ID}].Distance}<=100 && ${Me.XTarget[${i}].Type.NotEqual[auto hater]} && ${BuffClasses${b}.Find[${Me.XTarget[${i}].Class.ShortName}]} && (${BuffConditions${b}})) /call BuffQueue ${Me.XTarget[${i}].ID} ${b}
				}
			}
		/next i

		:skipbuff
	/next b

	/for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_Buff${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}}) {
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/if (${Spawn[${BuffArray[${i},1]}].ID} && ${Spawn[${BuffArray[${i},1]}].Distance}<100) {
			/call Debug 3 "/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}""
			/call BuffList "${BuffArray[${i},1]}" "${BuffArray[${i},2]}"
		}
	/next i
	/call Debug 3 "Leaving Sub ${CurrentSub}"
/return

Sub BuffList(int TNameID, int iB)
	/varset CurrentSub BuffList
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/call BuffCheck ${TNameID}
	/declare i int local
	/if (${Me.Book[${BuffSpellName${iB}}]} && !${If[${Me.SpellReady[${BuffSpellName${iB}}]},TRUE,FALSE]} && ${BuffSpellGem${iB}.Find[gem]}) {
		/memorize "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}"
		:gemwait
		/doevents
		/if (${Me.CombatState.Equal[COMBAT]}||${AddCount}) /return
		/delay 2
		/if (!${Me.SpellReady[${BuffSpellName${iB}}]}) /goto :gemwait
	}
	/if ((${Me.SpellReady[${BuffSpellName${iB}}]}||${Me.AltAbilityReady[${BuffSpellName${iB}}]}||${FindItem[${BuffSpellName${iB}}].ItemSlot} && !${FindItem[${BuffSpellName${iB}}].Timer}) && !${${TNameID}_Buff${iB}}) {
		/if (${Spawn[id ${TNameID}].Type.Equal[corpse]}) /return
		/if (${Spawn[id ${TNameID}].ID}) /squelch /tar id ${TNameID}
		/delay 1s ${Target.ID}==${TNameID}
		/call ${EchoSub} "${Pink} ${BuffSpellName${iB}} --> ${White} ${Target.CleanName}"
    	/if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
		/if (!${Defined[BuffListAnnounce]}) /declare BuffListAnnounce bool outer FALSE
    	/if (${BuffListAnnounce} && ${AnnounceChannel.NotEqual[NULL]}) /docommand /${AnnounceChannel} ${BuffSpellName${iB}} --> ${Target.CleanName}
    	/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && ${Me.AltAbilityReady[Tranquil Blessings]} && (${Me.CombatState.Equal[Active]}||${Me.CombatState.Equal[RESTING]})) /alt act ${Me.AltAbility[Tranquil Blessings].ID}
		/call Cast "${BuffSpellName${iB}}" "${BuffSpellGem${iB}}" 0 CheckStuff
		/delay 30s !${Me.Casting.ID}
		/if (!${Defined[${TNameID}_Buff${iB}]}) {
			/declare ${TNameID}_Buff${iB} timer outer
			/call Debug 3 "Defined a new timer for ${TNameID}_Buff${iB} for ${${TNameID}_Buff${iB}}"
		}
		/if (${Macro.Return.Equal[CAST_NOTHOLD]}||${Macro.Return.Equal[CAST_SUCCESS]}) {
			/if (!${Defined[${TNameID}_Buff${iB}]}) /declare ${TNameID}_Buff${iB} timer outer
			/varset ${TNameID}_Buff${iB} ${Spell[${BuffSpellName${iB}}].Duration}s
			/varset ${TNameID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
			/call Debug 3 "${Math.Calc[${${TNameID}_Buff${iB}}/10/60].Int} Minute timer set."
			/if (${Spell[${BuffSpellName${iB}}].TargetType.Find[group]} && (${SpawnCount[group ${Target.CleanName}]}||!${Target.ID})) {
				/for i 0 to ${Group}
					/if (${Group.Member[${i}].Distance}<${Spell[${BuffSpellName${iB}}].AERange}) {
						/if (!${Defined[${Group.Member[${i}].ID}_Buff${iB}]}) /declare ${Group.Member[${i}].ID}_Buff${iB} timer outer
						/varset ${Group.Member[${i}].ID}_Buff${iB} ${Math.Calc[${Spell[${BuffSpellIcon${iB}}].Duration}*60*${BuffExtension}].Int}
					}
				/next i
			}
		}
		/call Debug 3 "Leaving Sub ${CurrentSub}"
		/call BuffCheck ${TNameID}
	}
/return

Sub BuffQueue(buffid,buffnum)
	/call Debug 3 "Entering Sub BuffQueue"
	/varset CurrentSub BuffQueue
	/if (!${Defined[${buffid}BuffCheck]}) {
		/call Debug 3 "${buffid}BuffCheck undefined, calling BuffCheck on buffid ${buffid}"
		/call BuffCheck ${buffid}
	}
	/call Debug 3 "BuffQueue ${Spawn[${buffid}]} - ${BuffSpellIcon${buffnum}}"
	/declare i int local
	/declare j int local
	
    /for i 1 to 50
		/if (!${Defined[${BuffArray[${i},1]}_${BuffArray[${i},2]}]}) /declare ${BuffArray[${i},1]}_${BuffArray[${i},2]} timer outer 0
		/if (${${BuffArray[${i},1]}_${BuffArray[${i},2]}}) {
			/if (${Defined[${BuffArray[${i},1]}_Buff${BuffArray[${i},2]}]}) {
				/call BuffList ${BuffArray[${i},1]} ${BuffArray[${i},2]}
			}
			/call Debug 3 "BuffQueue Removing ${Spawn[${BuffArray[${i},1]}]} ${BuffSpellName${BuffArray[${i},2]}} from BuffQueue"
			/varset BuffArray[${i},1] 0
			/varset BuffArray[${i},2] 0
		}
		/if (${BuffArray[${i},1].Equal[${buffid}]} && ${BuffArray[${i},2].Equal[${buffnum}]}) /goto :skipq
		/if (${BuffArray[${i},1].Equal[0]} && !${j}) /varset j ${i}
	/next i
	/varset BuffArray[${j},1] ${buffid}
	/varset BuffArray[${j},2] ${buffnum}
	:skipq
	/call Debug 3 "Leaving BuffQueue"
/return

Sub BuffCheck(int iID)
	/call Debug 3 "Entering Sub BuffCheck - iID: ${iID}"
	/call Debug 3 "Checking Buff for ${Spawn[${iID}]}"
	/varset CurrentSub BuffCheck
	/if (!${Defined[${iID}BuffCheck]}) /declare ${iID}BuffCheck int outer 1
	/declare x int local
	/declare t int local
	/declare d int local
	/declare b int local
	/declare q int local
	/declare i int local
	/squelch /tar id ${iID}
	/delay 1s ${Target.ID}==${iID}
	/delay 1s
	/declare z int
	/for z 1 to 45
		/varset TargetBuffCount 0
		/if (${Target.BuffDuration[${z}]}) /call BuffParse "${Target.Buff[${z}].Name.Arg[1,Rk.]}"
		/for q 1 to ${BuffTotal}
			/if (${BuffSpellIcon${q}.Find[${Target.Buff[${z}].Name.Arg[1,Rk.]}]}||${BuffType${q}.Find[${TargetBuff[${x},2]}]}) {
				/if (!${Defined[${iID}_Buff${q}]}) /declare ${iID}_Buff${q} timer outer
				/varset ${iID}_Buff${q} ${Math.Calc[6*${Target.BuffDuration[${z}]}].Int}
			}
		/next q
	/next z
	
	|** I'm trying to wrap my head about this, but I'm not understanding the point of it ~Chatwiththisname~ 
	 ** 40oz: not sure, looks like a way to setup timers to hand out buffs, 
	 **       but if the timer is never set to a time, it will never do anything
	 **|
	/for i 1 to ${BuffTotal}
		/for x 1 to ${BuffType${i}.Count[|]}
			/if (${${Target.ID}BuffString.Find[${BuffType${i}.Arg[${x},|]}]}) /goto :skip 
		/next x
		/if (!${Defined[${Target.ID}_Buff${i}]}) /declare ${Target.ID}_Buff${i} timer outer
		|/echo ${Target} needs ${BuffSpellIcon${i}}
		:skip
	/next i
/return

Sub BuffParse(buffname,int mybuff)
	/varset CurrentSub BuffParse
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/declare i int local
	/declare icon int local
	/varset BuffParsePH ${buffname}
	/varset UnknownBuff TRUE
	/if (!${Defined[${Target.ID}BuffString]}) /declare ${Target.ID}BuffString string outer
	/if (${Spell[${buffname}].Slot[1].Find[Increase Max Hitpoints]}) /call BuffArray Shielding ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Max Hitpoints]}) /call BuffArray ACHP ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[3].Find[Increase Max Hitpoints]}) /call BuffArray Symbol ${Spell[${buffname}].Icon} 3 ${mybuff} 
	/if (${Spell[${buffname}].Slot[4].Find[Increase Max Hitpoints]}) /call BuffArray HybridHP ${Spell[${buffname}].Icon} 4 ${mybuff} 
	/if (${Spell[${buffname}].Slot[5].Find[Increase Attack Speed]}) /call BuffArray Haste ${Spell[${buffname}].Icon} 2 ${mybuff} 
	/if (${Spell[${buffname}].Slot[1].Find[Increase Attack Speed]}) /call BuffArray Haste2 ${Spell[${buffname}].Icon} 1 ${mybuff} 
	/if (${Spell[${buffname}].Slot[2].Find[Increase Mana by]}) /call BuffArray Clarity ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Hitpoints by]} && ${Spell[${buffname}].Slot[1].Find[per tick]}) /call BuffArray Regen ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase ATK by ]}) /call BuffArray Attack ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase AC by ]}) /call BuffArray AC1 ${Spell[${buffname}].Icon} 2 ${mybuff}	
	/if (${Spell[${buffname}].Slot[3].Find[Increase AC by ]}) /call BuffArray AC2 ${Spell[${buffname}].Icon} 3 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Increase Damage Shield by ]}) /call BuffArray DS1 ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${Spell[${buffname}].Slot[2].Find[Increase Damage Shield by ]}) /call BuffArray DS2 ${Spell[${buffname}].Icon} 2 ${mybuff}
	/if (${Spell[${buffname}].Slot[1].Find[Mitigate Melee Damage by ]}) /call BuffArray Mitigate ${Spell[${buffname}].Icon} 1 ${mybuff}
	/if (${UnknownBuff} && ${mybuff}) /call BuffArray Unknown ${Spell[${buffname}].Icon} 0 ${mybuff}
/return

Sub BuffArray(buffarrayname,int buffarrayicon,int buffarrayslot,int myarraybuff)
	/varset CurrentSub BuffArray
	/call Debug 3 "Entering Sub ${CurrentSub}"
	/varset UnknownBuff FALSE
	/if (!${myarraybuff}) {
		/if (!${Defined[${Target.ID}_${Spell[${BuffParsePH}].ID}]}) /declare ${Target.ID}_${Spell[${BuffParsePH}].ID} string outer
		/varset ${Target.ID}_${Spell[${BuffParsePH}].ID} ${${Target.ID}_${Spell[${BuffParsePH}].ID}}${buffarrayname}|
		/varset ${Target.ID}BuffString ${${Target.ID}BuffString}${buffarrayname}|
		/varcalc TargetBuffCount ${TargetBuffCount}+1
		/varset TargetBuff[${TargetBuffCount},1] ${Target.CleanName}
		/varset TargetBuff[${TargetBuffCount},2] ${buffarrayname}
		/varset TargetBuff[${TargetBuffCount},3] ${buffarrayicon}
		/varset TargetBuff[${TargetBuffCount},4] ${buffarrayslot}
		/varset TargetBuff[${TargetBuffCount},5] ${BuffParsePH}
	}

	/if (${myarraybuff}) {
		/varset MyBuffString ${MyBuffString}${buffarrayname}|
		/varcalc MyBuffCount ${MyBuffCount}+1
		/varset MyBuff[${MyBuffCount},1] ${BuffSpellIcon${myarraybuff}}
		/varset MyBuff[${MyBuffCount},2] ${buffarrayname}
		/varset MyBuff[${MyBuffCount},3] ${buffarrayicon}
		/varset MyBuff[${MyBuffCount},4] ${buffarrayslot}
		/varset BuffType${myarraybuff} ${BuffType${myarraybuff}}${buffarrayname}|
	}
/return

Sub Event_BuffWornOff(Line,string SpellWornOff,string ChatSender)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
   	/varset ChatSenderHold ${Spawn[${ChatSender}].CleanName.Replace[ ,]}
   	/varset SpellHold ${SpellWornOff}
   	/declare b int local
   	/declare bf int local
   	/for b 1 to ${BuffTotal}
  		/if (${SpellHold.Find[${BuffSpellIcon${b}}]}||${SpellHold.Find[${BuffSpellName${b}}]}) {
			/varset bf ${b}
			/goto :buffdetected
		}
	/next b
   	/if (!${bf}) /return

   	:buffdetected
   	/if (!${Defined[${Spawn[${ChatSender}].ID}_Buff${bf}]}) /declare ${Spawn[${ChatSender}].ID}_Buff${bf} timer outer
   	/varset ${Spawn[${ChatSender}].ID}_Buff${bf} 0
/return

Sub Event_EQBC(EQBCSay,EQBCSender,EQBCCommand)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${EQBCCommand.Left[2].Equal[//]}) /return
  	/if (${EQBCCommand.Left[1].Equal[/]}) {
    	/docommand ${EQBCCommand}
  	} else {
    	/call Event_Chat "EQBC" "${EQBCSender}" "${EQBCCommand}"
  	}
/return

Sub Event_CastSpell(string line,string ChatSender,string SName,string TName)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
	/varset ChatSenderHold ${ChatSender}
 	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
	/if (${SName.Equal[ivuon]}) {
		/call Event_InvisUndeadOn
		/return
	}
	/if (${SName.Equal[invison]}) {
		/call Event_InvisOn
		/return
	}
	/if (${SName.Equal[invisoff]}) {
		/call Event_InvisOff
		/return
	}
	/if (${SName.Equal[levon]}) {
		/call Event_LevitateOn
		/return
	}
	/if (${SName.Equal[levoff]}) {
		/call Event_LevitateOff
		/return
	}
	/if (${SName.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "1"
		/return
	}
	/if (${SName.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSenderHold}"
		/return
	}
	/if (${SName.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSenderHold}" "0"
		/return
	}

	/declare b int local
	/for b 1 to ${BuffTotal}
		/if (${BuffAlias${b}.Find[|${SName}|]}) {
			/if (${TName.Length}) {
				/if (${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[pc ${TName}].ID}" "${b}"
				/if (!${SpawnCount[pc ${TName}]}) /call BuffList "${Spawn[${TName}].ID}" "${b}"
			} else {
				/if (!${line.Find[ on ]}) {
					/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[pc ${ChatSenderHold}].ID}" "${b}"
					/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffList "${Spawn[${ChatSenderHold}].ID}" "${b}"
				}
				/if (${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[pc ${ChatSenderHold}].ID}
				/if (!${SpawnCount[pc ${ChatSenderHold}]}) /call BuffCheck ${Spawn[${ChatSenderHold}].ID}
			}
		}
	/next b

/return

Sub Event_InvisOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisSpell}]} || ${InvisSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisSpell}]} || ${InvisSpellGem.Equal[item]} && !${FindItem[${InvisSpell}].Timer}) {
  		/if (${Spell[${InvisSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisSpell}].ID}
  	  	/if (!${InvisSpellGem.Equal[alt]}) /call Cast "${InvisSpell}" ${InvisSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisUndeadOn
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/if (${Me.Book[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${InvisUndeadSpell}]} || ${InvisUndeadSpellGem.Equal[item]} && !${FindItem[${InvisUndeadSpell}].Timer}) {
  		/if (${Spell[${InvisUndeadSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
  			/delay 3s ${Target.ID}==${Me.ID}
  		}

		/if (${InvisUndeadSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${InvisUndeadSpell}].ID}
  	  	/if (!${InvisUndeadSpellGem.Equal[alt]}) /call Cast "${InvisUndeadSpell}" ${InvisUndeadSpellGem} 5s
  	  	/delay 5
  	}
/return

Sub Event_InvisOff
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
    /declare invisid int local
    /if (${Target.ID}) /varset invisid ${Target.ID}
    /squelch /tar clear
    /squelch /attack on
    /delay 1
    /squelch /attack off
    /if (${invisid} && ${Spawn[${invisid}.Type.NotEqual[corpse]}) /squelch /tar id ${invisid}
    /if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sun Cloak].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sun Cloak].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Sunskin].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Sunskin].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Fool the Fallen].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Fool the Fallen].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloud of Indifference].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloud of Indifference].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Perfected Invisibility to Undead].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Invisibility to Undead].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[${InvisUndeadSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${InvisSpell}].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Group Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Silent Presence].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Silent Presence].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Cloak of Shadows].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Cloak of Shadows].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Group Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Group Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Invisibility of Spirit Walk].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Invisibility of Spirit Walk].ID}-1].Int} leftmouseup
    /if (${Me.Buff[Shauri's Sonorous Clouding].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shauri's Sonorous Clouding].ID}-1].Int} leftmouseup
/return

Sub Event_LevitateOn
  	/if (${Me.Book[${LevitateSpell}]} || ${LevitateSpellGem.Equal[alt]} && ${Me.AltAbilityReady[${LevitateSpell}]} || ${LevitateSpellGem.Equal[item]} && !${FindItem[${LevitateSpell}].Timer}) {
		/if (${Spell[${LevitateSpell}].TargetType.Equal[Single]}) {
			/squelch /target myself
			/delay 3s ${Target.ID}==${Me.ID}
		}

		/if (${LevitateSpellGem.Equal[alt]}) /alt act ${Me.AltAbility[${LevitateSpell}].ID}
		/if (!${LevitateSpellGem.Equal[alt]}) /call Cast "${LevitateSpell}" ${LevitateSpellGem} 5s
		/delay 5
  	}
/return

Sub Event_LevitateOff
  	/if (${Me.Buff[Flight of Eagles].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Flight of Eagles].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Spirit of Eagle].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Spirit of Eagle].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Levitation].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfect Dead Man Floating].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Dead Man Floating].ID}-1].Int} leftmouseup
  	/if (${Me.Buff[Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[Group Perfected Levitation].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Group Perfected Levitation].ID}-1].Int} leftmouseup
	/if (${Me.Buff[${LevitateSpell}].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[${LevitateSpell}].ID}-1].Int} leftmouseup
/return

Sub Event_Chat(string ChatType,string ChatSender,string ChatText)
	/if (!${Defined[BuffLoaded]}) /call BuffLoad
  	/declare b int local
  	/declare i int local
	/varset ChatSenderHold ${ChatSender}
	/if (${ChatSender.Left[1].Compare[ ]} < 0) /varset ChatSenderHold ${ChatSender.Right[-2].Left[-1]}
	/if (!${AuthorizedUsers.Find[${ChatSenderHold}]} && ${AuthorizedUsers.NotEqual[NULL]} && !${Select[${Spawn[${ChatSender}].Type},mercenary,pet]}) {
		/echo ${ChatSender} not found on [Settings] AuthorizedUsers list. Ignoring request.
		/return
	}
  	/if (${ChatText.Equal[${MoveUpCommand}]}) {
		/call Event_Follow "${ChatSender}" "1"
		/return
	}
  	/if (${ChatText.Equal[${FollowCommand}]}) {
		/call Event_Follow "${ChatSender}" "0"
		/return
	}
	/if (${ChatText.Equal[${StopFollowCommand}]}) {
		/call Event_StopFollow "${ChatSender}"
		/return
	}

  	/if (!${Spawn[pc ${ChatSender}].ID}) {
		/return
	}
  	/if (${BuffTotal} && ${ChatSender.NotEqual[${Me.CleanName}]} && ${Spawn[pc ${ChatSender}].ID}) {
    	/for b 1 to ${BuffTotal}
        	/if (${BuffAlias${b}.Find[${ChatText}]}) {
            	/call BuffList "${Spawn[pc ${ChatSender}].ID}" "${b}"
         	}
    	/next b
    }
/return

|Buff end

Wasn't aware it was broken. 30 downloads of my last update. No real input about the buffs, which was what the fix was targeted at. I can look at assisting.

What exactly was broken and what did you fix?

First comment on macro said buff logic broken... loaded it up on my druid and cleric and it buffed *sometimes* and would only give out the first buff. And never rebuffed when it faded. Then i fixed those issues.
 
Ok, ran a diff on it. Changed a bunch of strings to timers. /shrug hey if it works then I guess it doesn't matter. I just ran tests on mine on 4 different characters and they all appeared to be working. 1 page ago on my last upload I had posted my update comments that were sent with the commit, but failed to include them in the released macro, specifically mentioned fixing buff logic.

This isn't EQ in the sense that they are going to fix things without feedback, I won't. 40oz appears to have fled the scene (or is otherwise preoccupied with life). I'm quite honestly losing interest in this project as only a couple of members have provided any feedback.

I fixed the pull logic enough to get it to go in standard mode. Handled some issues regarding Aura[1].Name.Length issues etc (It's almost like that change was reverted backwards because every character I run gets an error about Name not being a member of Aura). Then I was working on heal single and promptly broke healsingle all together. I'll get around to sorting this out

The code isn't written to be reworked very effectively. Variables are declared using other variables which makes it hard to find where it's originally declared. So we're just jamming more /declare code into this thing all over the place (Obviously not randomly, but in a way that promotes forward progress) Most of our issues arise from undeclared variables, that has been consistent throughout. Likely finding as many of those as you can and getting them declared will help.

Also, INI entries are outright missing, but expected to be present. So there is a lot of guess work on what INI entries need to be there, then they are manually input. This has been a constant nuisance for me as I don't get much feedback or I have to beat a dead horse to find out what is going on, it becomes simplier to create a dud character to try and test the theories on.

Currently I have two programming classes, a biology, a biology lab and a calculus class going on. So I likely won't be able to exert much effort towards this for a while. Hopefully someone else can pick up the slack and get this thing going better.
 
Any testing you may need done just let me know , you have my ini's already would love to see this thing working again when and if you have the time to work on it
 
So for changes you prefer the entire bot40.mac, with changes, posted here? Is there any better way?

I have some small ones like null check fixes in Sub MercLoad
and addition of IF MERC EVEN EXISTS - to Sub Merc:
/if (${MercName.Equal[NULL]}) /return

Plus a fix to the SummonItem routine.
 
Since it's had so many issues since the patch in September, I haven't really been using it but the last time I tried, the pulling was still broken. Has anyone been able to get that to work?
 
I also wanted to express my thanks to all those working so hard to make this macro work. At first I was discouraged that something I had become so reliant on had failed me. I was always a hardware person and struggle to make the smallest of changes. Looking at the thousands of lines of code is the equivalent of me building a server farm in a week - not gonna happen.

Keep up the great work and I will try my best to sit patiently and watch as the work and improvements evolve.

Thanks to all of you.
 
Something is happening to the old macro. It's getting worse, if that's possible. My mage macro wont work at all any more. The mage just targets the tank and spams pet back off because I get a shitload of Sorry master, calming down messages. It's basically not working at all. Not sure what happened, I didn't touch the ini.
 
It is hard to focus on any one aspect of the code because I'm more interested in fixing the bigger picture of things. I know that AA Subs are all messed up. I don't really know how to handle them so I typically bypass it when possible. I've honestly been trying to work past most of the undeclared variables in an attempt to get to the topics brought up by members here.

While I realize that when I post things to here I simply say "Fixed this, fixed that, made changes here, optimized this thing" but what that really typically means is I spent 5-8 hours forcing the code to do what I want it to do, testing it to make sure it works, checking multiple situations to verify that it works in all cases, change to multiple characters and running the code again, and again, and again"

the very best thing you can do for me is to provide me with information related to what bug is occuring, what situation it occurs in, the message output by the macro in the mq2 window ~ to include the line number. Hell screenshot the MQ2 box and post that screenshot to your post if it is easier than writing it down and relaying it.

Included is a screenshot of the fix location for Aura errors where name is not a member etc etc. this is an example of one of the silly things I've had to do to fix aura's for some characters. If your character is getting a similar message and I haven't fixed it here, then chances are I either don't know about it or I've forgotten. If I've forgotten I apologize, for now it is only showing shaman berserker and bard (berserker and bard added recently).

I do want a copy of the entire macro if you post some update here, in this way I can do a quick compare and if the code is functional and doesn't break anything else then I can commit just the changed chunks to the master project without undoing any other changes that may have already been included in the master copy. (In other words I can discard changes that go backwards). If you don't provide an entire copy then I have to create a duplicate copy of the existing macro, find the subs/lines that you changes and overwrite the existing code with your new code then run a compare. The latter takes longer.

Also note I made a change to mercs already that should have fixed the issue it was running into. In this case if MercLoaded wasn't defined it was defining it false, then getting past the return statement for it being loaded already it was AGAIN checking to see if it was defined and only if it wasn't already defined assigning it an int value. That was changed to a varset to true if it was in the loading section.

These are just a couple of the changes made and obviously don't include everything. Doing it this way I was able to get it to progress farther. I believe I may have even made a change or two to spell routines but I can't recall. I know I at least considered making a change to it while working on healsingle trying to find the code that was causing it to constantly interrupt. I believe that was due to my INI entry and not related to the program exactly. I think I should have a check to see if starthealling > stop healing, then produce an echo and skip the section telling the user to make a change to it. As it stands and I understand it the INI entry for healsingle should be

Code:
HealSelfTotal=0
HealSelfSpell=Healing
HealSelfSpellGem1=gem8
HealSingleUseAt1=75 <~~~when to start healing
HealSingleStopAt1=0 <~When to stop healing (this should be higher than when to start healing)
HealSingleStopAtMobPctHP1=0
HealSingleRecast1=1s
 

Attachments

  • changes.bmp
    5.9 MB · Views: 10
  • changes2.bmp
    5.9 MB · Views: 8
Last edited:
Yeah, the pain I feel ya man... thanks for all your work, btw.

I recently spent hours fixing up a macro for someone (don't want to say who/what without their permission). What a PITA lol.

Again, excellent work - although I am a tad confused about the class short name compares about SHM & not BRD or w/e... if it's equal to SHM, it can't possibly be equal to BRD or w/e???

Mostly my work lately is implementing EQLaunch (EQ, InnerSpace, WinEQ2) to loader, and MQ2AutoLogin profiles/groups, but I will try to help on macs when I need a break. :)

htw
 
Yeah, the pain I feel ya man... thanks for all your work, btw.

I recently spent hours fixing up a macro for someone (don't want to say who/what without their permission). What a PITA lol.

Again, excellent work - although I am a tad confused about the class short name compares about SHM & not BRD or w/e... if it's equal to SHM, it can't possibly be equal to BRD or w/e???

Mostly my work lately is implementing EQLaunch (EQ, InnerSpace, WinEQ2) to loader, and MQ2AutoLogin profiles/groups, but I will try to help on macs when I need a break. :)

htw

I used or || and it kept ignoring me. Switched it to And and it did what I was expecting it to do with or....I didn't argue with it. I just let it happen. LOL

As a side note I just added SHD to that list. I'm really thinking they reverted that change back the other way or something because it certainly seems that way.
 
Last edited:
LOL I misread it - I missed the not op for SHM, so makes sense now. Oops! :)

htw
 
A bit of an update

I didn't document all the changes sadly. I did some work to Lifetap, HealSingle, Pulling, Auras, Mana, etc. Once I run the commit and verify the changes I'll make a list of the changes. Lots of things were declared that weren't previously. Lots of INI entries that were simply missing were included (Especially in Lifetap subs), Healsingle should work (works on my shaman), Pulling should now work (at least in standard mode and assuming your INI is setup correctly).

Things of note, I pulled two subs from my personal pull.mac and added them to the end of the macro. These are not being used at this time as they must have INI entries generated and included, their intention is to check group health and mana between pulls (Cuz right now it pulls non stop as long as the puller has enough health and to hell with everyone else's health and mana).

I changed the way the macro assesses AssistAt if you use your own characters name as the assistchar. IE: Your characters name is Bobthebuilder and you /mac bot40 bobthebuilder, then you assist by default at 100. In this way if you are the puller and the main assist or you are just the mainassist or whatever other reason you want to attack at 100, then /mac bot40 yourname This works for me because i"m running two characters and my maintank is my main assist and my puller. So I can AmIPuller=TRUE, then when it returns with a mob it turns around and attacks it when it arrives.

Poly said they got mez's to work. I don't have those fixes to include yet. Once he posts it I'll smash it into the code. The changes poly made to the buff subs aren't included in this release. Again, waiting on his changes from mez to include his changes from buffs as well.

Just going through and defining missing variables fixes a lot of things. Other things I have to brute force work into the code. I added a lot of lines and made a lot of changes this run. For now my SK and SHMN have been duoing for about an hour without any assistance from me (Thanks to two healer mercs keeping us alive with the SK incessantly pulling without regard for safety of other group members)

I can't recall if I made a change to spell_routines.inc so I'll include a copy of it. Again it's been like 9 hours of working on it non-stop, so who really knows what all I've fixed/changed.

The most important thing here is to understand that I've created about 4 different characters specifically to test this macro. They aren't high level. Not all conditions have been met and not all situations can be tested by me alone. Test it for me and if it doesn't work tell me what the program said to you.

As usual I have #Warning in the code. Delete this line if it's locking up on you to make it usable. But make note of what variable/variables it said was undefined, on what line so that I can look into correcting the issue.
 

Attachments

  • Spell_routines.inc
    68.4 KB · Views: 9
  • bot40.mac
    502.4 KB · Views: 11
Last edited:
That's the changes. It's a lot (13 pages). I don't feel like typing it. I've printed it to PDF. You probably don't know what all that means. But this is all the effort I can muster for the moment. I'm tired.
 

Attachments

  • Changes 10-24-17.pdf
    404.6 KB · Views: 11
Last edited:
chanter mezzing fixes.

Code:
|mez start
Sub MezLoad
	/call Debug 3 "In Sub MezLoad"
	/varset CurrentSub Mez
	/if (!${Defined[${CurrentSub}Loaded]}) /declare ${CurrentSub}Loaded bool outer FALSE
	/if (${${CurrentSub}Loaded}) /return
	/varset ${CurrentSub}Loaded TRUE
  	/if (!${Defined[mezcnt]})  /declare mezcnt int outer
  	/if (!${Defined[aemezcnt]}) /declare aemezcnt int outer
  	/if (!${Defined[PBAEMezcnt]}) /declare PBAEMezcnt int outer
  	/if (!${Defined[notmezcnt]}) /declare notmezcnt int outer
	/declare BeamTimer timer outer 5s
	/declare MezList string outer |
	/declare MezMaxNPCLevel int outer
	/declare AEMezMaxNPCLevel int outer
	/declare PBAEMezMaxNPCLevel int outer
	/declare FinalMezMaxNPCLevel int outer
	/declare MezBuffer timer outer
	/declare BeamUsed int outer 0
	/declare IgnoreImmuneLists bool outer ${Ini[MyIni,Mez,IgnoreImmuneLists,FALSE]}
	/if (!${IgnoreImmuneLists}) /mmoini "MyIni" "Mez" "IgnoreImmuneLists" "FALSE"
	/declare DontMezConColor string outer ${Ini[MyIni,Mez,DontMezConColor,|GREY|GREEN|]}
	/declare b int local
	/declare x int local
	/declare i int local 0
	/declare numEffects int local
	/if (${Select[${Me.Class.ShortName},NEC]}) /varset i 2
	/if (${Select[${Me.Class.ShortName},BRD]}) /varset i 4
	/if (${Select[${Me.Class.ShortName},ENC]}) /varset i 6
	/varset tempsubtotal ${Ini[MyIni,${CurrentSub},${CurrentSub}Total]}
	/if (${NeedLoad} && !${tempsubtotal} && ${i}) {
		/mmoini "MyIni" "Mez" "DontMezConColor" "|GREY|GREEN|"
		/call SpellLoad "${CurrentSub}" ${i} "|1|3|4|6|30|" "|${i}|TRUE|PH|PH|PH|"
	}
	/call SpellLoad2 "${CurrentSub}" "3|4|6|30|"
	/declare ${CurrentSub}MaxNPCLevel${x} int outer 0
	/if (${${CurrentSub}Total}) {
		/for x 1 to ${${CurrentSub}Total}
			/varcalc numEffects ${Spell[${${CurrentSub}SpellName${x}}].NumEffects}
			/for b 1 to ${numEffects}
				/if (${Spell[${${CurrentSub}SpellName${x}}].Subcategory.Equal[Enthrall]}) {
					/if (${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}>${MezMaxNPCLevel}) /varset MezMaxNPCLevel ${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}
				}
			/next b
		/next x
	}

	/varset CurrentSub AEMez
	/if (${NeedLoad} && !${Defined[${CurrentSub}Total]} && ${Select[${Me.Class.ShortName},ENC]}) {
		/mmoini "MyIni" "Mez" "DontMezConColor" "|GREY|GREEN|"
		/call SpellLoad "${CurrentSub}" 1 "|1|3|4|6|30|" "|1|TRUE|PH|PH|PH|"
	}
	/call SpellLoad2 "${CurrentSub}" "3|4|6|30|"
	/declare ${CurrentSub}MaxNPCLevel${x} int outer 0
	
	/if (${${CurrentSub}Total}) {
		/for x 1 to ${${CurrentSub}Total}
			/varcalc numEffects ${Spell[${${CurrentSub}SpellName${x}}].NumEffects}
			/for b 1 to ${numEffects}
				/if (${Spell[${${CurrentSub}SpellName${x}}].Subcategory.Equal[Enthrall]}) {
					/if (${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}>${${CurrentSub}MaxNPCLevel}) /varset ${CurrentSub}MaxNPCLevel ${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}
				}
			/next b
		/next x
	}
	/varset CurrentSub PBAEMez
	/if (${NeedLoad} && !${Defined[${CurrentSub}Total]} && ${Select[${Me.Class.ShortName},ENC,BRD]}) {
		/mmoini "MyIni" "Mez" "DontMezConColor" "|GREY|GREEN|"
		/call SpellLoad "${CurrentSub}" 1 "|1|3|4|6|30|" "|1|TRUE|PH|PH|PH|"
	}
	/call SpellLoad2 "${CurrentSub}" "3|4|6|30|"
	/declare ${CurrentSub}MaxNPCLevel${x} int outer 0
	/if (${${CurrentSub}Total}) {
		/for x 1 to ${${CurrentSub}Total}
			/varcalc numEffects ${Spell[${${CurrentSub}SpellName${x}}].NumEffects}
			/for b 1 to ${numEffects}
				/if (${Spell[${${CurrentSub}SpellName${x}}].Subcategory.Equal[Enthrall]}) {
					/if (${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}>${PBAEMezMaxNPCLevel}) /varset PBAEMezMaxNPCLevel ${Spell[${${CurrentSub}SpellName${x}}].Max[${b}]}				
				}
			/next b
		/next x
	}
	/varset FinalMezMaxNPCLevel ${MezMaxNPCLevel}
	/if (${AEMezMaxNPCLevel}>${FinalMezMaxNPCLevel}) /varset FinalMezMaxNPCLevel ${AEMezMaxNPCLevel}
	/if (${PBAEMezMaxNPCLevel}>${FinalMezMaxNPCLevel}) /varset FinalMezMaxNPCLevel ${PBAEMezMaxNPCLevel}

	/call Debug 2 "MezMaxNPCLevel = ${MezMaxNPCLevel} | AEMezMaxNPCLevel: ${AEMezMaxNPCLevel} | PBAEMezMaxNPCLevel: ${PBAEMezMaxNPCLevel}"
	/call Debug 3 "Leaving Sub MezLoad"
/return

Sub MezClear(int MezMobID)
	/if (${Defined[MezTimer${MezMobID}]}) /deletevar ${MezTimer${MezMobID}}
/return

Sub Mez
	/call Debug 3 "In Sub Mez"
	/if (${Me.Hovering}) {
		/call Debug 3 "Leaving Sub Mez - In Hover State"
		/return
	}
	/varset CurrentSub Mez
	/if (!${Defined[${CurrentSub}Loaded]}) /call ${CurrentSub}Load
  	/if ((!${MezUse1} && !${AEMezUse1} && !${PBAEMezUse1}) || ${NeedLoad} || (${Me.Invis} && !${AutoBreakInvis})) {
	  	/call Debug 3 "Leaving Sub Mez - Mez Options not configured properly or can't break invis."
		/return
	}
  	/if (${Me.Class.ShortName.Equal[BRD]} && (!${Me.Gem[${PBAEMezSpellName1}]}||${Me.GemTimer[${PBAEMezSpellName1}]})) {
	  	/call Debug 3 "Leaving Sub Mez - Bard with no PBAEMez spell, unsupported combination"
		/return
	}

	/declare m int local
  	/declare i int local
  	/declare x int local

  	/varset TarID ${Me.XTarget[1].ID}
	/if (!${Defined[MezTimer${TarID}]}) /Declare MezTimer${TarID} timer outer 0
  	/if (${TarID} && ${MezTimer${TarID}}) /varset MezTimer${TarID} 0
  	/varset mezcnt 0
  	/varset aemezcnt 0
  	/varset PBAEMezcnt 0
  	/varset notmezcnt 0

  	/for m 1 to ${MezList.Count[|]}
		/if (${MezList.Length}>1 && ${MezList.Arg[${m},|].NotEqual[|]} && (!${Spawn[id ${MezList.Arg[${m},|]}].ID}||!${AddList.Find[${MezList.Arg[${m},|]}]})) /varset MezList ${MezList.Replace[${MezList.Arg[${m},|]},]}
		/if (${MezList.Find[||]}) /varset MezList ${MezList.Replace[||,|]}
  	/next m
	
	/call Debug 3 "MezList: ${MezList}"
	/call Debug 3 "AddList: ${AddList}"

  	/for m 1 to ${AddList.Count[|]}
		/if (!${MezList.Find[${AddList.Arg[${m},|]}]} && (${IgnoreImmuneLists}||!${MezImmuneList.Find[${Spawn[id ${AddList.Arg[${m},|]}].CleanName}]}) && ${AddList.Arg[${m},|]}!=${TarID} && !${DontMezConColor.Find[${Spawn[id ${AddList.Arg[${m},|]}].ConColor}]} && !${Spawn[id ${AddList.Arg[${m},|]}].CleanName.Find[_pet]} && ${Spawn[id ${AddList.Arg[${m},|]}].ID} && ${Spawn[id ${AddList.Arg[${m},|]}].Level}<=${FinalMezMaxNPCLevel}) {
			/if (${Defined[MezTimer${AddList.Arg[${m},|]}]}) /varset MezTimer${AddList.Arg[${m},|]} 0
			/varset MezList ${MezList}${AddList.Arg[${m},|]}|
		}
  	/next m
  
	/call Debug 3 "MezList after AddList Loop: ${MezList}"

  	/for m 1 to ${MezList.Count[|]}
		/if (${Spawn[id ${MezList.Arg[${m},|]}].Distance}<100 && ${Spawn[id ${MezList.Arg[${m},|]}].Level}<=${MezMaxNPCLevel} && !${MezTimer${MezList.Arg[${m},|]}}) /varcalc mezcnt ${mezcnt}+1
		/if (${Spawn[id ${MezList.Arg[${m},|]}].Distance}<100 && ${Spawn[id ${MezList.Arg[${m},|]}].Level}<=${AEMezMaxNPCLevel} && !${MezTimer${MezList.Arg[${m},|]}}) /varcalc aemezcnt ${aemezcnt}+1
		/if (${Spawn[id ${MezList.Arg[${m},|]}].Distance}<35 && ${Spawn[id ${MezList.Arg[${m},|]}].Level}<=${PBAEMezMaxNPCLevel} && !${MezTimer${MezList.Arg[${m},|]}}) /varcalc PBAEMezcnt ${PBAEMezcnt}+1
  	/next m

	/call Debug 3 "mezcnt: ${mezcnt} | aemezcnt: ${aemezcnt} | PBAEMezcnt: ${PBAEMezcnt}"

	| Note: PBAEMezzing is currently only supported on bards.  Loop will run but take no action when not a bard.
	/varset CurrentSub PBAEMez
	/for i 1 to ${PBAEMezTotal}
 		/if ((${PBAEMezcnt}>2||${PBAEMezcnt}>0 && ${AddCount}>1 && ${SpawnCount[npc radius 35]}>1 && ${Me.Class.ShortName.Equal[BRD]}) && (${Me.SpellReady[${PBAEMezSpellName${i}}]}||${Me.AltAbilityReady[${PBAEMezSpellName${i}}]}||${Me.Class.ShortName.Equal[BRD]} && ${Me.Gem[${PBAEMezSpellName${i}}]} && !${Me.GemTimer[${PBAEMezSpellName${i}}]}) && ${Me.CurrentMana}>${Spell[${PBAEMezSpellName${i}}].Mana} && ${PBAEMezUse${i}}) {
			/if (!${Me.Class.ShortName.Equal[BRD]}) /call MezAdd "${PBAEMezSpellName${i}}" "${PBAEMezSpellGem${i}}" ${Target.ID} 
			/if (${Me.Class.ShortName.Equal[BRD]}) {
				/if (${Twist.Twisting}) {
					/varset twisting TRUE
					/squelch /twist stop
				}
			
				/delay !${Me.Casting.ID}
				/squelch /twist once ${Me.Gem[${PBAEMezSpellName${i}}]}
				/call ${EchoSub} "${DarkYellow} ${PBAEMezSpellName${i}}"
				/varset BeamUsed 1
				/varset BeamTimer ${BeamTimer.OriginalValue}
				/doevents
				/if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${PBAEMezSpellName${i}}
				/delay 38
				/twist
				/return
			}	
		}
	/next i
	
	/if (${twisting} && !${Twist.Twisting}) {
		/squelch /twist start
		/varset twisting FALSE
	}

	/varset CurrentSub AEMez
   	/for m 1 to ${MezList.Count[|]}
		/for i 1 to ${AEMezTotal}
  			/if (${aemezcnt}>2 && (${Me.SpellReady[${AEMezSpellName${i}}]}||${Me.AltAbilityReady[${AEMezSpellName${i}}]}) && ${Me.CurrentMana}>${Spell[${AEMezSpellName${i}}].Mana} && !${MezTimer${MezList.Arg[${m},|]}} && ${MezList.Arg[${m},|]}>0 && ${Spawn[id ${MezList.Arg[${m},|]}].ID} && ${AEMezUse${i}}) {
			  	/call Debug 3 "Trying to AE Mez using ${AEMezSpellName${i}} on ${MezList.Arg[${m},|]}"
				/squelch /tar id ${MezList.Arg[${m},|]}
				/call MezAdd "${AEMezSpellName${i}}" "${AEMezSpellGem${i}}" ${Target.ID}
			}
		/next i
   	/next m

	:refreshmez
	/if (${Spawn[${MezMobID}].Type.Equal[corpse]}) {
		/call Debug 3 "Leaving Sub Mez - MezMobID (${MezMobID}) is a corpse - not even sure you should see this because it looks like dead code."
		/return
	}
	/varset CurrentSub Mez
	/doevents
	/for i 1 to ${MezTotal}
 		/if (${mezcnt} && (${Me.SpellReady[${MezSpellName${i}}]} && ${Me.CurrentMana}>${Spell[${MezSpellName${i}}].Mana}||${Me.AltAbilityReady[${MezSpellName${i}}]}) && ${MezUse${i}}) {
			/for m 1 to ${MezList.Count[|]}
				/if (${MezTimer${MezList.Arg[${m},|]}}>6) /continue
				/if ((!${Defined[MezTimer${MezList.Arg[${m},|]}]}||${Defined[MezTimer${MezList.Arg[${m},|]}]} && !${MezTimer${MezList.Arg[${m},|]}}) && ${MezList.Arg[${m},|]}!=${TarID} && ${MezList.Arg[${m},|]}>0 && ${Spawn[id ${MezList.Arg[${m},|]}].ID} && ${Spawn[id ${MezList.Arg[${m},|]}].Distance}<=${AttackRange}) {
					/squelch /tar id ${MezList.Arg[${m},|]}
					/delay 1s ${Target.ID}==${MezList.Arg[${m},|]}
					/call MezAdd "${MezSpellName${i}}" "${MezSpellGem${i}}" ${MezList.Arg[${m},|]}
					/if (${mezcnt}) /goto :refreshmez
				}
			/next m
		}
	/next i

 	/if (!${mezcnt} && ${TarID} && ${Spawn[${TarID}].Type.Equal[npc]}) /squelch /tar id ${TarID}
	/call Debug 3 "Leaving Sub Mez"
/return

Sub MezAdd(string MezSpell,string GemName,int MezID)
	/if (!${MezID}||!${Target.LineOfSight}||!${Target.ID}) /return
	/varset BeamUsed 0
	/squelch /tar id ${MezID}
	/delay 1s ${Target.ID}
	/if (${MezSpell.Equal[Beam of Slumber]}) /face
	/call ${EchoSub} "${Purple} ${MezSpell} --> ${White} ${Target}"
    /if (${Verbose} && ${MyChannel.NotEqual[NULL]}) /docommand /${MyChannel} ${MezSpell} --> ${Target.CleanName}
    /if (${${CurrentSub}Announce} && ${AnnounceChannel.NotEqual[NULL]}  && ${AnnounceEvents.Find[TRY]}) /docommand /${AnnounceChannel} ${MezSpell} --> ${Target.CleanName}
	/if (${Spell[${MezSpell}].AERange.Int}) {
		/varset BeamTimer ${BeamTimer.OriginalValue}
		/varset BeamUsed 1
	}
    /call Cast "${MezSpell}" "${GemName}"
	/varset MezBuffer 2s
	/if (${Spell[${MezSpell}].AERange.Int}) {
		/varset BeamTimer ${BeamTimer.OriginalValue}
		/varset BeamUsed 1
	}
	/delay 2
	/delay 3s !${Me.Casting.ID}
	/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
		/if (!${Defined[MezTimer${MezID}]}) /declare MezTimer${MezID} timer outer ${Spell[${MezSpell}].Duration}s
		/varset MezTimer${MezID} ${Spell[${MezSpell}].Duration.TotalSeconds}s
		/if (${MezSpell.Equal[Nightmare Stasis]}) /varset MezTimer${MezID} 3m
		/varcalc mezcnt ${mezcnt}-1
		/if (${Macro.Return.Equal[CAST_SUCCESS]} && ${${CurrentSub}Announce} && ${AnnounceChannel.NotEqual[NULL]} && ${AnnounceEvents.Find[${Macro.Return}]}) /docommand /${AnnounceChannel} ${MezSpell} --> ${Target.CleanName} MEZZED						
	}
	/if (!${Spell[${MezSpell}].AERange.Int} && (${Macro.Return.Equal[CAST_IMMUNE]}||${Macro.Return.Equal[CAST_NOTHOLD]}))  {
		/if (!${Defined[MezTimer${MezID}]}) /declare  MezTimer${MezID} timer outer 9999999
		/varset MezTimer${MezID} 9999999
		/varcalc mezcnt ${mezcnt}-1
	}
	/if (${Macro.Return.Equal[CAST_RESIST]})  {
		/if (${${CurrentSub}Announce} && ${AnnounceChannel.NotEqual[NULL]} && ${AnnounceEvents.Find[${Macro.Return}]}) /docommand /${AnnounceChannel} ${MezSpell} --> ${Target.CleanName} RESIST						
	}
	/doevents
/return
|mez end

Also found an issue in sub iniload which was causing values in ini to be overwritten with defaults (this was the reason it didn't work when you tried to run it without an assistPC parameter).

Code:
Sub IniLoad(ininame,var,vartype,sec,default)
	/call Debug 3 "In Sub IniLoad"
	/if (!${Defined[${var}]} && (${default.Equal[NULL]})) /declare ${var} ${vartype} outer ${MMOIni[${ininame},${sec},${var}]}
	/if (!${Defined[${var}]} && (${default.NotEqual[NULL]})) /declare ${var} ${vartype} outer ${MMOIni[${ininame},${sec},${var},${default}]}
	| Poly: IF these variable have been delcared elsewhere (some have), then this sub will never set them to the right values and certin things will keep getting
	|       overwritten in the INI file (examples include AssistPC and ClearTargetDataAlias), this now allows the macro to run with just macro name, without the
	|       parameters afterwards (as it is intended).
	/if (${Defined[${var}]} && (${default.Equal[NULL]})) /varset ${var} ${MMOIni[${ininame},${sec},${var}]}
	/if (${Defined[${var}]} && (${default.NotEqual[NULL]})) /varset ${var} ${MMOIni[${ininame},${sec},${var},${default}]}
	/if (${vartype.Equal[string]}) {
		/if (${${var}.Equal[NULL]}) /mmoini "${ininame}" "${sec}" "${var}"
	}
	/if (${vartype.Equal[string]}) {
			/if (!${${var}.Equal[NULL]}) /mmoini "${ininame}" "${sec}" "${var}" "${${var}}"
	}
	/if (${vartype.Equal[int]}||${vartype.Equal[float]}) /mmoini "${ininame}" "${sec}" "${var}" "${${var}}"
	/if (${vartype.Equal[bool]}) {
		/if (!${${var}}) /mmoini "${ininame}" "${sec}" "${var}" "FALSE"
	} 
	/if (${vartype.Equal[bool]}) {
		/if (${${var}}) /mmoini "${ininame}" "${sec}" "${var}" "TRUE"
	}
	/varset ${var} ${Ini[${ininame},${sec},${var}]}
	/call Debug 3 "Leaving Sub IniLoad"
/return