Page 1 of 1
/whotarget (Pri: and Off:)
Posted: Tue Aug 24, 2004 2:53 pm
by planetsphinx
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!
Posted: Tue Aug 24, 2004 6:16 pm
by planetsphinx
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 ?
Posted: Fri Aug 27, 2004 12:38 pm
by planetsphinx
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?
Posted: Fri Aug 27, 2004 4:30 pm
by Cr4zyb4rd
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.
Posted: Sat Aug 28, 2004 2:34 am
by planetsphinx
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?
Posted: Sun Aug 29, 2004 2:45 am
by ascii38
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.
Posted: Sun Aug 29, 2004 5:15 am
by Cr4zyb4rd
It's a one-liner..I think it's more a matter of trying to determine why it isn't there already.