canniv4-Caster Bot macro, updated 1-6-06

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

canniv4-Caster Bot macro, updated 1-6-06

Post by BardsAreTooEasy » Mon Jul 04, 2005 2:09 pm

This macro will autoheal, time buffs, canni, take commands from another toon if a master is specified, repeat everything your master says if needed(nice at the PoD's and Magus's), practice spells, plus many other useful things. It should work for any caster type, not just shamans. I tried to document it well in cannidoc.txt. This macro is a lot like genbot, i tried to keep all the commands the same(i.e. a master can tell you buff somebuff on soanaso, and sit, etc...) so that other macros that work with genbot will hopefully work with this one too. I can add just about anything needed, so post requests. This macro can buff the whole group rather than just a single person. try these commands:

/echo buff celerity on group except myself someothertoon this command will buff the whole group except you and someothertoon with celerity.

/echo watch group except myself this command will watch the whole group and heal them as needed. your shaman will automatically heal itself always.

KNOWN BUGS: When mounted certain spell[].duration's do not return correctly. Spell[Celerity].Duration, for instance, returns 160 while not mounted, 100 while mounted even though the actual duration does not change. Ferine Avatar is another such spell. It's not a bug in the macro.

UPDATED: docommandv5.inc to docommandv5_1.inc . Fixed sit

7/10/05 caster5.inc to caster5_1.inc fixed a problem with watch in 7/10/05 caster5_1.inc, /echo watch group will work properly now
7/10/05 fixed multiple problems with bufbott. Now /echo buff blah on group will work when a player is not in the zone rather than looping.

7/11/05 added skills.inc to practice spells
7/11/05 removed most double-spacing
7/11/05 added SitAfterCast
7/11/05 fixed problems with retargeting.

9/29/05 caster5_1.inc to caster5_4.inc. Fixed sit loop.
9/29/05 fixed timbuff problem, and made timebuff work for pets.
9/29/05 skills.inc to skills1_1.inc.

10/11/05 caster5_5.inc added SnareOnAssist
10/11/05 docommand5_2.inc, SnareOnAssist added.
10/11/05 CrappySpell.inc added if you dont have spell_routines.inc

10/14/05 caster5_5.inc Fixed a problem in sub watch.
10/14/05 CrappySpell.inc Fixed a problem with fd failing.

10/27/05 canniv4_2.mac/caster5_7.inc added reslow on resist and report slow resist to group.

12/8/05 canniv4_3.mac/caster5_8.mac added CanniStartPct. This is the pct mana your shaman will start to cast canni. Default is 100%.
12/8/05 caster5_8.inc updated ReslowOnResist and ReportSlowResistToGroup to work properly.

1/6/06 caster5_9.inc updated buff check, and fixed an issue with Sub Canni.
1/6/06 Updated buff check in Sorbuff.inc
1/6/06 canniv4_4.mac

anyway, here's the code, read cannidoc.txt for all the commands etc..

canniv4_4.mac

Code: Select all


#turbo
#include CrappySpell.inc
#include expv3.inc
#include docommandv5_2.inc
#include caster5_9.inc
#include saybotv2.inc
#include sorbuffv3.inc
#include skills1_1.inc

Sub Main

|This next line must be first, it get's our master if one is specified at runtime (/macro canniv3 SoAndSo)
/if (!${Defined[MyMaster]}) /declare MyMaster string outer ${MacroQuest.LastCommand.Arg[3]}
/if (!${Defined[GetMaster]}) /declare GetMaster int outer 0

|Put your healspell here
/if (!${Defined[HealSpell]}) /declare HealSpell string outer Quiescence

|Set what pct yourbot should start casting HealSpell if watching someone.
/if (!${Defined[HealSpellPct]}) /declare HealSpellPct int outer 85

