/whotarget (Pri: and Off:)

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

Moderator: MacroQuest Developers

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

/whotarget (Pri: and Off:)

Post by planetsphinx » Tue Aug 24, 2004 2:53 pm

Need help on finding the variables that the /whotarget spits out.. More specifically, I'm looking for the variables that display the "Pri:" and "Off:" numbers.. I found /echo ${Target.Holding}, but that's not the same, and doesn't seem to work on NPC's..

Anyone clue me into the right direction?

Thanks!

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

Post by planetsphinx » Tue Aug 24, 2004 6:16 pm

Ok.. I found the C code where he does the /whotarget (called SuperWhoTarget in the code)..

Code: Select all

			if (pSpawn->Equipment.Primary)
			{
				itoa(pSpawn->Equipment.Primary,szTemp,10);
				strcat(szMsg,"Pri: ");
				strcat(szMsg,szTemp);
				if (pSpawn->Equipment.Offhand)
					strcat(szMsg," ");
			}
			if (pSpawn->Equipment.Offhand)
			{
				itoa(pSpawn->Equipment.Offhand,szTemp,10);
				strcat(szMsg,"Off: ");
				strcat(szMsg,szTemp);
			}
But I can't find any referance to these variables for the use in a script.. I really don't care about the exact ITEM the target ( going to NPC ) is holding, but rather that it IS holding SOMETHING, or NOTHING. So just a True/False for both Primary and Offhand..

I'm getting closer, but still lost.. hehe..

Any clues / tips ?

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

Post by planetsphinx » Fri Aug 27, 2004 12:38 pm

Ok.. plenty of views here, but no replies.. (wow not even flames hehe) Is everybody else as lost as I am trying to find out how to do this?

Excuse my use of linux commands here, but is there a way to parse the output of /whotar in a script? for example, in linux I can run a command, and use awk to print the 9th and 10th variables of the output, and capture those to another variable..

What I would like is just a TRUE or FALSE for both Primary and Offhand variables of the /whotar command.. if there is a way to get this with an existing variable, that would be great (i.e. /echo ${Target.Holding}) or is there a way to parse /whotarget..

Any help?

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Aug 27, 2004 4:30 pm

Ok.. plenty of views here, but no replies.. (wow not even flames hehe) Is everybody else as lost as I am trying to find out how to do this?
I'm not sure why there's no MQ2Data variables that return Equipment (the devs usually have a good reason for such things), but as far as you've gotten by yourself, I wouldn't think it would be hard for you to add them to your own MQ.

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

Post by planetsphinx » Sat Aug 28, 2004 2:34 am

yeah, I was thinking of modifying the C code to put Equipment.Primary and Equipment.Offhand as variables, but I want my disarm macro include to be usable by anyone.. and not have to require a plugin to be compiled to make the macro usable..

Any dev's reading this and can say whether or not a Equipment.Primary (result = true or false, not a number like in /whotar) is possible in the future?

ascii38
a grimling bloodguard
a grimling bloodguard
Posts: 506
Joined: Sat Jul 17, 2004 8:06 pm

Post by ascii38 » Sun Aug 29, 2004 2:45 am

So write the C code in your local copy and drop it in to the development forum. You're a lot more likely to get things put in if you provide the solution yourself than asking someone else to do it.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sun Aug 29, 2004 5:15 am

It's a one-liner..I think it's more a matter of trying to determine why it isn't there already.