Building a Shaman.mac

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Dengel
decaying skeleton
decaying skeleton
Posts: 4
Joined: Mon Dec 08, 2003 8:01 am

Building a Shaman.mac

Post by Dengel » Mon Dec 08, 2003 8:05 am

Okay, Problem is, I am not at Home and have no Everquest at work.
Well this is my first Macro and I don't know if it will work.

Any comments on this?

Code: Select all

| /macro shaman <Charname> <Rootonlowhp 0/1> <Slow 0/PCT> <HealHPpct>

#turbo 20

#event Fizzle "Your spell fizzled!"
#event RegenStop "You have stopped regenerating."
#event Mobdead "has been slain."
#event MobSlowed "yawns."
#event MobRooted "Dunno the Text hehe"
Sub Main
	|-- declares --|
	/declare MasterName global
	/declare Root global
	/declare Slow global
	/declare Heal global
	
	/declare CastSpell global
	/declare SpellName global
	/declare getHP global
	/declare getMana global
	/declare IsSlowed global
	/declare IsRooted global

	/declare RootName global
	/declare SlowName global
	/declare HealName global
	/declare RegenName global
	
	|-- varstets --|
	/varset CastSpell 0
	/varset SpellName " "
	/varset getHP 0
	/varset getMana 0
	/varset IsSlowed 0
	/varset IsRooted 0

	/varset Mastername @p1
	/varset Root @p2
	/varset Slow @p3
	/varset Heal @p4


	|-- Spellnames
	|-- Please Edit

	/varset RootName "Immobilize"
	/varset SlowName "Turgur's Insects"
	/varset HealName "Superior Healing"
	/varset RegenName "Regrowth"

	| Perhaps I should add some Spellcheck and Spellmemming ;)


	| Check if Regen is running. after initial check, Event should handle this
	/if n $char(buff,@RegenName)==0 { 
		/varset SpellName @RegenName
		/call cast_spell
	}

	:MainLoop
	/call mana_hp_check
	/call handle_role
	/doevents
	/goto :MainLoop
	
/return

Sub mana_hp_check
	| Checking HP ...
	| If Shamans HP < 60% he needs to sit down and heal himself up until Shamans HP is 100%
	| If Shamans HP < 50% he needs to tell Master that he is in trouble

	/if $char(hp,pct) <= 50 {
		| will need to make this better. now shaman will spam master with troubletells
		| until hp >50% =)
		/tell @MasterName I am in trouble. my HP is $char(hp,pct) 
	}

	/if @getHP == 0 { 
		| shaman is not regening at the moment
		if $char(hp,pct) <= 60 {
			/varset getHP 1
			/tell @MasterName I am sitting down to regen HP now
			/sit
		}
	}
	
	/if @getHP == 0 {
		| if regenmode is off, manaregenmode is off but mana <70%, set regenmode on
		/if @getMana == 0 {
			if $char(mana,pct) <= 70 {
				/varset getMana 1		
			}
		}
		| if Manaregenmode if on but mana is full, stop manaregen mode
		/if @getMana == 1 {
			/if $char(mana,pct) == 100 {
				/varset getMana 0
			}
		}
		| if regenmode is off, manaregenmode is on, canni
		/if @getMana == 1 {
			/varset SpellName @CanniName
			/call cast_spell
		}
	}

	| if regenmode is on and HP is full, turn regenmode off
	/if @getHP == 1 {
		if $char(hp,pct) == 100 {
			/varset getHP 0
		}
	}
/return

Sub handle_role
	|-- check for target HP
	/if @Heal > 0 {
		|-- Heal Target if HP < @Heal
		/target @MasterName
		/delay 1
		/if $target(hp,pct) < @Heal {
			/varset SpellName @HealName
			/call cast_spell
		}
	}
	|-- Slow Mob?
	/if @Slow > 0 {
		/assist @MasterName
		/delay 1
		/if @IsSlowed == 0 {
			/if $target(hp,pct) <= @Slow {
				/varset SpellName @SlowName
				/call cast_spell
			}
		}
	}
	|-- Root Mob?
	/if @Root > 0 {
		/assist @MasterName
		/delay 1
		/if $target(hp,pct) <= @Root {
			/varset SpellName @RootName
			/call cast_spell
		}
	}
/return
Sub cast_spell
	|-- Handle spellcasting
	/stand
	/delay 1
	/cast "@SpellName"
	/pause $spell(@SpellName,casttime) + 2 | there may be lag and stuff
	/sit
/return

Sub Event_MobSlowed
	/varset IsSlowed 1
