Help with Monk code

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

mcdebug
a lesser mummy
a lesser mummy
Posts: 30
Joined: Mon Jun 07, 2004 4:24 am

Help with Monk code

Post by mcdebug » Sat Jun 19, 2004 4:12 pm

i recently needed to convert some rogue helper code to be usuable by monks. what i wanted to accomplish is for them to, instead of backstabbing, kick, which i did correctly. But i also wanted him to FD once he got to his anchor location or his anchor person. i got it to work but it acts up. what happens is everytime it updates the text message in the MQ window with the "moving closer to target.... # feet away" he fd's and stands back up. this i dont get seeing that i put a /if only if he gets to his target to fd, here check it out. I could be half the zone away from my anchor character and on the way to him it would FD and stand back up immediately all the way to him everytime it would update the message.



Code: Select all

/if (${doLeash} && !${strikeReady}) { 
       /if (${leashholder.Equal[Nobody]} && (${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}>20)) { 
         /if (!${Me.Standing}) /stand
		 /echo Moving closer to the Stake... ${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]} ft. away 
         /face nolook loc ${stakeY},${stakeX} 
         /keypress forward hold 
         /delay 1s ${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}<20 
         /keypress forward 
         /if (${Math.Distance[${Me.Y},${Me.X}:${stakeY},${stakeX}]}<20) { 
           /echo Arrived near the Stake, Flopping. 
			/if (${Me.AbilityReady["Feign Death"]}) {
				/doability "Feign Death"
			} else {
			    /delay 5
				/doability "Feign Death"
				    }
           /face fast nolook away loc ${stakeY},${stakeX} 
         } 

       } 
       /if (!${leashholder.Equal[Nobody]} && ${Spawn[${leashholder}].ID} && (${Spawn[${leashholder}].Distance}>21)) { 
		 /if (!${Me.Standing}) /stand		 
/echo Moving closer to ${leashholder}... ${Spawn[${leashholder}].Distance} ft. away 
         /if (${Target.ID}!=${Spawn[${leashholder}].ID}) /target id ${Spawn[${leashholder}].ID} 
         /if (${Me.Combat}) /attack off 
         /face nolook 
         /keypress forward hold 
         /delay 1s ${Spawn[${leashholder}].Distance}<21
         /keypress forward 
         /if (${Spawn[${leashholder}].Distance}<21) { /echo Arrived near Master (${leashholder}) , Flopping. 
				/if (${Me.AbilityReady["Feign Death"]}) {
					/doability "Feign Death"
				}				
         }
	   } 

|- Broken leash check 
       /if (!${leashholder.Equal[Nobody]} && !${Spawn[${leashholder}].ID}) { 
         /echo ** Master DEAD or ZONED! Leash is BROKEN! 
         /varset doLeash FALSE 
         /varset leashholder Nobody 
         /ini "RHSettings.ini" "General" "Leashing" "${doLeash}" 
         /ini "RHSettings.ini" "General" "LeashHolder" "${leashholder}" 
       } 
     } 


the first section is if the anchor is a location (that part works fine) the second part is if they are following a person thats the part that is messin up. im kinda new at this so if im missin something obvious warn me 8)
Last edited by mcdebug on Sat Jun 19, 2004 5:22 pm, edited 2 times in total.

mcdebug
a lesser mummy
a lesser mummy
Posts: 30
Joined: Mon Jun 07, 2004 4:24 am

Post by mcdebug » Sat Jun 19, 2004 4:56 pm

also is there a way for me to let the macro run and monitor it as i step through each line? this would GREATLY help me out so i could see exactly where its messing up instead of guessing.

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Mon Jul 19, 2004 2:46 pm

RH may be a little monolithic for pulling out pieces of it to make use in a simpler situation. If I may suggest, take the whole thing as a starter and then prune out the stuff you don't need and alter various similar skills (like kick instead of backstab).

I'm considering writing a mini design document for others so they know how RH works (at a structural level) so then can use it as a generic-bot like engine for other custom scripts.

I'll keep you posted.
--Jerle

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Mon Jul 19, 2004 9:18 pm

that sounds like an awesome idea jerle i would love to see something along those lines as it would help newbs like me in the learning process.

geo