|Put your fast heal spell here
/if (!${Defined[FastHealSpell]}) /declare FastHealSpell string outer Tnarg`s Mending

|Put your canni spell here
/if (!${Defined[CanniSpell]}) /declare CanniSpell string outer Cannibalize IV

|What PctMana to start canni.
/if (!${Defined[CanniStartPct]}) /declare CanniStartPct int outer 100

|Put your lich spell here.  Careful with this, because when practicing spells it will cast your lich spell while above 70% hp, so if that will kill you set your lich spell to a lower level one, or disable it in skills.inc, under Sub SkillHeal
/if (!${Defined[MyLichSpell]}) /declare MyLichSpell string outer Call of Bones

|Set what pct yourbot should start casting FastHealSpell if watching someone.
/if (!${Defined[FastHealSpellPct]}) /declare FastHealSpellPct int outer 70

|Put your slow spell here
/if (!${Defined[SlowSpell]}) /declare SlowSpell string outer Turgur's Insects

|Automatically slow on assist? on or off
/if (!${Defined[SlowOnAssist]}) /declare SlowOnAssist string outer on

|Report resisted slows to group? on or off
/if (!${Defined[ReportSlowResistToGroup]}) /declare ReportSlowResistToGroup string outer off

|Reslow when slows are resisted? on or off
/if (!${Defined[ReslowOnResist]}) /declare ReslowOnResist string outer off

|Put your snare spell here
/if (!${Defined[SnareSpell]}) /declare SnareSpell string outer Ensnare

|Automatically snare on assist? on or off
/if (!${Defined[SnareOnAssist]}) /declare SnareOnAssist string outer off

|Automatically send pet on assist? on or off
/if (!${Defined[PetAttackOnAssist]}) /declare PetAttackOnAssist string outer on

|Automatically refresh your own buffs? on or off
/if (!${Defined[AutoRefreshBuffs]}) /declare AutoRefreshBuffs string outer off

|Sit after cast?  on or off
/if (!${Defined[SitAfterCast]}) /declare SitAfterCast string outer off

|||||||||||||||||||||||||||END DEFINED|||||||||||||||||||||||||||||||||||||||||||||||||

|First check who my master is

	/if (${GetMaster}==0) /call GetMaster

	:MainLoop

		/doevents

		/if (${Defined[personnumber]} && ${personnumber}>0) /call watch

		/call canni

		/if (${Defined[BuffToCast1]}) /call CheckTimedBuffBot

		/if (${AutoRefreshBuffs.Equal[on]}) /call botbuff

		/call CheckBotHPs

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||Things you want to do each loop go here|||||||||||||||||||||||||||||||||
||||||||||||||||||Add events at the top of this macro, and any other Subs at the bottom|||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

	/goto :MainLoop

/return



Sub GetMaster

	/varset GetMaster 1

	/if (${MyMaster.NotEqual[NULL]}) {

		/echo My master is ${MyMaster}

} else {

	/echo I have no master!

}

/return



expv3.inc

Code: Select all


#turbo
#event popupexp "[MQ2] exp"
#event expgained "You gain #*#"

Sub exp
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||ADD A /doevents popupexp AND A|||||||||
|||||||||||||||/doevents expgained TO YOUR MACRO,|||||
|||||||||||||||AND /echo exp TO SEE EXP OUTPUT||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||DEFINES||||||||||||||||||||||||||||||||
	|Set this to yes to time OoW instance, otherwise set to no
	/if (!${Defined[oowinstance]}) /declare oowinstance string local no
	/if (!${Defined[numberkilledvar]}) /declare numberkilledvar int global 0
	/if (!${Defined[oldexpvar]}) /declare oldexpvar float global ${Me.PctExp}
	/if (!${Defined[expvar]}) /declare expvar float global 0
	/if (!${Defined[expperkillvar]}) /declare expperkillvar float global
	/if (!${Defined[exppermin]}) /declare exppermin float global
	/if (!${Defined[expperhour]}) /declare expperhour float global
	/if (!${Defined[oldaaexpvar]}) /declare oldaaexpvar float global ${Me.PctAAExp}
	/if (!${Defined[aaexpvar]}) /declare aaexpvar float global 0
	/if (!${Defined[aaexpperkillvar]}) /declare aaexpperkillvar float global
	/if (!${Defined[aaexppermin]}) /declare aaexppermin float global
	/if (!${Defined[aaexpperhour]}) /declare aaexpperhour float global
	/if (!${Defined[exptimevar]}) /declare exptimevar timer global 1000000000
	/if (!${Defined[zonetimevar]}) /declare zonetimevar timer global 214200
	/if (!${Defined[zonehourvar]}) /declare zonehourvar float global 0

	|||||||ANNOUNCE EXP|||||||||||||||||||||||||||
	/if (${numberkilledvar}!=0) {

		|Calc exp
		/if (${Me.PctExp}<${oldexpvar}) /varcalc expvar ${Me.PctExp}+100-${oldexpvar}+${expvar}
		/if (${Me.PctExp}>${oldexpvar}) /varcalc expvar ${Me.PctExp}-${oldexpvar}+${expvar}

		/if (${Me.PctAAExp}<${oldaaexpvar}) /varcalc aaexpvar ${Me.PctAAExp}+100-${oldaaexpvar}+${aaexpvar}
		/if (${Me.PctAAExp}>${oldaaexpvar}) /varcalc aaexpvar ${Me.PctAAExp}-${oldaaexpvar}+${aaexpvar}

		|Calc exp/kill
		/varcalc expperkillvar ${expvar}/${numberkilledvar}
		/varcalc aaexpperkillvar ${aaexpvar}/${numberkilledvar}

		|Calc exp/minute and exp/hour
		/varcalc exppermin 1000000000-${exptimevar}
		/varcalc expperhour 1000000000-${exptimevar}
		/varcalc exppermin ${exppermin}/600
		/varcalc expperhour ${expperhour}/36000
		/if (${exppermin}>=.01) /varcalc exppermin ${expvar}/${exppermin}
		/if (${expperhour}>=.01) /varcalc expperhour ${expvar}/${expperhour}

		/varcalc aaexppermin 1000000000-${exptimevar}
		/varcalc aaexpperhour 1000000000-${exptimevar}
		/varcalc aaexppermin ${aaexppermin}/600
		/varcalc aaexpperhour ${aaexpperhour}/36000
		/if (${aaexppermin}>=.01) /varcalc aaexppermin ${aaexpvar}/${aaexppermin}
		/if (${aaexpperhour}>=.01) /varcalc aaexpperhour ${aaexpvar}/${aaexpperhour}
		|Calc zonetime
		/varcalc zonehourvar ${zonetimevar}/36000

		|Echo
		/echo ${numberkilledvar} kills.

		/if (${expvar}!=0) /echo ${expvar}% exp, ${expperkillvar}% exp per kill, ${exppermin}% exp per minute, ${expperhour}% exp per hour.
		/if (${aaexpvar}!=0) /echo ${aaexpvar}% AAexp, ${aaexpperkillvar}% AAexp per kill, ${aaexppermin}% AAexp per minute, ${aaexpperhour}% AAexp per hour.

		/if (${oowinstance.Equal[yes]}) /echo ${zonehourvar} hours left.
}
||||Reset variables
	/varset oldexpvar ${Me.PctExp}
	/varset oldaaexpvar ${Me.PctAAExp}
/return

Sub slain
	/if (!${Defined[numberkilledvar]}) /declare numberkilledvar int global 0
	/varcalc numberkilledvar ${numberkilledvar}+1
/return

Sub Event_popupexp
	/if (${numberkilledvar}!=0) {
		/echo ${numberkilledvar} kills.

		/if (${expvar}!=0) /echo ${expvar}% exp, ${expperkillvar}% exp per kill, ${exppermin}% exp per minute, ${expperhour}% exp per hour.
		/if (${aaexpvar}!=0) /echo ${aaexpvar}% AAexp, ${aaexpperkillvar}% AAexp per kill, ${aaexppermin}% AAexp per minute, ${aaexpperhour}% AAexp per hour.

		/if (${oowinstance.Equal[yes]}) /echo ${zonehourvar} hours left.

} else {
	/echo No exp yet!
}
/return

Sub Event_expgained
	/call slain
	/call exp
/return



docommandv5_2.inc

Code: Select all


#turbo
#event command12 "#1# tells you, 'do #2#'"

#event followme "#1# tells the group, 'follow #2#'"
#event followme "#1# tells you, 'follow #2#'"

#event stop "#1# tells the group, 'stop'"
#event stop "#1# tells you, 'stop'"

#event sit "#1# tells the group, 'sit'"
#event sit "#1# tells you, 'sit'"

#event stand "#1# tells the group, 'stand'"
#event stand "#1# tells you, 'stand'"

#event assist "#1# tells the group, 'assist'"
#event assist "#1# tells you, 'assist'"

Sub Event_command12(command12Text,MasterName,command)
	/if (${MasterName.Equal[${MyMaster}]}) ${command}
/return

Sub Event_followme(Text,MasterName,FollowName)
	/if (${MasterName.Equal[${MyMaster}]}) {
		/if (!${FollowName.Length} || ${FollowName.Equal[me]} || ${FollowName.Equal[${MyMaster}]}) {
			/tar  pc ${MyMaster}
			/if (!${Me.Mount.ID}) {
				/squelch /stick 15	
		} else {
			/fol	
		}	
	} else {
			/tar pc ${FollowName}
			/if (!${Me.Mount.ID}) {
				/squelch /stick 15	
		} else {
			/fol	
		}	
	}
		/t ${MyMaster} I'm now following ${Target.Name}
}
/return

Sub Event_stop(text,MasterName)
	/if (${MasterName.Equal[${MyMaster}]}) {
		/keypress right hold
		/delay 25
		/keypress left
		/face
		/squelch /stick off
		/t ${MyMaster} Stopping.
}
/return

Sub Event_sit(text,MasterName)
	/if (${MasterName.Equal[${MyMaster}]}) {	
		/squelch /stick off	
		/if (${Me.State.Equal[STAND]}) /sit		
}
/return



Sub Event_stand(text,MasterName)
	/if (${MasterName.Equal[${MyMaster}]}) {		
		/squelch /stick off	
		/if (${Me.State.Equal[SIT]}) /stand		
}
/return



Sub Event_assist(text,MasterName)
	/if (${MasterName.Equal[${MyMaster}]}) {		
		/squelch /tar clear
		/assist ${MyMaster}		
		/delay 2s	
}
	/if (${Defined[PetAttackOnAssist]} && ${PetAttackOnAssist.Equal[on]} && ${Me.Pet.ID}) {		
		/pet attack
		/delay 2s
}
	/if (${Defined[SlowOnAssist]} && ${SlowOnAssist.Equal[on]}) {		
		/call Cast "${SlowSpell}" gem3
		/delay 2s
}
	/if (${Defined[SnareOnAssist]} && ${SnareOnAssist.Equal[on]}) {		
		/call Cast "${SnareSpell}" gem3
		/delay 2s
}

/return



saybotv2.inc

Code: Select all


#turbo
#event saycommand "#1# says, '#2#'"
#event saybot "#1# tells you, 'saybot #2#'"
#event saybot "#1# saybot #2#"


Sub Event_saycommand(saycommandText,MasterName,command)
	/if (${MasterName.NotEqual[${MyMaster}]}) /return
	/if (${saybot}==0) /return
	/say ${command}
	/return
}
/return

Sub Event_saybot(text,MasterName,OnOrOff)
	/if (!${Defined[saybot]}) /declare saybot int outer 0
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff.NotEqual[on]}) {
		/echo Usage: saybot on|off
		/return
}
		/if (${OnOrOff.Equal[on]}) {
			/varset saybot 1
			/echo Toggling saybot: on.
}
		/if (${OnOrOff.Equal[off]}) {
			/varset saybot 0
			/echo Toggling saybot: off.
}
/return



sorbuffv3.inc

Code: Select all


#turbo

Sub botbuff
||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||THIS INCLUED WILL KEEP TRACK OF YOUR||||
||||||||||||||BUFFS AND ASK YOUR GENBOTS TO RENEW|||||
||||||||||||||THEM WHEN NEEDED.  KEEPS TRACK OF UP||||
||||||||||||||TO TWELVE BUFFS.  EACH BUFF ALLOWS 30|||
||||||||||||||SECONDS FOR THE GENBOT TO CAST.  ADD A||
||||||||||||||/call botbuff TO YOUR MACRO WHEN SAFE.||
||||||||||||||YOU MUST INCLUDE spell_routines.inc|||||
||||||||||||||OR spellcast.inc IN YOU MACRO.||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||

	||||||CHANGE THESE VARIABLES TO YOUR BUFFS||||
	||||||CHANGE THE REST TO none|||||||||||||||||

	/if (!${Defined[buff1]}) /declare buff1 string outer Focus of the Seventh
	/if (!${Defined[buff2]}) /declare buff2 string outer Blessing of Replenishment
	/if (!${Defined[buff3]}) /declare buff3 string outer Ancestral Guard
	/if (!${Defined[buff4]}) /declare buff4 string outer Endurance of the Boar
	/if (!${Defined[buff5]}) /declare buff5 string outer none
	/if (!${Defined[buff6]}) /declare buff6 string outer none
	/if (!${Defined[buff7]}) /declare buff7 string outer none
	/if (!${Defined[buff8]}) /declare buff8 string outer none
	/if (!${Defined[buff9]}) /declare buff9 string outer none
	/if (!${Defined[buff10]}) /declare buff10 string outer none
	/if (!${Defined[buff11]}) /declare buff11 string outer none
	/if (!${Defined[buff12]}) /declare buff12 string outer none
	/if (!${Defined[buff13]}) /declare buff13 string outer none
	/if (!${Defined[buff14]}) /declare buff14 string outer none
	/if (!${Defined[buff15]}) /declare buff15 string outer none
	
	||||||CHANGE caster# TO THE CASTER OF buff#|||
	||||||CAN BE YOUR OWN NAME IF NEEDED||||||||||
	
	/if (!${Defined[caster1]}) /declare caster1 string outer
	/if (!${Defined[caster2]}) /declare caster2 string outer
	/if (!${Defined[caster3]}) /declare caster3 string outer
	/if (!${Defined[caster4]}) /declare caster4 string outer
	/if (!${Defined[caster5]}) /declare caster5 string outer 
	/if (!${Defined[caster6]}) /declare caster6 string outer 
	/if (!${Defined[caster7]}) /declare caster7 string outer 
	/if (!${Defined[caster8]}) /declare caster8 string outer 
	/if (!${Defined[caster9]}) /declare caster9 string outer 
	/if (!${Defined[caster10]}) /declare caster10 string outer 
	/if (!${Defined[caster11]}) /declare caster11 string outer 
	/if (!${Defined[caster12]}) /declare caster12 string outer
	/if (!${Defined[caster13]}) /declare caster13 string outer
	/if (!${Defined[caster14]}) /declare caster14 string outer
	/if (!${Defined[caster15]}) /declare caster15 string outer
	
	/if (!${Defined[waitbuff]}) /declare waitbuff timer local

	/if (!${Defined[totalbuffs]}) /declare totalbuffs int local 15
	
	/if (!${Defined[currentbuff]}) /declare currentbuff int local 1
	/if (!${Defined[tmpbuff]}) /declare tmpbuff int local 1
	
||||||||||||||||||||||||||||||||||END DEFINES|||||||||||||||||||||||||||||

	/for currentbuff 1 to ${totalbuffs}	
		/if (${NearestSpawn[1, pc ${caster${currentbuff}}].Distance}<${Math.Calc[${Spell[${buff${currentbuff}}].Range}-5]}) {
			/if (${buff${currentbuff}.NotEqual[none]} && ${NearestSpawn[1, pc ${caster${currentbuff}}].ID}) {
				/varset tmpbuff 1
				/for tmpbuff 1 to 20
				/if (!${Me.Buff[${tmpbuff}].Name.Equal[${buff${currentbuff}}]}) /next tmpbuff
				/if (${tmpbuff}==21) {
					/if (${NearestSpawn[1, pc ${caster${currentbuff}}].Name.NotEqual[${Me.Name}]}) {
						/t ${caster${currentbuff}} buff ${buff${currentbuff}}
						/varset waitbuff 300
						:Loop1
						/varset tmpbuff 1
						/for tmpbuff 1 to 20
						/if (${NearestSpawn[1, pc ${caster${currentbuff}}].Distance}>${Math.Calc[${Spell[${buff${currentbuff}}].Range}-5]} || ${waitbuff}==0) /return
						/if (!${Me.Buff[${tmpbuff}].Name.Equal[${buff${currentbuff}}]}) /next tmpbuff
						/if (${tmpbuff}==21) /goto :Loop1
			}
				/if (${NearestSpawn[1, pc ${caster${currentbuff}}].Name.Equal[${Me.Name}]}) {
					/tar myself
					/delay 1s
					/call Cast "${buff${currentbuff}}" gem4
					/delay 1s
			}
		}
	}
}
	/next currentbuff	
	/varset currentbuff 1
/return



skills1_1.inc

Code: Select all


#turbo
#event PracSkill "[MQ2] practice #1#"
#event StopPrac "[MQ2] stop practicing"
Sub Event_PracSkill(text,spellname)
	/if (!${Spell[${spellname}].ID}) {
		/echo Invalid spell!
		/return
}
	/echo Practicing: ${spellname}.
	:PracSpell
		/doevents
		|this checks if you need to cast lich
		/if (${Me.Class.ID}==11) {
			/if (!${Defined[CheckAllBuffs]}) /declare CheckAllBuffs int local 0
			/if (!${Defined[NoLich]}) /declare NoLich int local 0
			/for CheckAllBuffs 1 to 15
				/if (${Me.Buff[${CheckAllBuffs}].Name.Equal[${MyLichSpell}]}) {
					/varset CheckAllBuffs 15
					/varset NoLich 1
	}
			/next CheckAllBuffs
			/if (${NoLich}==0) {
				/if (!${Me.Moving} && ${Me.PctHPs}>80) /call Cast "${MyLichSpell}" gem5
	}
			/varset CheckAllBuffs 0
			/varset NoLich 0
}
		|check if i need to canni, or heal, and autoinv if something is in my hand
		/if (${Me.PctMana}<50 && ${Me.Class.ID}==10) /call canni
		/if (${Me.PctMana}<50 && ${Me.Class.ID}!=10) /call SkillHeal
		/if (${Cursor.ID}) /autoinv
		|otherwise target myself and start practicing the spell
		/tar myself
		/if (${Me.Gem[1].Name.NotEqual[${spellname}]} || !${Me.Gem[1].ID}) {
			/memspell 1 "${spellname}"
			/delay 6s
}
		/if (!${Me.Moving} && ${Me.SpellReady[${spellname}]}) /call Cast "${spellname}" gem1
		/if (${SitAfterCast.Equal[on]} && ${Me.State.Equal[STAND]}) /sit
		/goto :PracSpell
/return

Sub SkillHeal
	:Heal
		|this checks if you need to cast lich
		/if (${Me.Class.ID}==11) {
			/if (!${Defined[CheckAllBuffs]}) /declare CheckAllBuffs int local 0
			/if (!${Defined[NoLich]}) /declare NoLich int local 0
			/for CheckAllBuffs 1 to 15
				/if (${Me.Buff[${CheckAllBuffs}].Name.Equal[${MyLichSpell}]}) {
					/varset CheckAllBuffs 15
					/varset NoLich 1
	}
			/next CheckAllBuffs
			/if (${NoLich}==0) {
				/if (!${Me.Moving} && ${Me.PctHPs}>80) /call Cast "${MyLichSpell}" gem5
	}
			/varset CheckAllBuffs 0
			/varset NoLich 0
}
		|doevents, sit and return when mana's back up
		/doevents
		/if (${Me.State.Equal[STAND]}) /sit
		/if (${Me.PctMana}>95) /return
	/goto :Heal
/return

Sub Event_StopPrac
	/echo Done practicing.
	/call Main
/return

Last edited by BardsAreTooEasy on Sat Jan 07, 2006 7:50 pm, edited 40 times in total.

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

cannidoc.txt

Post by BardsAreTooEasy » Mon Jul 04, 2005 2:41 pm

caster5_9.inc

Code: Select all


#turbo
#event watch "#1# watch #2#"
#event watch "#1# tells you, 'watch #2#'"
#event watch "#1# tells the group, 'watch #2#'"
#event healbot "#1# tells you, 'heal #2#'"
#event healbot "#1# tells the group, 'heal #2#'"
#event healbot "#1# heal #2#"
#event fasthealbot "#1# tells you, 'fastheal #2#'"
#event fasthealbot "#1# tells the group, 'fastheal #2#'"
#event fasthealbot "#1# fastheal #2#"
#event buffbot "#1# tells you, 'buff #2#'"
#event buffbot "#1# tells the group, 'buff #2#'"
#event buffbot "#1# buff #2#"
#event Timedbuffbot "#1# tells you, 'timebuff #2#'"
#event Timedbuffbot "#1# tells the group, 'timebuff #2#'"
#event Timedbuffbot "#1# timebuff #2#"
#event canni "#*#canni on#*#"
#event cannioff "#*#canni off#*#"
#event interruptedcast "[MQ2] Spell was interrupted..."
#event pausebot "[MQ2] pause"
#event pausebot "#1# tells you, 'pause'"
#event pausebot "#1# tells the group, 'pause'"
#event unpausebot "[MQ2] unpause"
#event unpausebot "#1# tells you, 'unpause'"
#event unpausebot "#1# tells the group, 'unpause'"
#event castbot "#1# tells you, 'sn #2#"
#event castbot "#1# tells the group, 'sn #2#"
#event castbot "[#1#] sn #2#"
#event castbot "#1# tells you, 'cast #2#"
#event castbot "#1# tells the group, 'cast #2#"
#event castbot "[#1#] cast #2#"
#event refreshbuffs "#1# tells you, 'refresh buffs'"
#event refreshbuffs "#1# tells the group, 'refresh buffs'"
#event refreshbuffs "[MQ2] refresh buffs"
#event resistbot "#1# resisted the #2# spell."
#event invalidname "There are no spawns matching#1#"
#event botpet "#1# tells you, 'pet#2#'"
#event botpet "#1# tells the group, 'pet#2#'"
#event HealPct "#1# tells you, 'healpct #2#'"
#event HealPct "#1# tells the group, 'healpct #2#'"
#event HealPct "#1# healpct #2#"
#event HealPct "#1# tells you, 'healpct'"
#event HealPct "#1# tells the group, 'healpct'"
#event HealPct "#1# healpct"
#event FastHealPct "#1# tells you, 'fasthealpct #2#'"
#event FastHealPct "#1# tells the group, 'fasthealpct #2#'"
#event FastHealPct "#1# fasthealpct #2#"
#event FastHealPct "#1# tells you, 'fasthealpct'"
#event FastHealPct "#1# tells the group, 'fasthealpct'"
#event FastHealPct "#1# fasthealpct"
#event TargFarAway "Your target is out of range, get closer!"
#event SlowOnAssist "#1# tells you, 'slowonassist #2#'"
#event SlowOnAssist "#1# tells the group, 'slowonassist #2#'"
#event SlowOnAssist "#1# slowonassist #2#"
#event ReportSlowResistToGroup "#1# tells you, 'ReportSlowResist #2#'"
#event ReportSlowResistToGroup "#1# tells the group, 'ReportSlowResist #2#'"
#event ReportSlowResistToGroup "#1# ReportSlowResist #2#"
#event Reslow "#1# tells you, 'Reslow #2#'"
#event Reslow "#1# tells the group, 'Reslow #2#'"
#event Reslow "#1# Reslow #2#"
#event PetAttackOnAssist "#1# tells you, 'petattackonassist #2#'"
#event PetAttackOnAssist "#1# tells the group, 'petattackonassist #2#'"
#event PetAttackOnAssist "#1# petattackonassist #2#"
#event Loot "#1# tells you, 'Lootall'"
#event Loot "#1# tells the group, 'Lootall'"
#event Loot "#1# Lootall"
#event ToggleSitAfterCast "#1# tells you, 'sitaftercast #2#'"
#event ToggleSitAfterCast "#1# tells the group, 'sitaftercast #2#'"
#event ToggleSitAfterCast "#1# sitaftercast #2#"

Sub watch
	/if (!${Defined[currentnum]}) /declare currentnum int outer 1
	/varset currentnum 1
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/for currentnum 1 to ${personnumber}
		/if (!${NearestSpawn[1, ${person${currentnum}}].ID}) {
			/if (${currentnum}!=${personnumber}) /next currentnum
			/if (${currentnum}==${personnumber}) /return
}
		/if (${NearestSpawn[1, ${person${currentnum}}].PctHPs}<${FastHealSpellPct}) {
			/tar ${person${currentnum}}
			/delay 1s
			/if (${MyMaster.NotEqual[NULL]}) /t ${MyMaster} Casting ${FastHealSpell} on ${person${currentnum}}.
			:Cast
			/if (${Bool[${Me.Casting}]}) /goto :Cast
			/call Cast "${FastHealSpell}" gem6
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			/delay 2s
			/squelch /tar ${TempOldTarget}
}
		/if (${NearestSpawn[1, ${person${currentnum}}].PctHPs}<${HealSpellPct} && ${healtimer${currentnum}}==0) {
			/tar ${person${currentnum}}
			/delay 1s
			/if (${MyMaster.NotEqual[NULL]}) /t ${MyMaster} Casting ${HealSpell} on ${person${currentnum}}.
			:Cast
			/if (${Bool[${Me.Casting}]}) /goto :Cast
			/call Cast "${HealSpell}" gem1
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			/varcalc healtimer${currentnum} ${Spell[${HealSpell}].Duration}*60
			/delay 2s
			/squelch /tar ${TempOldTarget}
}
	/next currentnum
	/varset currentnum 1
/return

Sub canni
	/if (!${Defined[CanniOn]}) /declare CanniOn int outer 0
	/if (${Me.Class.Name.NotEqual[Shaman]} || ${CanniOn}==1) /return
	/call CheckBotHPs
		|If my mana is less than 100, and im not moving
		/if (${Me.PctMana}<${CanniStartPct} && !${Me.Moving}) {
			|Otherwise canni if hp permits
			|Canni5 if ready and needed
			/if (${Me.CurrentMana}<${Me.MaxMana}-1066 && ${Me.CurrentHPs}>${Me.MaxHPs}\5+1924 && ${Me.AltAbilityReady[47]} && !${Me.Moving}) {
				/declare TempOldTarget string local ${Target.Type} ${Target.Name}
				/tar myself
				/if (!${Me.Gem[${HealSpell}]}) /call MemQui
				:HealMyself
				/if (${Me.SpellReady[${HealSpell}]} && ${Bool[!${Me.Casting}]}) /call Cast "${HealSpell}" gem1
				/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
				/if (!${Defined[tmpbuff]}) /declare tmpbuff int local 1
				/varset tmpbuff 1
				/for tmpbuff 1 to 20
				/if (!${Me.Buff[${tmpbuff}].Name.Equal[${HealSpell}]}) /next tmpbuff
				/if (${tmpbuff}<21) {
					/alt activate 47
					/delay 2s
					/squelch /tar ${TempOldTarget}
					/deletevar TempOldTarget
		} else {
				/goto :HealMyself
		}
	}
			/if (${Me.PctHPs}>60 && !${Me.Moving} && ${Me.SpellReady[${CanniSpell}]} && ${Bool[!${Me.Casting}]}) /call Cast "${CanniSpell}" gem7
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit

}
/return

Sub CheckBotHPs
	|If im not already Quiescenced, and hp is less than 65, tar myself and cast Quiescence
	/if (!${Defined[tmpbuff]}) /declare tmpbuff int local 1
	/varset tmpbuff 1
	/for tmpbuff 1 to 20
	/if (${Me.Buff[${tmpbuff}].Name.Equal[${HealSpell}]}) /return
	/next tmpbuff
		|else
	/if (${Me.PctHPs}<65) {
		/delay 4s
		/declare TempOldTarget string local ${Target.Type} ${Target.Name}
		/tar myself
		/if (!${Me.Gem[${HealSpell}]}) /call MemQui
		/if (${Me.SpellReady[${HealSpell}]} && ${Bool[!${Me.Casting}]}) /call Cast "${HealSpell}" gem1
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/squelch /tar ${TempOldTarget}
		/deletevar TempOldTarget
}
/return

Sub MemQui
	/memspell 1 "${HealSpell}"
	:Sitting
	/if (${Me.State.Equal[SIT]}) /goto :Sitting
	/delay 5s
/return

Sub CheckTimedBuffBot
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/declare CTB int local 0
	/for CTB 1 to ${CurrentTimedBuff}
		/if (${TimedBuff${CTB}}==0 && ${NearestSpawn[1, ${WhoToBuff${CTB}}].ID}) {
			/if (${NearestSpawn[1, ${WhoToBuff${CTB}}].Distance}>${Spell[${BuffToCast${CTB}}].Range} && ${Spell[${BuffToCast${CTB}}].AERange}==0) {
				/varset TimedBuff${CTB} 400
				/echo ${WhoToBuff${CTB}} is out of range of spell ${BuffToCast${CTB}}.  Retrying in 40 seconds.
				/next CTB
	} else {
			/delay 2s
			/tar ${WhoToBuff${CTB}}
			/echo Casting ${BuffToCast${CTB}} on ${WhoToBuff${CTB}}.
			:Cast
			/if (${Bool[${Me.Casting}]}) /goto :Cast
			/call Cast "${BuffToCast${CTB}}" gem4
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			/varcalc TimedBuff${CTB} ${Spell[${BuffToCast${CTB}}].Duration}*60-300
			/delay 1s
	}
		/squelch /tar ${TempOldTarget}
}
	/next CTB
/return

Sub Event_watch(msg,MasterName,name)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	|Homemade array
	/if (!${Defined[personnumber]}) /declare personnumber int outer 0
	/varcalc personnumber ${personnumber}+1
	|Set person# to name
	/if (!${Defined[person${personnumber}]}) /declare person${personnumber} string outer ${name}
	|if person# is myself or yourself set person# to me.name
	/if (${person${personnumber}.Equal[myself]} || ${person${personnumber}.Equal[yourself]}) /varset person${personnumber} ${Me}
	|If person# is group, subtract 1 from ${personnumber} so that a pc named group
	|is not watched(this is added back later), but first check if a person(s) from
	|group is excluded.
	/if (${person${personnumber}.Find[group]}) {
		/if (${person${personnumber}.Find[except]}) {
			|Now hack group and except off of person#, and add the 1 back
			/declare TempPersonNames string local ${name.Mid[${Math.Calc[${name.Find[except]}+7]}, ${name.Length}]}
			:GotPerson
			/varcalc personnumber ${personnumber}-1
			/declare TempGroupWatch int local 0
			/if (${TempPersonNames.Find[myself]} || ${TempPersonNames.Find[yourself]}) /varset TempGroupWatch 1
			/for TempGroupWatch ${TempGroupWatch} to ${Group.Members}
				/if (${TempPersonNames.Find[me]} && ${Group.Member[${TempGroupWatch}].Name.Equal[${MyMaster}]}) {
					/if (${TempGroupWatch}==${Group.Members}) /return
					/next TempGroupWatch
		}
				/if (${TempPersonNames.Find[${Group.Member[${TempGroupWatch}]}]}) {
					/if (${TempGroupWatch}==${Group.Members}) /return
					/next TempGroupWatch
		}
				|If the person is not an exception
				/varcalc personnumber ${personnumber}+1
				/if (${Defined[person${personnumber}]}) /varset person${personnumber} ${Group.Member[${TempGroupWatch}]}
				/if (!${Defined[person${personnumber}]}) /declare person${personnumber} string outer ${Group.Member[${TempGroupWatch}]}
				/declare healtimer${personnumber} timer outer 0
				/echo Watching ${person${personnumber}}
			/next TempGroupWatch
	|else if except is not found
	} else {
			/declare CurrentGroupMember int local 0
			/varset CurrentGroupMember 0
			/varcalc personnumber ${personnumber}-1
			/for CurrentGroupMember 0 to ${Group.Members}
				/varcalc personnumber ${personnumber}+1
				/if (!${Defined[person${personnumber}]}) /declare person${personnumber} string outer
				/varset person${personnumber} ${Group.Member[${CurrentGroupMember}]}
				/declare healtimer${personnumber} timer outer 0
				/echo Watching ${person${personnumber}}
			/next CurrentGroupMember
			/deletevar CurrentGroupMember
	}
|else if group was not found
} else {
		/echo Watching ${person${personnumber}}
		/declare healtimer${personnumber} timer outer 0
}
/return

Sub Event_healbot(text,MasterName,Name)
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${Name.Equal[yourself]} || ${Name.Equal[myself]}) /varset Name ${Me}
	/if (${Name.Equal[me]}) {
		/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${HealSpell}].Range} && ${Spell[${HealSpell}].AERange}==0) {
			/t ${MyMaster} you are out of range of ${HealSpell}!
			/squelch /tar ${TempOldTarget}
			/return
	}
		/targ ${MyMaster}
		/delay 1s
		/t ${MyMaster} Casting ${HealSpell} on ${MyMaster}.
		:Cast
		/if (${Bool[${Me.Casting}]}) /goto :Cast
		/call Cast "${HealSpell}" gem1
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/delay 1s
} else {
		/if (${NearestSpawn[1, ${Name}].Distance}>${Spell[${HealSpell}].Range} && ${Spell[${HealSpell}].AERange}==0) {
			/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${Name} is out of range of ${HealSpell}!
			/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${Name} is out of range of ${HealSpell}!
			/squelch /tar ${TempOldTarget}
			/return
	}
		/tar ${Name}
		/delay 1s
		/t ${MyMaster} Casting ${HealSpell} on ${Name}.
		:Cast2
		/if (${Bool[${Me.Casting}]}) /goto :Cast2
		/call Cast "${HealSpell}" gem1
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/delay 1s
}
	/squelch /tar ${TempOldTarget}
/return

Sub Event_fasthealbot(text,MasterName,Name)
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${Name.Equal[yourself]} || ${Name.Equal[myself]}) /varset Name ${Me}
	/if (${Name.Equal[me]}) {
		/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${FastHealSpell}].Range} && ${Spell[${FastHealSpell}].AERange}==0) {
			/t ${MyMaster} you are out of range of ${FastHealSpell}!
			/squelch /tar ${TempOldTarget}
			/return
	}
		/targ ${MyMaster}
		/delay 1s
		/t ${MyMaster} Casting ${FastHealSpell} on ${MyMaster}.
		:Cast
		/if (${Bool[${Me.Casting}]}) /goto :Cast
		/call Cast "${FastHealSpell}" gem6
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/delay 1s
} else {
		/if (${NearestSpawn[1, ${Name}].Distance}>${Spell[${FastHealSpell}].Range} && ${Spell[${FastHealSpell}].AERange}==0) {
			/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${Name} is out of range of ${FastHealSpell}!
			/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${Name} is out of range of ${FastHealSpell}!
			/squelch /tar ${TempOldTarget}
			/return
	}
		/tar ${Name}
		/delay 1s
		/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} Casting ${FastHealSpell} on ${Name}.
		/if (${MasterName.Equal[[[[MQ2]]]]}) /echo Casting ${FastHealSpell} on ${Name}.
		:Cast2
		/if (${Bool[${Me.Casting}]}) /goto :Cast2
		/call Cast "${FastHealSpell}" gem6
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/delay 1s
}
	/squelch /tar ${TempOldTarget}
/return

Sub Event_cannioff
	/varset CanniOn 1
/return

Sub Event_canni
	/varset CanniOn 0
/return

Sub Event_buffbot(text, MasterName, Buff)
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/if (!${Defined[WhoToBuff]}) /declare WhoToBuff string outer
	/varset WhoToBuff NULL
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
|Check if the buff is to be cast on MyMaster or another pc. If on another pc check the
|name of the buff to be cast
	/if (${Buff.Find[ on ]}) {
		/if (${Buff.Find[ group]}) {
			/if (${Buff.Find[ except ]}) {
				/if (!${Defined[Exceptions]}) /declare Exceptions string local
				|This line cuts the end off of ${Buff} to get our exceptions
				/varset Exceptions ${Buff.Mid[${Math.Calc[${Buff.Find[except]}+7]}, ${Buff.Length}]}
				/if (${Defined[BuffToCast]}) /deletevar BuffToCast
				|This line chops our buff off of ${Buff}
				/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
				/if (!${Defined[CurrentGroupMember]}) /declare CurrentGroupMember int local 0
				/varset CurrentGroupMember 0
				/if (${Exceptions.Find[myself]} || ${Exceptions.Find[yourself]}) /varset CurrentGroupMember 1
				/for CurrentGroupMember ${CurrentGroupMember} to ${Group.Members}
					/if (${Exceptions.Find[me]} && ${Group.Member[${CurrentGroupMember}].Name.Equal[${MyMaster}]}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
					/if (${Exceptions.Find[${Group.Member[${CurrentGroupMember}]}]}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
				  /if (!${NearestSpawn[1, ${Group.Member[${CurrentGroupMember}]}].ID}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
					/varset WhoToBuff ${Group.Member[${CurrentGroupMember}]}

					/if (${WhoToBuff.NotEqual[NULL]}) {
						/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
							/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
							/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
							/squelch /tar ${TempOldTarget}
							/return
				}
						/tar ${WhoToBuff}
						/delay 1s
						:Cast3
						/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
						/delay 2s
						/echo Casting ${BuffToCast} on ${WhoToBuff}.
						:Cast
						/if (${Bool[${Me.Casting}]}) /goto :Cast
						/call Cast "${BuffToCast}" gem4
						/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			}
	/next CurrentGroupMember
	/squelch /tar ${TempOldTarget}
	/return
		|Else if no exceptions
		} else {
				/if (${Defined[BuffToCast]}) /deletevar BuffToCast
				|Get buff from ${Buff}
				/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
				/declare CurrentGroupMember int local 0
				/varset CurrentGroupMember 0
				/for CurrentGroupMember 0 to ${Group.Members}
					/if (!${NearestSpawn[1, ${Group.Member[${CurrentGroupMember}]}].ID}) {
					/if (${CurrentGroupMember}==${Group.Members}) /return
					/next CurrentGroupMember
				}
					/varset WhoToBuff ${Group.Member[${CurrentGroupMember}]}
					/if (${WhoToBuff.NotEqual[NULL]}) {
						/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
							/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
							/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
							/squelch /tar ${TempOldTarget}
							/if (${CurrentGroupMember}==${Group.Members}) /return
							/next CurrentGroupMember
				}
						/tar ${WhoToBuff}
						/delay 1s
						:Cast3
						/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
						/delay 2s
						/echo Casting ${BuffToCast} on ${WhoToBuff}.
						:Cast2
						/if (${Bool[${Me.Casting}]}) /goto :Cast2
						/call Cast "${BuffToCast}" gem4
						/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			}
				/next CurrentGroupMember
				/squelch /tar ${TempOldTarget}
				/return
		}
	}
		/varset WhoToBuff ${Buff.Arg[${Math.Calc[${Buff.Count[ ]}+1]}]}
		/if (${WhoToBuff.Equal[myself]} || ${WhoToBuff.Equal[yourself]}) /varset WhoToBuff ${Me}
		/if (${Defined[BuffToCast]}) /deletevar BuffToCast
		|Get buff from ${Buff}
		/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
}
	:GotBuff
	/if (${WhoToBuff.Equal[NULL]} || ${WhoToBuff.Equal[me]}) {
		/if (${Buff.Find[ on ]}) {
			/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
				/t ${MyMaster} You are too far away!
				/squelch /tar ${TempOldTarget}
				/return
		}
	} else {
			/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${Buff}].Range} && ${Spell[${Buff}].AERange}==0) {
				/t ${MyMaster} You are too far away!
				/squelch /tar ${TempOldTarget}
				/return
		}
	}
		/if (${MyMaster.NotEqual[NULL]}) {
			/tar ${MyMaster}
	} else {
			/tar myself
	}
		/delay 1s
		/if (${WhoToBuff.Equal[NULL]}) {
			:Cast1
			/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast1
			/delay 2s
			/if (${MyMaster.NotEqual[NULL]}) {
				/echo Casting ${Buff} on ${MyMaster}.
		} else {
				/echo Casting ${Buff} on ${Me}
		}
			:Cast3
			/if (${Bool[${Me.Casting}]}) /goto :Cast3
			/call Cast "${Buff}" gem4
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
	}
		/if (${WhoToBuff.Equal[me]}) {
			:Cast2
			/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast2
			/delay 2s
			/echo Casting ${BuffToCast} on ${MyMaster}.
			:Cast4
			/if (${Bool[${Me.Casting}]}) /goto :Cast4
			/call Cast "${BuffToCast}" gem4
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
	}
}
	/if (${WhoToBuff.NotEqual[NULL]}) {
		/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
			/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
			/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
			/squelch /tar ${TempOldTarget}
			/return
	}
		/tar ${WhoToBuff}
		/delay 1s
		:Cast3
		/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
		/delay 2s
		/echo Casting ${BuffToCast} on ${WhoToBuff}.
		:Cast5
		/if (${Bool[${Me.Casting}]}) /goto :Cast5
		/call Cast "${BuffToCast}" gem4
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
}
	/squelch /tar ${TempOldTarget}
/return

Sub Event_Timedbuffbot(text, MasterName, Buff)
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/if (!${Defined[WhoToBuff]}) /declare WhoToBuff string outer
	/varset WhoToBuff NULL
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (!${Defined[CurrentTimedBuff]}) /declare CurrentTimedBuff int outer 0
|Check if the buff is to be cast on MyMaster or another pc. If on another pc check the
|name of the buff to be cast
	/if (${Buff.Find[ on ]}) {
		/if (${Buff.Find[ group]}) {
			/if (${Buff.Find[ except ]}) {
				/if (!${Defined[Exceptions]}) /declare Exceptions string local
				|This line cuts the end off of ${Buff} to get our exceptions
				/varset Exceptions ${Buff.Mid[${Math.Calc[${Buff.Find[except]}+7]}, ${Buff.Length}]}
				/if (${Defined[BuffToCast]}) /deletevar BuffToCast
				|This line chops our buff off of ${Buff}
				/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
				/declare CurrentGroupMember int local 0
				/varset CurrentGroupMember 0
				/if (${Exceptions.Find[myself]} || ${Exceptions.Find[yourself]}) /varset CurrentGroupMember 1
				/for CurrentGroupMember ${CurrentGroupMember} to ${Group.Members}
					/if (${Exceptions.Find[me]} && ${Group.Member[${CurrentGroupMember}].Equal[${MyMaster}]}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
					/if (${Exceptions.Find[${Group.Member[${CurrentGroupMember}]}]}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
				  /if (!${NearestSpawn[1, ${Group.Member[${CurrentGroupMember}]}].ID}) {
						/if (${CurrentGroupMember}==${Group.Members}) /return
						/next CurrentGroupMember
			}
					/varset WhoToBuff ${Group.Member[${CurrentGroupMember}]}
					/if (${WhoToBuff.NotEqual[NULL]}) {
						/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
							/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
							/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
							/squelch /tar ${TempOldTarget}
							/return
				}
						/tar ${WhoToBuff}
						/delay 1s
						:Cast3
						/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
						/delay 2s
						/echo Casting ${BuffToCast} on ${WhoToBuff}.
						/varcalc CurrentTimedBuff ${CurrentTimedBuff}+1
						/declare TimedBuff${CurrentTimedBuff} timer outer
						/declare WhoToBuff${CurrentTimedBuff} string outer ${WhoToBuff}
						/declare BuffToCast${CurrentTimedBuff} string outer ${BuffToCast}
						:Cast
						/if (${Bool[${Me.Casting}]}) /goto :Cast
						/call Cast "${BuffToCast}" gem4
						/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
						/varcalc TimedBuff${CurrentTimedBuff} ${Spell[${BuffToCast}].Duration}*60-300
			}
				/next CurrentGroupMember
				/squelch /tar ${TempOldTarget}
				/return
		|Else if no exceptions
		} else {
				/if (${Defined[BuffToCast]}) /deletevar BuffToCast
				|Get buff from ${Buff}
				/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
				/declare CurrentGroupMember int local 0
				/varset CurrentGroupMember 0
				/for CurrentGroupMember 0 to ${Group.Members}
					/if (!${NearestSpawn[1, ${Group.Member[${CurrentGroupMember}]}].ID}) {
							/if (${CurrentGroupMember}==${Group.Members}) /return
							/next CurrentGroupMember
				}
					/varset WhoToBuff ${Group.Member[${CurrentGroupMember}]}
					/if (${WhoToBuff.NotEqual[NULL]}) {
						/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
							/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
							/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
							/squelch /tar ${TempOldTarget}
							/return
				}
						/tar ${WhoToBuff}
						/delay 1s
						:Cast3
						/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
						/delay 2s
						/echo Casting ${BuffToCast} on ${WhoToBuff}.
						/varcalc CurrentTimedBuff ${CurrentTimedBuff}+1
						/declare TimedBuff${CurrentTimedBuff} timer outer
						/declare WhoToBuff${CurrentTimedBuff} string outer ${WhoToBuff}
						/declare BuffToCast${CurrentTimedBuff} string outer ${BuffToCast}
						:Cast2
						/if (${Bool[${Me.Casting}]}) /goto :Cast2
						/call Cast "${BuffToCast}" gem4
						/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
						/varcalc TimedBuff${CurrentTimedBuff} ${Spell[${BuffToCast}].Duration}*60-300
			}
				/next CurrentGroupMember
				/squelch /tar ${TempOldTarget}
				/return
		}
	}
		/varset WhoToBuff ${Buff.Arg[${Math.Calc[${Buff.Count[ ]}+1]}]}
		/if (${WhoToBuff.Equal[myself]} || ${WhoToBuff.Equal[yourself]}) /varset WhoToBuff ${Me}
		/if (${Defined[BuffToCast]}) /deletevar BuffToCast
		|Get buff from ${Buff}
		/declare BuffToCast ${Buff.Mid[1, ${Math.Calc[${Buff.Find[ on ]}-1]}]}
}
	:GotBuff
	/if (${WhoToBuff.Equal[NULL]} || ${WhoToBuff.Equal[me]}) {
		/if (${Buff.Find[ on ]}) {
			/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
				/t ${MyMaster} You are too far away!
				/squelch /tar ${TempOldTarget}
				/return
		}
	} else {
			/if (${NearestSpawn[1, ${MyMaster}].Distance}>${Spell[${Buff}].Range} && ${Spell[${Buff}].AERange}==0) {
				/t ${MyMaster} You are too far away!
				/squelch /tar ${TempOldTarget}
				/return
		}
	}
		/if (${MyMaster.NotEqual[NULL]}) {
			/tar ${MyMaster}
	} else {
			/tar myself
	}
		/delay 1s
		/if (${WhoToBuff.Equal[NULL]}) {
			:Cast1
			/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast1
			/delay 2s
			/if (${MyMaster.NotEqual[NULL]}) /echo Casting ${Buff} on ${MyMaster}.
			/if (${MyMaster.Equal[NULL]}) /echo Casting ${Buff} on ${Me}.
			/varcalc CurrentTimedBuff ${CurrentTimedBuff}+1
			/declare TimedBuff${CurrentTimedBuff} timer outer
			/if (${MyMaster.NotEqual[NULL]}) /declare WhoToBuff${CurrentTimedBuff} string outer ${MyMaster}
			/if (${MyMaster.Equal[NULL]}) /declare WhoToBuff${CurrentTimedBuff} string outer ${Me}
			/declare BuffToCast${CurrentTimedBuff} string outer ${Buff}
			:Cast3
			/if (${Bool[${Me.Casting}]}) /goto :Cast3
			/call Cast "${Buff}" gem4
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			/varcalc TimedBuff${CurrentTimedBuff} ${Spell[${Buff}].Duration}*60-300
	}
		/if (${WhoToBuff.Equal[me]}) {
			:Cast2
			/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast2
			/delay 2s
			/echo Casting ${BuffToCast} on ${MyMaster}.
			/varcalc CurrentTimedBuff ${CurrentTimedBuff}+1
			/declare TimedBuff${CurrentTimedBuff} timer outer
			/declare WhoToBuff${CurrentTimedBuff} string outer ${MyMaster}
			/declare BuffToCast${CurrentTimedBuff} string outer ${BuffToCast}
			:Cast4
			/if (${Bool[${Me.Casting}]}) /goto :Cast4
			/call Cast "${BuffToCast}" on ${MyMaster}
			/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
			/varcalc TimedBuff${CurrentTimedBuff} ${Spell[${BuffToCast}].Duration}*60-300
	}
}
	/if (${WhoToBuff.NotEqual[NULL]}) {
		/if (${NearestSpawn[1, ${WhoToBuff}].Distance}>${Spell[${BuffToCast}].Range} && ${Spell[${BuffToCast}].AERange}==0) {
			/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} ${WhoToBuff} is out of range of ${BuffToCast}.
			/if (${MasterName.Equal[[[[MQ2]]]]}) /echo ${WhoToBuff} is out of range of ${BuffToCast}.
			/squelch /tar ${TempOldTarget}
			/return
	}
		/tar ${WhoToBuff}
		/delay 1s
		:Cast3
		/if (${Me.Moving} || ${Bool[${Me.Casting}]}) /goto :Cast3
		/delay 2s
		/echo Casting ${BuffToCast} on ${WhoToBuff}.
		/varcalc CurrentTimedBuff ${CurrentTimedBuff}+1
		/declare TimedBuff${CurrentTimedBuff} timer outer
		/declare WhoToBuff${CurrentTimedBuff} string outer ${WhoToBuff}
		/declare BuffToCast${CurrentTimedBuff} string outer ${BuffToCast}
		:Cast5
		/if (${Bool[${Me.Casting}]}) /goto :Cast5
		/call Cast "${BuffToCast}" gem4
		/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
		/varcalc TimedBuff${CurrentTimedBuff} ${Spell[${BuffToCast}].Duration}*60-300
}
	/if (${Defined[CurrentGroupMember]}) /next CurrentGroupMember
	/squelch /tar ${TempOldTarget}
/return

Sub Event_interruptedcast
	/if (${MyMaster.NotEqual[NULL]}) {
		/t ${MyMaster} Spell was interrupted!
} else {
		/echo ${Spell} was interrupted!
}
/return

Sub Event_pausebot(text,MasterName)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.Length}) /return
	/echo Paused.
	:Pause
		/doevents unpausebot
	/goto :Pause
/return

Sub Event_unpausebot(text,MasterName)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.Length}) /return
	/echo Unpaused.
	/call Main
/return

Sub Event_castbot(text,MasterName,BotSpellName)
	/declare TempOldTarget string local ${Target.Type} ${Target.Name}
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[MQ2]}) /return
	/if (${MasterName.NotEqual[MQ2]}) /varset BotSpellName ${BotSpellName.Left[-1]}
	/if (${MyMaster.NotEqual[NULL]}) {
		/squelch /tar clear
		/assist ${MyMaster}
		/delay 1s
}
	/if (!${Target.ID}) {
		/echo No target selected, and no master to assist.
		/squelch /tar ${TempOldTarget}
		/return
}
	/echo Casting: ${BotSpellName} on ${Target}
	/delay 1s
	:Cast
	/if (${Bool[${Me.Casting}]}) /goto :Cast
	/call Cast "${BotSpellName}" gem4
	/if (${SitAfterCast.Equal[On]} && ${Me.State.Equal[STAND]}) /sit
	/delay 1s
	/squelch /tar ${TempOldTarget}
/return

Sub Event_resistbot(text,Name,ResistedSpellsName)
	/if (${MyMaster.NotEqual[NULL]}) {
		/t ${MyMaster} ${Name} resisted spell ${ResistedSpellsName}.
} else {
		/echo ${Name} resisted spell ${ResistedSpellsName}.
}
	/if (${ResistedSpellsName.Equal[${SlowSpell}]} && ${ReportSlowResistToGroup.Equal[on]}) /g ${Name} resisted slow!!! 
	/if (${ResistedSpellsName.Equal[${SlowSpell}]} && ${ReslowOnResist.Equal[on]}) {
		:ReSlow
		/if (!${Me.SpellReady[${SlowSpell}]}) /goto :ReSlow
		/delay 1s
		/call Cast "${SlowSpell}" gem3
		/delay 2s
}
/return

Sub Event_refreshbuffs
	/call botbuff
	/call CheckTimedBuffBot
/return

Sub Event_invalidname
	/delay 1s
	/if (${MyMaster.NotEqual[NULL]}) {
		/t ${MyMaster} Invalid name.
} else {
		/echo Invalid name.
}
/return

Sub Event_botpet(text,MasterName,PetCommand)
	/if (${MasterName.NotEqual[${MyMaster}]}) /return
	/if (${PetCommand.Equal[attack]}) {
		/delay 1s
		/as ${MyMaster}
		/delay 1s
		/pet attack
}
	/if (${PetCommand.Equal[follow]}) {
		/delay 1s
		/pet follow me
}
	/if (${PetCommand.Equal[guard]}) {
		/delay 1s
		/pet guard here
}
	/if (${PetCommand.Equal[back]}) {
		/delay 1s
		/pet back off
}
	/if (${PetCommand.Equal[taunt]}) {
		/delay 1s
		/pet taunt
}
	/if (${PetCommand.Equal[sit]}) {
		/delay 1s
		/pet sit down
}
	/if (${PetCommand.Equal[goaway]}) {
		/delay 1s
		/pet go away
}
/return

Sub Event_HealPct(text,MasterName,Pct)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (!${Pct.Length}) {
		/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} I will cast ${HealSpell} at ${HealSpellPct}%.
		/if (${MasterName.Equal[[[[MQ2]]]]}) /echo I will cast ${HealSpell} at ${HealSpellPct}%.
} else {
		/varset HealSpellPct ${Pct}
		/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} I will cast ${HealSpell} at ${HealSpellPct}%.
		/if (${MasterName.Equal[[[[MQ2]]]]}) /echo I will cast ${HealSpell} at ${HealSpellPct}%.
}
/return

Sub Event_FastHealPct(text,MasterName,Pct)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (!${Pct.Length}) {
		/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} I will cast ${FastHealSpell} at ${FastHealSpellPct}%.
		/if (${MasterName.Equal[[[[MQ2]]]]}) /echo I will cast ${FastHealSpell} at ${FastHealSpellPct}%.
} else {
		/varset FastHealSpellPct ${Pct}
		/if (${MasterName.Equal[${MyMaster}]}) /t ${MyMaster} I will cast ${FastHealSpell} at ${FastHealSpellPct}%.
		/if (${MasterName.Equal[[[[MQ2]]]]}) /echo I will cast ${FastHealSpell} at ${FastHealSpellPct}%.
}
/return

Sub Event_TargFarAway
	/if (${MyMaster.NotEqual[NULL]}) {
		/t ${MyMaster} Target was out of range!
} else {
		/echo Target was out of range!
}
/return

Sub Event_SlowOnAssist(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.Equal[on]}) {
		/varset SlowOnAssist on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/varset SlowOnAssist off
		/return
}
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff.NotEqual[on]}) /echo Usage: slowonassist on|off
/return

Sub Event_ReportSlowResistToGroup(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.Equal[on]}) {
		/varset ReportSlowResistToGroup on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/varset ReportSlowResistToGroup off
		/return
}
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff.NotEqual[on]}) /echo Usage:  ReportSlowResist on|off
/return

Sub Event_Reslow(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.Equal[on]}) {
		/varset ReslowOnResist on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/varset ReslowOnResist0 off
		/return
}
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff.NotEqual[on]}) /echo Usage: Reslow on|off
/return

Sub Event_SnareOnAssist(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.Equal[on]}) {
		/varset SnareOnAssist on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/varset SnareOnAssist off
		/return
}
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff.NotEqual[on]}) /echo Usage: snareonassist on|off
/return

Sub Event_PetAttackOnAssist(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (${OnOrOff.Equal[on]}) {
		/varset PetAttackOnAssist on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/varset PetAttackOnAssist off
		/return
}
	/if (${OnOrOff.NotEqual[off]} && ${OnOrOff}].NotEqual[on]}) /echo Usage: petattackonassist on|off
/return

Sub Event_Loot(text,MasterName)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
	/if (!${Defined[LootSlot]}) /declare LootSlot int local 0
	/varset LootSlot 0
	/if (!${Defined[LootTotal]}) /declare LootTotal int local 0
	/varset LootTotal 0

	/if (${Me.Class.Name.Equal[Bard]}) /twist off
	/if (!${Target.ID} || ${Target.Type.NotEqual[Corpse]}) {
		/if (${NearestSpawn[1, corpse ${Me.Name}].ID}) {
			/tar mycorpse
	} else {
			/tar corpse radius 50
	}
}
	:MoveToCorpse
		/face fast
		/keypress up hold
		/if (${Target.Distance}>10) /goto :MoveToCorpse
	/keypress down down
	/loot
	/delay 3s
	/varset LootTotal ${Corpse.Items}
	/for LootSlot 1 to ${LootTotal}
		/itemnotify loot${LootSlot} rightmouseup
		/delay 7
		/if (${Cursor.Name.Equal[Leather Whip]}) /destroy
|		/autoinventory
|		/delay 5
	/next LootSlot
	/notify LootWnd DoneButton leftmouseup
	/delay 2s
/return

Sub Event_ToggleSitAfterCast(text, MasterName, OnOrOff)
	/if (${MasterName.NotEqual[${MyMaster}]} && ${MasterName.NotEqual[[[[MQ2]]]]}) /return
		/if (${OnOrOff.Equal[on]}) {
		/echo Toggling SitAfterCast: on
		/varset SitAfterCast on
		/return
}
	/if (${OnOrOff.Equal[off]}) {
		/echo Toggling SitAfterCast: off
		/varset SitAfterCast off
		/return
}
/return

cannidoc.txt

Code: Select all


	The nine main files included are canniv4_1.inc, CrappySpell.inc, expv3.inc, docommandv5_2.inc, caster5_6.inc, saybotv2.inc, sorbuff.inc, skills1_1.inc, and cannidoc.txt.  You may want to change the file names if you have multiple bots, namely canniv4.inc and sorbuff.inc.  Include the new names at the top of canniv4.mac.  Brief explanations of each file, along with the syntax and commands follow:
	
	
	
1)	  canniv4_1.mac is the guts, it includes all the other files.  There is a place in canniv4.mac to add thing's you'd like to do each loop of the macro.  Also at the top of canniv4.mac you will need to add your HealSpell and FastHealSpell(hence why you'd change the name of canniv4 for another bot) if you are a healer, this defaults to Quiescence and Tnarg`s Mending as I use this with my shaman.  Also set the percent to heal someone at if watching someone.  FastHealSpell defaults to 85, and FastHealSpellPct defaults to 70.  Some other optional variables can be set at the top of canniv4 as well, such as slowspell if you are a shamn(defaults to Turgur's Insects), slow-on-assist, and pet-attack-on-assist.  If you have a master name(i.e. you are controlling the bot with another toon) run the macro like so: /macro canniv4 MasterName .  If someone other than the master tries to give you a command it will not work.
	
	
	
2)	CrappSpell.inc I pretty much stole from spell_routines.inc.  Grab that from the snippets section for documentation etc.  You can use spell_routines.inc if you like, but CrappySpell.inc is there incase you don't have VIP on the MQ2 page.
	
	
	
