Turn mob for pets

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Ogre_Luvr
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Dec 18, 2003 10:11 pm
Location: DC

Turn mob for pets

Post by Ogre_Luvr » Sun Apr 04, 2004 10:20 pm

I want to use my War bot to turn the mob we are fighting so the pet can be behind the mob
this works, but ...

Code: Select all

Sub Do-turn
	/if n $spawn(@MyTarget,distance)<=10 /press down
	
	/declare newHeading local
	/if n $spawn($spawn($id(necroCharName),pet),heading)>=180 {
		/varset newHeading $calc($spawn($spawn($id(necroCharName),pet),heading)-180)
	} else {
		/varset newHeading $calc($spawn($spawn($id(necroCharName),pet),heading)+180)
	}
	/face fast
	/if n $char(heading)>$calc(@newHeading+20) {
		/sendkey down ctrl
		/press left
		/face fast
		/press left
		/sendkey up ctrl
	}
	
	/if n $char(heading)<$calc(@newHeading-20) {
		/sendkey down ctrl
		/press right
		/face fast
		/press right
		/sendkey up ctrl
	}
/return
I want to use the pets heading to get a loc 20 or so in front of the pet, then /face.

is that possible? I'm not completely familiar with the heading things and such
Thanks!



*edit maybe someone just needs to break down cos acos and sin cause i have no idea what they do =P


/if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<3 {

CrankyBaby
a lesser mummy
a lesser mummy
Posts: 58
Joined: Thu Mar 11, 2004 5:12 pm
Location: Tijuana.bc.mx
Contact:

Re: Turn mob for pets

Post by CrankyBaby » Sun Apr 04, 2004 10:39 pm

Ogre_Luvr wrote: *edit maybe someone just needs to break down cos acos and sin cause i have no idea what they do =P
The quick and dirty version:
say you've declared a couple of variables, t_dist and t_head, that hold your target's distance and heading. If that was all of the info you had about your target, you could use cos and sin to give you the x and y difference in your co-ordinates. Likewise, you use acos and asin to go the other way, from x and y, to distance and direction.
Okay, okay, I take it back - "UnF--k you."

“If you play the WinXP CD backwards,
you get a satanic message.”
“That's nothing, if you play it forward,
it installs WinXP.”

Ogre_Luvr
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Dec 18, 2003 10:11 pm
Location: DC

Post by Ogre_Luvr » Mon Apr 05, 2004 7:32 pm

ok SO ...

y0 = $spawn(pet_id,y)
x0 = $spawn(pet_id,x)

y1 = $spawn($target(id),y)
x1 = $spawn($target(id),x)

I would like to place my tank 15 beyond the mob, on the oposite side of the pet.

any math wiz out there that can help with this?