/return 

Sub Event_MobDead
	/varset IsRooted 0
	/varset IsSlowed 0
/return 

Sub Event_Fizzle
	/call cast_spell
/return 

Sub Event_RegenStop
	/varset SpellName @RegenName
	/call cast_spell
/return

Sub Event_MobRooted
        /varset MobRooted 1
/return
Edit: Missed some globals
Edit: pause -> delay
Last edited by Dengel on Tue Dec 09, 2003 4:05 am, edited 2 times in total.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Mon Dec 08, 2003 11:59 am

Off the top of my head I don't recall a /pause command. I think you want to use /delay.

gnome001
a ghoul
a ghoul
Posts: 109
Joined: Fri Jan 24, 2003 1:01 am

Post by gnome001 » Mon Dec 08, 2003 12:48 pm

you could add an auto cann and self hp check to this pretty easily and then you wouldn't have to worry about your mana that much or your hp. here is my auto cann macro i use canns down and auto heals..

Code: Select all

| Shamandance.mac 
|CanniBot! Macro will cani you and heal when I thought was necessary (you can change it obviously) 
|FizzleProtector! Fizzleprotector will recast canni in case of a fizzle 
|usage   /macro shamandance.mac 

#event SpellFizzle "Your spell fizzles" 


Sub Main 
:loopstart 

   /if n $char(hp,pct)<35 /call HealMe 
      /if n $char(mana,pct)>5 /if n $char(hp,pct)>25 /if n $char(hp,pct)<70 /call HealMe 
   /if n $char(hp,pct)>60 /if n $char(mana,pct)<90 /call Canidance
   /doevents 
   /goto :loopstart 
/return 

Sub Canidance 
   /sit off 
   :Canni 
   /cast "Cannibalize IV" 
   /delay 9s 
   /call Main 

Sub HealMe 
   /sit off 
   :Heal 
   /target myself 
   /cast "quiescence" 
   /delay 12s
   /call Main
   


Sub Event_SpellFizzle 
   /cast "Cannibalize IV" 
   /delay 9s
   /call Main 