3)	expv3.inc will reliably keep track of your exp.
	
	
	
4)	docommandv5_2.inc makes your bot do commands.  All commands can be said directly to the bot or to the group.  In the examples commands are given directly to the bot.  The syntax and commands are as follows:
	
	/t yourbot do <command>		Where yourbot is the toon running canniv4, and command is the command you'd like yourbot to do.  For instance /t yourbot /keypress h will make yourbot hail.
	
	/t yourbot follow <person>	Makes yourbot follow a person.  /t yourbot follow me will make yourbot follow you.  /t yourbot follow will also make yourbot follow you.  If you are mounted yourbot will use eq follow.  If you are not mounted yourbot will /stick moveback 15
	
	/t yourbot stop			Makes yourbot stop following.
	
	/t yourbot sit			Makes yourbot sit.
	
	/t yourbot stand		Makes yourbot stand.
	
	/t yourbot assist		Makes yourbot assist you.
	
	
	
5)	caster5_6.inc contains the majority of the code.  Most of the events are triggered in caster.inc.  All commands from caster.inc can be said directly to the bot, to the group, or echo'd.  The syntax and commands are as follows:
	
	/t yourbot watch <person>	Makes yourbot watch person.  When person gets below HealSpellPct(defined in canniv4.mac) hp yourbot will HealSpell(defined in canniv4.mac) them.  Yourbot will not cast Quicence over and over, as it sets a timer and waits till Quiescence wears off.  If they get below FastHealSpellPct(defined in canniv4.mac) hp they will recieve a FastHealSpell(defined in canniv4.mac at the top).  ex. /echo watch sombody will watch a pc named sombody, and heal them as needed.
	
	/t yourbot watch group (except person1 person2)	Same as watch, but watches the entire group.  Can optionally exclude people from the group.  Ex. /t yourbot watch group except yourself me would watch everyone in the group but yourbot's master, and yourbot.
	
	/t yourbot heal <person>	Makes yourbot cast HealSpell on person. ex. /t yourbot heal sombody would make yourbot heal a pc named sombody.
	
	/t yourbot fastheal <person>	Makes yourbot cast FastHealSpell on person.
	
	/t yourbot buff <buffname>	Makes yourbot cast buffname on you. ex. /t yourbot buff Harmony of Soul would make yourbot cast harmony of soul on you.
	
	/t yourbot buff <buffname> on <person>	Makes yourbot cast buffname on person.
	
	/t yourbot buff <buffname> on group (except person1 person2)	Same as buff but on entire group. Optionally can exclude people from the list.
	
	/t yourbot timebuff <buffname>	Makes yourbot cast buffname on you, and time the buff.  30 seconds before the buff wears off yourbot will try to recast it.  If you are out of range the buff's timer will be set to 40 seconds.
	
	/t yourbot timebuff <buffname> on <person> Same as the previous command but on another toon.
	
	/t yourbot timebuff on group (except person1 person2)	Same as timebuff but on entire group. Optionally can exclude people from the list.
	
	/t yourbot canni on|off		Toggles canni on and off, uses canni IV and canni V.  Default is on if you are a shaman, if not the macro wont try to canni.  Will cast HealSpell on you before it canni V's.
	
	/t yourbot pause		Pauses the script.
	
	/t yourbot unpause		Unpauses the script.
	
	/t yourbot cast <spell>		Makes yourbot assist you and cast spell.
	
	/t yourbot sn <spell>		Same as cast.
	
	/t yourbot refresh buffs	Makes yourbot check the buffs defined in sorbuff.inc, and recast them(or ask another bot to recast them) on yourbot if they have worn off.
	
	/t yourbot pet <petcommand>	Makes your bot perform petcommand(note, use no space between pet and <petcommand>).  ex.  /t yourbot petback will make your pet back off.  petcommand can be any of the following:
	
		petattack
		petfollow
		petguard
		petback
		pettaunt
		petsit
		petgoaway
		
	/t yourbot HealPct <Pct>	Sets HealSpellPct(defined in canniv4.mac) to Pct.  If Pct is not specified yourbot will tell master(or echo if no master) HealSpellPct.  ex. /t yourbot HealPct 80 sets HealSpellPct to 80%.
	
	/t yourbot FastHealPct <Pct>	Same as HealPct but sets FastHealSpellPct(defined in canniv4.mac).
	
	/t yourbot lootall		Makes your bot loot the nearest corpse.
	
	/t yourbot slowonassist on|off	Makes your bot slow on assist.
	
	/t yourbot ReportSlowResist on|off Will make your bot report resisted slows to the group
	
	/t yourbot Reslow on|off	Makes your bot reslow when slow is resisted.
	
	/t yourbot snareonassist on|off	Makes your bot snare on assist.
	
	
	
