KISS Warrior Pet

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

Moderator: MacroQuest Developers

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

KISS Warrior Pet

Post by Blazza » Thu Mar 24, 2005 12:50 am

Code: Select all

| WariorBot.Mac
| v.1.1
| CHANGELOG
| v.1.0 - Initial Post
| v.1.1 - Updated Taunt to use HoTT
|	  Also Updated the macro to give the option to use advpath stuff or not.
|	  Changed the Combat loop to only do 1 /if statement for taunt stuff. Call me paranoid, but If this ever gets complex. I dont want it eating CPU cycles.
|	  Updated some shitty formatting. Should be a little easier to read and more uniform.
| v.1.2 - Put placeholder in for gotoanchor.
|           Added toggle IsMA. If you have this set to true, you will taunt all mobs BEFORE attacking. You will fail up to 3 times before saying screw it and attacking anyways. This is usefull if you are the MA and need to taunt mobs before breaking mezz. If the mob in question becomes unmezzed, just hit your attack hotkey again and it will break out of the taunting loop and just attack normaly.
| WISHLIST - Anything to speed this up. Any small changes you can see to make it to less /if checks or less redundant code please post. I want this to be as clean as possible.
| 	     Setup to use INI file rather than seting variables inside the macro.
|	     Find a better way to do backup, left, and right possitioning code. This way sucks ass.

#turbo 40
#include advpath.inc
#event AttackOn "#*#warriorbot assist on #1#"
#event AttackOff "#*#warriorbot assist off#*#"
#event FollowMe "#*#warriorbot follow on#*#"
#event SetAnchor "#*#warriorbotset anchor#*#"
#event ToggleTaunt "#*#warriorbot toggle taunt#*#"
#event ToggleBehind "#*#warriorbot toggle behind#*#"
#event ToggleMA "#*#warriorbot toggle MA#*#"
#event BackUp "#*#warriorbot backup#*#"
#event Left "#*#warriorbot left#*#"
#event Right "#*#warriorbot right#*#"
#event StickDistanceUp "#*#warriorbot stick distance up#*#"
#event StickDistanceDown "#*#warriorbot stick distance down#*#" 
#event TauntCheck "#*#to ignore others and attack you#*#"
#event FailedTaunt "#*#You have failed to taunt your target#*#" 

Sub Main
	/call InitVars
	:MainLoop
	/if (${UseAdvPath}) /call AdvPathPoll
	/if (${Agro}) /call Combat
	/doevents
	/goto :Mainloop
/return


Sub InitVars
|######### CHANGE THIS SHIT! ##################
	/declare Master string outer ChangeMe
	/declare UseAdvPath int outer 0
	/declare TauntDisc string outer Incite
	/declare FollowDistance int outer 5
|##############################################
	/if (${UseAdvPath}) /call InitAPFVars 1 15 20
	/declare CurMobID int outer 0
	/declare Agro int outer 0
	/declare AnchorLocX int outer 0
	/declare AnchorLocY int outer 0
	/declare InciteTimer timer outer 35
	/declare Anchor int outer 0
	/declare StickDistance int outer 13
	/declare Taunt int outer 1
	/declare Behind int outer 0
	/declare Follow int outer 0
	/declare IsMA int outer 0
	/declare TauntSuccess int outer 0
	/declare TauntTimer int outer 0
	/declare FailedTaunt int outer 0
	/declare InMAStuff int outer 0
	/declare Breakout int outer 0
	
/return
	