/return
shouldn't be hard to just insert the sub's in and stick the hp/mana check lines that call the sub's into your main loop. i'd think this might be better than a code that just yells for help since you shammy can actually self heal. (this code can be altered for any lvl shammy also.. just change spell names, delay to refect cast and recovery times, and % to heal at if its not a heal over time like quiescence.

edit.. the fizzle protector sucks btw.. just never bothered to pull it out of the code or fix it..

Dengel
decaying skeleton
decaying skeleton
Posts: 4
Joined: Mon Dec 08, 2003 8:01 am

Post by Dengel » Tue Dec 09, 2003 4:08 am

my shaman is 54 now. so I use Fungi+Regenspell for regainen Mana.
Thats why I just dont Canni if I am to low in hp hehe

gnome001
a ghoul
a ghoul
Posts: 109
Joined: Fri Jan 24, 2003 1:01 am

Post by gnome001 » Tue Dec 09, 2003 10:31 am

well if you look at the canni script it only canni's down to 70% before healing, but you can set that to 80 or higher, but you will lose some effiency... but the heal code checking itself is good if you are getting beat on you will auto try to heal yourself (you can still have it yell to the master for help also) i used this script on my shammy from lvl 24 on up to 65 and loved it every bit of the way. (slows take sooo much mana lol and just standing there canning manually sucked) buy a horse also(9k one), it helps a ton if you are outdoors.

Hawk90
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Dec 11, 2003 1:00 am

Post by Hawk90 » Thu Dec 11, 2003 1:29 am

For a shaman bot you may want to make two different canni procedures(am a xylobot user so don't know much about your program)....One to use while fighting and that one is a safer version in that it heals you at higher hps and such and a out of fight one that lets you drop further down....


Hpconvert is the canni procedure that I call between fights in my shaman bot. And hpcheck gets run everytime my main combat procedure is done.
Dotwatch is the main combat procedure...its listed below.

*note*...Can't get the reply to hold my procedure in its correct programing shape and everthing just slides to the left...sorry about that


Procedure hpconvert;
begin
logmarker := setlogmarker;
repeat
good := False;

if Barcheck(self,10)=false then begin
GateOut;
end;

If Barcheck(pet,30)=false then begin
GateOut;
end;

if (barcheck(self,40)=false and (durtorpor)) then
begin

// debug('torpor 1');
castspells(torpor,self,stay);
torporstarttime:=gettickcount;
DurTorpor:=false;
end;

if ((barcheck(mana,90)=false) and (barcheck(self,41))) then castspells(canni,nochange,stay);

if ((barcheck(mana,90)=true) and (barcheck(self,39)=false) and (Durtorpor=true)) then
begin
// debug('torpor 2');
CastSpells(Torpor,self,stay);
TorporStartTime:=GetTickCount;
DurTorpor:=false;
end;

if(barcheck(mana,90)=true and barcheck(self,40)=true) then good := True;
logtext := GetNewLogtext(logmarker);
logmarker := setlogmarker;
if Hastoken(logtext,BadTarget) then begin
GateOut;
end;

if hastoken(logtext,'misses') or hastoken(logtext,'bashes') or
hastoken(logtext,'hits') or hastoken(logtext,'kicks') or
hastoken(logtext,'Taunting attacker, Master') then begin
AddCombat(pet);
end;

if (GetTickCount > (TorporStartTime+30000)) then Durtorpor:= True;
if (GetTickCount < (TorporStartTime+30000)) then DurTorpor:=false;
Pause(100);
until good;
end;

Procedure hpcheck;
begin
// debug('hpcheck');
if (GetTickCount>(TorporStartTime+36000)) then Durtorpor:= True;
if (GetTickCount < (TorporStartTime+36000)) then DurTorpor:=false;
if (barcheck(self,10)=false) then begin
GateOut;
end;

if (barcheck(self,25)=false) then begin
CastSpells(Healspell,self,stay);
AssistPet;
exit;
end;

If (barcheck(pet,30)=false) then begin
GateOut;
end;

if (barcheck(self,26)=true and barcheck(self,40)=false and Durtorpor) then begin
Castspells(Torpor,self,stay);
TorporStartTime:=GettickCount;
DurTorpor:=false;
assistpet;
end;

if (barcheck(mana,98)=false and barcheck(self,41)=true) then CastSpells(Canni,nochange,stay);
end;


procedure DotWatch;
begin
attackb :=false;
Logmarker:=setlogmarker;
CastSpells(diseasedot,Nochange,stay);

logtext:=getnewlogtext(logmarker);
opps;

if attackb=true then castspells(epic,pet,assist) else
CastSpells(epic,Nochange,stay);

logtext:=getnewlogtext(logmarker);
opps;

if (attackb and Dot) then castspells( Poisondot,pet,assist);
if (attackb=false and Dot) then CastSpells( Poisondot,nochange,stay);

fight := false;
CombatLoop:=0;
durtorpor:=true;

if (attackb and toroot and Dot ) then Castspells(root,pet,assist);
sendkeys('q');


repeat

if fight=false then Hpcheck; //in fight canni is called here.

logtext := GetNewLogtext(logmarker);
logmarker:=setlogmarker;
Pause(300);

if hastoken(logtext, slowstr) then begin
pause(100);
Attackb:=false;
Castspells(torpor,self,stay);
Pause(5000);
AddCombat(pet);
end;

if Hastoken(logtext,'experience') or hastoken(logtext,'slumps to the ground') then fight:=true;

CombatLoop:=CombatLoop+1;

if ((CombatLoop>=cannitimes) and (attackb=false)) then begin
Attackpet;
if (toroot and dot) then Castspells(root,pet,assist);
attackb:=true;
end;

if CombatLoop=1000 then fight:=true;

if hastoken(logtext,BadTarget) then begin
GateOut;
end;

if hastoken(logtext,'enraged') then begin
GateOut;
end;

if hastoken(logtext,'dujo') then addcombat(onbot);// my second bot will send a tell to my main bot with a special word and my shaman will switch over and kill the mob argoed on him.

if (hastoken(logtext,'misses') and (attackb=false)) or
(hastoken(logtext,'bashes') and (attackb=false)) or
(hastoken(logtext,'hits') and (attackb=false)) or
(hastoken(logtext,'kicks') and (Attackb=false)) then
begin
Attackpet;
if (dot=true and toroot=true) then CastSpell(root,pet,assist);
Attackb:=true;
end;

if (hastoken(logtext,Rootstr) and (fight=false)) then begin
CastSpells(root,pet,assist);
end;

if fight=false then Slam;

opps;

if Repoisondot then begin
if hastoken(logtext,Banestr) or hastoken(logtext,Saryrnstr) then begin
Castspells(poisondot,pet,assist);
end;
end;


if reDiseasedot then begin
if hastoken(logtext,ultorstr) or hastoken(logtext,PoxStr) then begin
Castspells(diseasedot,pet,assist);
end;
end;
until fight;
if lootable then Loot;
end;