6)	saybotv2.inc will make yourbot(s) say whatever you do, like the sams on zek.  This is nice especially when you are at a magus/PoD, but is also kool to show off.
	
	/t yourbot saybot on|off	toggles saybot on or off
	
	
	
7)	sorbuffv2.inc will keep track of your buffs.  If you have another bot, you can put the bots name, as well as the buffs they cast on you, in sorbuff.inc.  When you /echo refresh buffs (or when your master tells you refresh buffs), the macro will check all the buffs defined in sorbuff.inc, and either recast them, or ask the other bot(s) to recast them.  You'll want multiple sorbuff.inc files if you have multiple bots.  Example syntax is as follows:
	
	/if (!${Defined[buff1]}) /declare buff1 string outer Focus of the Seventh
	/if (!${Defined[buff2]}) /declare buff2 string outer Protection of the Glades
	
	/if (!${Defined[caster1]}) /declare caster1 string outer yourbot'sNameHere
	/if (!${Defined[caster2]}) /declare caster2 string outer MyOtherBot'sNameHere
	
Substitute yourbot'sNameHere with the name of your bot, and MyOtherBot'sNameHere with your other bot's name.  In sorbuff.inc there is room for 15 buffs.  In the example, when Focus wears off the bot will recast it on him/herself.  When Protection wears off, s/he will ask your other bot to renew it.