Sub Combat

	/target ID ${CurMobID}

	/i say Attacking ${Target.CleanName}

	/if (${Behind}) {
		/stick on ${StickDistance} behind
	} ELSE {
		/stick on ${StickDistance}
	}

	/if (${IsMA}) /call DoMAStuff
	/varset InMAStuff 0

	/if (${Agro}) {
		/attack on
	} ELSE {
		/return
	}

	:CombatLoop
	/if ((${Target.Distance}<25)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
        /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"

        /if (${Taunt}) {
		/if ( ${Target.Distance}<25 && !${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt"

		/if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30) {
			/disc ${TauntDisc}
			/varset InciteTimer 35s
		}

	}

	/doevents

	/if (${Target.ID}!=${CurMobID}) {
		/varset Agro 0
		/varset CurMobID 0
	}

	/if (${Agro}) /goto :CombatLoop
	/if (${Anchor}) /call GoHome
	/if (${Follow}) {
		/varset Follow 0
		/call Event_FollowMe
	}

/return
 

Sub Event_AttackOn(string line, int AssistOnID)

	/if (${InMAStuff}) {
		/varset Breakout 1
		/i say Breakout of Taunt shit.
	}

	/if (${CurMobID}>0) {
		/i say SWITCHING MOBS!
		/attack off
		/stick off
		/target ID ${AssistOnID}

		/if (${Behind}) {
			/stick on ${StickDistance} behind
		} ELSE {
			/stick on ${StickDistance}
		}

		/attack on
	}

	/varset CurMobID ${AssistOnID}
	/varset Agro 1

/return

Sub Event_AttackOff
	/attack off
	/stick off
	/varset CurMobID 0
	/varset Agro 0
	/target ${Master}
/return


Sub Event_FollowMe

	/if (!${Follow}) {
		/i say Following You ${Master}

		/if (${UseAdvPath}) {
			/call FollowFunction "${Master}"
		} ELSE {
			/target ${Master}
			/stick on ${FollowDistance}
		}

		/varset Anchor 0
		/varset Follow 1
	} ELSE {
		/i say Not following you ${Master}

		/if (${UseAdvPath}) { 
			/call StopFunction
		} ELSE {
			/stick off
		}

		/varset Follow 0
	}

/return

Sub GoHome
	/if (${UseAdvPath}) {
		/call GotoFunction ${AnchorLocY} ${AnchorLocX}
	} ELSE {
		/call GotoFunction ${AnchorLocY} ${AnchorLocX}
		/echo Placeholder for when I get rid of advpath.
	}
/return

Sub Event_SetAnchor
	/if (${Anchor}) {
		/varset Anchor 0
		/i say Anchor Off
		} ELSE {
		/varset AnchorLocX ${Me.X}
		/varset AnchorLocY ${Me.Y}
		/varset Anchor 1
		/i say Anchor set at ${Me.X} ${Me.Y} 
		}
/return

Sub Event_StopAnchor
	/varset Anchor 0
	/i say Anchor Pulled
/return


Sub Event_ToggleTaunt
	/if (${Taunt}) {
		/varset Taunt 0
		/i say No Longer Taunting Attackers Master
	} ELSE {
		/varset Taunt 1
		/i say Taunting Attackers Master
	}
/return


Sub Event_ToggleBehind
	/if (${Behind}) {
		/varset Behind 0
		/i say Backstabbing mode off!
	} ELSE {
		/varset Behind 1
		/i say Backstabbing mode on!
	}
/return

Sub Event_BackUp
	/keypress back hold
	/delay .5s
	/keypress back
/return

Sub Event_Left
	/keypress strafe_left hold
	/delay .7s
	/keypress strafe_left
/return


Sub Event_Right
	/keypress strafe_right hold
	/delay .7s
	/keypress strafe_right
/return

Sub Event_StickDistanceUp
	/varcalc StickDistance (${StickDistance}+1)
	/i say Stick Distance is now ${StickDistance}
/return


Sub Event_StickDistanceDown
	/varcalc StickDistance (${StickDistance}-1)
	/i say Stick Distance is now ${StickDistance}
/return

Sub Event_ToggleMA
	/if (${IsMA}) {
		/varset IsMA 0
		/i say I am not the MA!
	} ELSE {
		/varset IsMA 1
		/i say I am the MA!
	}
/return

Sub DoMaStuff
	/varset TauntSuccess 0
	/varset InMAStuff 1

	:Loop2
	/doevents
	/if (${Breakout}) {
		/varset Breakout 0
		/return
		}
	/if (${Target.ID}!=${CurMobID}) /return

	/if (${Taunt}) {

		/if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30) {
			/disc ${TauntDisc}
			/varset InciteTimer 35s
		}

		/if ( ${Target.Distance}<15 && ${Me.AbilityReady["Taunt"]}) {
			/doability "Taunt"
		}

		/if (${TauntSuccess}) {
				/return
		}
		/goto :Loop2
	} ELSE {
		/return
	}
		
/return
		

Sub Event_TauntCheck
	/if (!${InMAStuff}) /return
	/echo Checking to see if taunt worked!
	/varset TauntSuccess 0
	/varset FailedTaunt 0
	/delay 2s
	/doevents
	/if (${FailedTaunt}) {
		/echo I failed taunt!
		/varcalc TauntTimer ${TauntTimer}+1
		/if (${TauntTimer}>2) {
			/varset TauntTimer 0
                        /varset TauntSuccess 1
			/echo I failed taunt twice. Screw it!
			/return
		}
	} ELSE {
		/varset TauntSuccess 1
	}
/return

Sub Event_FailedTaunt
	/if (!${InMAStuff}) /return
	/varset FailedTaunt 1
/return

Simply run this macro... Hotkey these commands on a single hotkey page.. And you have your very own warrior bot..

PS. Most commands are toggles. So one hotkey will turn it on/off.
PPS. If anybody out there has additions / bugfixed / things done better. Please share. I'll update main post.
PPPS. If I ever get arround to plugin programming I want to have the hotkeys in their own little makeshift pet window.

Oh and, you need mq2moveutils compiled. And Advpath.inc in your macro directory.
Last edited by Blazza on Fri Mar 25, 2005 12:55 pm, edited 8 times in total.

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

Post by JimJohnson » Thu Mar 24, 2005 3:57 am

looks nice have to try it out. You might want to change it from chain taunting thats actually bad.

Code: Select all

   :CombatLoop
   /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
        /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"
        /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Taunt"]})&&(${Taunt})) /doability "Taunt"

   /if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30 && ${Taunt}) {
      /disc Incite
      /varset InciteTimer 35s
   } 

