movebehind script, logic error or scripting error?

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

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

movebehind script, logic error or scripting error?

Post by ThatOtherGuy » Sat Nov 29, 2003 6:55 pm

mkay. So this mostly works. the idea is to set the mobs heading to 0, with an arc of -180 to +180 left to right, and set a difference between mob heading and your heading. As far as I can tell, that part works great.

Next part is supposed to check if you are in the from 120 degrees of the mob, be seeing if you're either in hte +60 or -60 regions, setting a variable to tell that. it *seems* like this is working, but hard to tell.

Then, based on that, move you either left to right back into the right spot behind the mob

Code: Select all

Sub movebehind
/declare temp1 local
/declare temp2 local
/declare HeadingDiff local
/varset temp1 0
/varset temp2 0
/if $target()==FALSE { 
	/attack off 
	/sendkey up up 
	/return
}
/face fast nolook
/varset HeadingDiff $calc($target(heading)-$char(heading))
/if n @HeadingDiff>=180 {
	/varcalc HeadingDiff @HeadingDiff-360
}
/if n @HeadingDiff<=-180 {
	/varcalc HeadingDiff @HeadingDiff+360
}
/if n @HeadingDiff<=-60 {
	/varset temp1 1
}

/if n @HeadingDiff>=60 {
	/varset temp2 1
}

/if n @temp1==1 {
	/sendkey down ctrl
	/press left
	/press left
	/face fast nolook
	/press left
	/press left
	/face fast nolook
	/press left
	/press left
	/face fast nolook
	/sendkey up ctrl
}
/if n @temp1==2 {
	/sendkey down ctrl
	/press right
	/press right
	/face fast nolook
	/press right
	/press right
	/face fast nolook
	/press right
	/press right
	/face fast nolook
	/sendkey up ctrl
}
/if n @temp1==1 /if n @temp2==1 {
	/sendkey up ctrl
	/sendkey up left
	/sendkey up right
}
/return
Last edited by ThatOtherGuy on Wed Dec 03, 2003 6:33 am, edited 1 time in total.
-TOG

ThatOtherGuy
a lesser mummy
a lesser mummy
Posts: 41
Joined: Tue Aug 05, 2003 6:12 pm

Post by ThatOtherGuy » Wed Dec 03, 2003 6:32 am

Bump - Anyone have any idea? I'm sick of pounding my head ona wall with this one :p
-TOG