8)	skills1_1.inc.  /echo practice Spellname to start chain casting a spell.  /echo stop practicing to stop.



9)	cannidoc.txt.  This file =)

Last edited by BardsAreTooEasy on Sat Jan 07, 2006 12:42 am, edited 14 times in total.

skyler
a snow griffon
a snow griffon
Posts: 311
Joined: Wed May 11, 2005 9:22 am

Post by skyler » Tue Jul 05, 2005 12:37 am

1) can you PLEASE clean that up and take out all of the extra spaces/enter
There is no reward for longest macro

2) I'm not sure if it's being copy/pasted correctly in the /code thing because some of characters are showing up as links.

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Tue Jul 05, 2005 1:59 am

skyler wrote:1) can you PLEASE clean that up and take out all of the extra spaces/enter
There is no reward for longest macro

2) I'm not sure if it's being copy/pasted correctly in the /code thing because some of characters are showing up as links.
Hey, dickhead, if you don't like it, reformat it yourself.

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

...

Post by BardsAreTooEasy » Tue Jul 05, 2005 2:20 am

Double spacing is a habit I'll probably never be able to break, looks pretty to me.. sorry. anything between 2 ['s shows up as a link, but it will still copy/past fine as is.

Thanks for the defense DM =)

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Post by Process » Tue Jul 05, 2005 3:26 pm

