MXP Tags

Posted by Thalor on Tue 11 May 2004 03:32 PM — 2 posts, 12,202 views.

#0
I have a problem with MXP.

The element entry is thus....

/* Immortal tag to load/edit/slay/stat/kill mobs that you see */
write_to_buffer( d, MXPTAG
("!ELEMENT Mobs \"<send href='"
"medit &#39;&vnum;&#39;|"
"load mob &#39;&vnum;&#39;|"
"kill &#39;&desc;&#39;|"
"slay &#39;&desc;&#39;|"
"stat mob &#39;&desc;&#39;"
"' "
"hint='RH mouse click to use this object|"
"Edit &desc;|"
"Load &desc;|"
"Kill &desc;|"
"Slay &desc;|"
"Stat &desc;"
"'>\" ATT='vnum name desc'"),
0);


The code to show it to MXP enabled clients is this.

if (IS_NPC(victim) && IS_IMMORTAL(ch) && (!IS_SET (ch->comm,COMM_NOVNUM)))
{
sprintf( buf3, "[" MXPTAG ("mobs %d %s %s") "%d" MXPTAG("/mobs")"]",victim->pIndexData->vnum,victim->name,victim->short_descr,victim->pIndexData->vnum);
strcat(buf,buf3);
}


I *THOUGHT* I did this correctly. Can someone point out my error?

When I hit Edit I need it to medit <vnum>
When I hit Load I need it to load mob <vnum>
When I hit kill I need it to kill <name>
When I hit slay I need it to slay <name>
When I hit stat I need it to stat mob <name>

The last 3 work but I cant get the medit and load mob to show vnums. It instead gives me medit <name> and load mob <name>...

What am I missing?

TIA!
Australia Forum Administrator #1
It looks OK - can you turn up the MXP debug level and copy and paste the actual tag that is sent to the client?

I am expecting something like:

<mobs 1234 foo bar>1234</mobs>

but maybe it will be something else.