to

Code: Select all

   :CombatLoop
   /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
        /if ((${Target.Distance}<25)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"
        /if ( ${Target.Distance}<25 [b]&& !${Me.TargetOfTarget.Name.Equal[${Me}]}[/b] && ${Me.AbilityReady["Taunt"]})&&(${Taunt} ) /doability "Taunt"

   /if (${Me.PctEndurance}>20 && !${InciteTimer} && ${Target.Distance}<25 && ${Target.PctHPs}>30 && ${Taunt}) {
      /disc Incite
      /varset InciteTimer 35s
   } 

edited to fix the () i forgot to remove earlier
Last edited by JimJohnson on Thu Mar 24, 2005 10:24 am, edited 3 times in total.

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Thu Mar 24, 2005 9:48 am

Thanks JimJohnson, i'll change it as soon as I can figure out how to check if Target of Target is currently active.

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

Post by fearless » Thu Mar 24, 2005 10:01 am

you don't need that many ().

Code: Select all

( ${Target.Distance}<25 && !${Me.TargetOfTarget.Name.Equal[${Me}]} && ${Me.AbilityReady["Taunt"]} && ${Taunt} ) /doability "Taunt"
should work.
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]

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Thu Mar 24, 2005 10:34 am

Updated main post with the HoTT changes.

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Thu Mar 24, 2005 6:55 pm

The entire point of this macro is to keep is as simple as possible, but still have fully functioning usage... The #turbo 40 really helped (Seemed to anyways) but the main slow-down in responce time seems to be advpath.inc...

So that said, my next item on the wishlist is to add my own streamlined /follow sub and /goto.

If anybody has any code to contribute to accomplish this ;) Post before I spend the darn time writing it ;)

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

Post by JimJohnson » Thu Mar 24, 2005 7:07 pm

/goto can be done with MQ2Moveutilities

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Fri Mar 25, 2005 1:12 am

| v.1.1 - Updated Taunt to use HoTT
| Also Updated the macro to give the option to use advpath stuff or not.
| Changed the Combat loop to only do 1 /if statement for taunt stuff. Call me paranoid, but If this ever gets complex. I dont want it eating CPU cycles.
| Updated some shitty formatting. Should be a little easier to read and more uniform.

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Fri Mar 25, 2005 1:34 am

