Berserker Macro

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

Moderator: MacroQuest Developers

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Berserker Macro

Post by Gabby » Thu Mar 18, 2004 1:00 am

This is my first time tryin my hand at any type of codeing.
I've taken snippets from several mac's and a bit of codeing of my own to
try and get this running.
Any help, advice, code cleanup, etc would be well appreciated.

Note: one current problem
I cant seem to get the 2 timers to work properly together,eg: Leg Cut the mob (snare) instead of Head Strike'n the mob (stun). I know they both work on the same 12s timer in game but I dont have the first clue as to how to transmit the variable into the script when it says "you can not use this ability for 9sec" (or something to that effect).

Also when I use the Intimidation/Leg Cut combo in the script when activated via the event, It seems it doesn't kick in also (unsure if its the timers or the doevent placement)

Code: Select all

|zerk.mac

#turbo

|#event snare "very afraid"

Sub Main
/zapvars
/declare HeadStrikeTimer1 timer
/declare HeadStrikeTimer2 timer
/call Target
/return

Sub LoopBoth
/doevents
:combatloop
/if n $target(hp,pct)<25 /call SnareCombat
/if $combat=="TRUE" {
	/if n $target(distance)<18 }
		/if n $char(ability,"Frenzy")>0 /doability "Frenzy"
	}
/if n $target(hp,pct)>25 {
	/if n @HeadStrikeTimer2<=0 {
		/keypress hot8
		/varset HeadStrikeTimer2 12s
	}	
/if $combat=="TRUE" {
	/if n $target(distance)<18 }
		/if n $char(ability,"Disarm")>0 /doability "Disarm"
	}
/if $combat=="TRUE" {
	/if n $target(distance)<30 }
		/if n $char(ability,"Intimidation")>0 /doability "Intimidation"
	}	
}
/delay 5
/if $combat=="FALSE" /call Target
/doevents
/goto :combatloop
/return

Sub SnareCombat
/doevents
:combatloop
/if $combat=="TRUE" {
	/if n $target(distance)<18 }
		/if n $char(ability,"Frenzy")>0 /doability "Frenzy"
	}
/if n $target(hp,pct)<25 {
	/if n @HeadStrikeTimer1<=0 {
		/keypress hot7
		/varset HeadStrikeTimer1 12s
	}	
/if $combat=="TRUE" {
	/if n $target(distance)<18 }
		/if n $char(ability,"Disarm")>0 /doability "Disarm"
	}
/if $combat=="TRUE" {
	/if n $target(distance)<30 }
		/if n $char(ability,"Intimidation")>0 /doability "Intimidation"
	}	
}
/delay 5
/if $combat=="FALSE" /call Target
/doevents
/goto :combatloop
/return

Sub Target
/doevents
/if n $char(hp,pct)<49 /call Bindloop
 :TargetLoop
  /if $combat=="TRUE" /call Loopboth
  /echo Searching for a TARGET
  /target npc
	/if ("$target()"=="FALSE" || n $target(distance)<=40) {
	 /echo Unable to locate any targets nearby... Will try again in 10 seconds.
	 /delay 10s
/if $combat=="TRUE" /call Loopboth
/goto :TargetLoop
}
  :LoopID
	 /if $combat=="TRUE" /call Loopboth
	 /if $combat=="FALSE" {
		/if n $target(distance)>40 {
			/if n $char(ability,"intimidation")>0 /doability "Intimidation"
	}
}
/delay 5
  /if $target()=="FALSE" {
	/if n $target(distance)<=100 /call Target
	}
}
/if $combat=="TRUE" /call Loopboth
/goto :LoopID
/return

Sub Bindloop
/if $combat=="TRUE" /call LoopBoth
:BindWounds
/if "$target(name,clean)"!="$char(name,clean)" /target myself
/if n $char(ability,"Bind Wound")>0 /doability "Bind Wound"
/delay 1s
/doevents
/if n $char(hp,pct)<49 /goto :BindWounds
/if n $char(hp,pct)>49 /call Target
/return

Sub ClearVars
/zapvars
/declare HeadStrikeTimer1 timer
/declare HeadStrikeTimer2 timer
/call SnareCombat
/return

Sub Event_snare
/call ClearVars
/return
Edit: took out some old info tags

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Re: Berserker Macro

Post by Gumby » Thu Mar 18, 2004 10:41 am

Gabby wrote:Note: one current problem
I cant seem to get the 2 timers to work properly together,eg: Leg Cut the mob (snare) instead of Head Strike'n the mob (stun). I know they both work on the same 12s timer in game but I dont have the first clue as to how to transmit the variable into the script when it says "you can not use this ability for 9sec" (or something to that effect).
Don't.

Simply use one timer for all discs, and /varset DiscTimer (or HeadstrikeTimer or whatever) based upon the reuse time. Use one, /varset 12s for Head Strike / Crush whatever, and then if you do snare, also set it for 12s.

G

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Post by Gabby » Thu Mar 18, 2004 9:55 pm

So I suppose I would need call the sub with the /zapvars before calling the next ability with the /varset ? Or just leave one constant?

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Mar 19, 2004 1:33 am

Honestly Gabby, load the script and debug it somewhat before posting here to the Depot. This should've gone over in the Help Forum as currently it looks like it's going to toss a bunch of runtime errors (backwards }'s, duplicate variable declarations, bad comparison quotations to name a few).

Flow execution is convoluted as well. Looks as if you're using subroutine calls to loop instead of goto's in more than one spot. Not sure which macros you cobbled together but yikes ;).

As just a hack and slash suggestion, start off with something simple, test it, get it working, add a feature, test that, get it working, repeat till functionality required is achieved.

G