Does this macro know how long buffs last? For instance, if I have spell casting re-enforcement mastery and an item with a spell effect that increases buff duration, will it calculate that in when determining when buffs need to be refreshed?

If not, Is there perhaps a way to add that? This was always a weakness in Genbot (which is now dead from the time being.). Otherwise, it will end up re-applying buffs way before they will wear out.

Thanks for the great work,

Process

skyler
a snow griffon
a snow griffon
Posts: 311
Joined: Wed May 11, 2005 9:22 am

Post by skyler » Tue Jul 05, 2005 3:55 pm

DigitalMocking wrote:
skyler wrote:1) can you PLEASE clean that up and take out all of the extra spaces/enter
There is no reward for longest macro

2) I'm not sure if it's being copy/pasted correctly in the /code thing because some of characters are showing up as links.
Hey, dickhead, if you don't like it, reformat it yourself.
Opps! Did I post outside of the vip threads? My fault then! I should have expected some asshole would come along and flame for the pure sake of flaming. My fault for trying to be helpful. My bad.

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

Post by JimJohnson » Tue Jul 05, 2005 4:11 pm

skyler wrote:
DigitalMocking wrote:
skyler wrote:1) can you PLEASE clean that up and take out all of the extra spaces/enter
There is no reward for longest macro

2) I'm not sure if it's being copy/pasted correctly in the /code thing because some of characters are showing up as links.
Hey, dickhead, if you don't like it, reformat it yourself.
Opps! Did I post outside of the vip threads? My fault then! I should have expected some asshole would come along and flame for the pure sake of flaming. My fault for trying to be helpful. My bad.