MQ2Moveutilities
Err umm, where/how?


BTW, anchor is broken unless using advpath at the moment. Will fix when above question has an solution!

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

Post by dedpoet » Fri Mar 25, 2005 8:52 am

Cr4zybard's MQ2MoveUtils has a /moveto command in it.

This is how I do it in my little assist bot. I do this when I start the macro. My script takes a "leash" parameter. Then I do this:

Code: Select all

   /if (${Param0.Equal["Leash"]}) {
      /varset DoLeash TRUE
      /varset XHome ${Me.X}
      /varset YHome ${Me.Y}
      /varset FaceHome $(Me.Heading.CCW}
   }
When I engage a mob:

Code: Select all

/if (${DoLeash}) /varset IsHome FALSE
When the mob dies (idea from rogue helper):

Code: Select all

/if (${DoLeash}) /call GoHome

Sub GoHome

   /squelch /stick off
   /face ${If[${Me.Swimming},,nolook]} loc ${YHome},${XHome}
   /keypress forward hold   
   /delay 1s ${Math.Distance[${Me.Y},${Me.X}:${YHome},${XHome}]} < 5
   /keypress forward
   /face heading ${FaceHome}
   /varset IsHome TRUE

/return
This is a super basic assisting bot, but I've found that with a simple script like this, MQ2MoveUtils, and MQ2AutoSkills, I can do most of what I want very simply. I need to try Quagmire's new MoveUtils and see about /stick behindonce - /stick behind just looks too robotic.
Last edited by dedpoet on Fri Mar 25, 2005 8:54 am, edited 1 time in total.

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

Post by fearless » Fri Mar 25, 2005 8:53 am

For your anchor code, you may want to put in a distance check. IE If you are summoned way out there you don't want to just start running back. It might look funny.
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 » Fri Mar 25, 2005 8:57 am

Good idea, thanks fearless. As I said, that code was from a little 60-line script that I use for the greatest possible simplicity. The range check is worth adding though, I think.

Blazza
a lesser mummy
a lesser mummy
Posts: 60
Joined: Thu Mar 11, 2004 4:27 am

Post by Blazza » Fri Mar 25, 2005 12:49 pm

v.1.2 -

Put placeholder in for gotoanchor.

Added toggle IsMA. If you have this set to true, you will taunt all mobs BEFORE attacking. You will fail up to 3 times before saying screw it and attacking anyways. This is usefull if you are the MA and need to taunt mobs before breaking mezz. If the mob in question becomes unmezzed, just hit your attack hotkey again and it will break out of the taunting loop and just attack normaly.

Fredflintstone
a lesser mummy
a lesser mummy
Posts: 31
Joined: Tue Apr 12, 2005 3:33 pm

Post by Fredflintstone » Wed Apr 27, 2005 4:50 pm

I have been trying to get this running for a few days now. I have the MQ2MoveUtils loaded and working. I have the .inc files all downloaded and such. I do a /mac wariorbot and nothing happens. No echo no nothing, he just sits there. I used to get an error about the .inc files but I finally got those all installed. I am not sure what the hotkeys we are supposed to make are, and I am also not sure if this is supposed to be commanded by someone else or buy its own hotkeys. Can someone please let me know how to set this mac up. Is there a string in the script I am supposed to change? I have changed the master name to the toon I want to be the master but still nothing happens.

User avatar
SukMage
a ghoul
a ghoul
Posts: 88
Joined: Fri Jun 04, 2004 5:08 pm

Post by SukMage » Wed Apr 27, 2005 7:24 pm

Fredflintstone wrote:I am not sure what the hotkeys we are supposed to make are, and I am also not sure if this is supposed to be commanded by someone else or buy its own hotkeys.
Read through the macro to see what it does. Generally a "bot" macro would be controlled remotely.
Look at the events and you'll figure out that you'd hotkey /i say warriorbot assist on %t or /t botname warriorbot assist on %t, etc. Note that it is set up out of the box to use mq2irc plugin as well so you would be able to fire it a tell, let it listen to group chat, channel, whatever; in order to hear the reply you'd need to edit it to use another means of communication if you aren't using an IRC channel. Mmm'kay?