Your the only asshole to post in this thread so far.

BardsAreTooEasy
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sun Feb 27, 2005 3:01 pm

Post by BardsAreTooEasy » Tue Jul 05, 2005 5:13 pm

it times the buff with this line

Code: Select all

/varcalc TimedBuff${CTB} ${Spell[${BuffToCast${CTB}}].Duration}*60-300 
under Sub CheckTimedBuffBot. It wont calculate for an item i don't think, but i'll try to get an item that increases buff duration and work it in if i can. For the meantime, you could manually add the increased duration at the end of that line.

dark_matter
orc pawn
orc pawn
Posts: 22
Joined: Tue Jul 20, 2004 4:11 pm

Post by dark_matter » Tue Jul 05, 2005 5:17 pm

There's a typo in event_sit...

Code: Select all

/if (${MasterName.Equal[${MyMaster}]}) (
should be:

Code: Select all

/if (${MasterName.Equal[${MyMaster}]}) {

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

Post by fearless » Tue Jul 05, 2005 5:38 pm

BardsAreTooEasy wrote:it times the buff with this line

Code: Select all

/varcalc TimedBuff${CTB} ${Spell[${BuffToCast${CTB}}].Duration}*60-300 
under Sub CheckTimedBuffBot. It wont calculate for an item i don't think, but i'll try to get an item that increases buff duration and work it in if i can. For the meantime, you could manually add the increased duration at the end of that line.
No, it won't work for items.
Reading . . . it's not just for me.

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

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Post by Process » Wed Jul 06, 2005 10:34 am

Sorry, I'm still a bit confused. You say it doesn't work for items, but does it work for the SCR, and SCRM AA's?

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

Post by fearless » Wed Jul 06, 2005 11:28 am

Process wrote:Sorry, I'm still a bit confused. You say it doesn't work for items, but does it work for the SCR, and SCRM AA's?
${Spell[Spell Name].Duration} does not account for any extension effects (SCR / SCRM / Focus), nor is it able to give you the duration of a effect off a clickie (ie ${Spell[Time's Antithesis].Duration}).
Reading . . . it's not just for me.

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

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Wed Jul 06, 2005 1:33 pm

Some of the existing shaman macros handle this by declaring an extension variable and multiply the Spell.Duration by that number. It won't be exact for spells of higher level than your focus item, but you can reduce it a bit to give yourself some slack by declaring a slightly lower modifier. For example, I have a 25% buff extension item, and 50% for SCRM, giving me 75%. I declare it as 65% though, so that I don't get gaps in my buff coverage for my spells that are higher than level 67. Note that this isn't my original work, it exists in many of the current shaman scripts:

Code: Select all

/declare SpellDurationBonus   outer 1.65

/varset SpDuration ${Math.Calc[${Spell[Your Spell Here].Duration}*60*${SpDurBonus}]}
Then set your timer to SpDuration.

If you wanted to get really silly, you could cast the buffs on yourself and jot down the durations, then hard code them into your script. I use a combination of the two - the above method works great for long duration buffs, and I hard code short duration stuff like Champion, Ferine Avatar, Leopard, etc. and handle them in their own routines.

Dbick
orc pawn
orc pawn
Posts: 19
Joined: Thu Sep 01, 2005 7:59 pm

Post by Dbick » Mon Sep 05, 2005 6:44 pm

I wanted my bot to sit after cast so I changed the toggle sit after cast to on. Now he goes into a sit/stand loop. Any one have a solution?
Thank you.