Linked Ranks

by Aison

Back to Mechanic's Corner.

Aison2007-11-09 12:18:04
About a year ago I was floating around the forums and someone had posted a little bit of code that did something rather convenient, that I liked a lot.

This:
QUOTE

You are ranked 122nd in Lusternia.
Would appear as such:
QUOTE

You are ranked 122nd in Lusternia.


And when you clicked it, would do:
CODE
Rank      Player                                       Title
---------------------------------------------------------------------
#112      Arawaen d'Murani, Of the Red Masque
#113      Sibuna Myndaen Shervalian
#114      Confectioner Rhosyn Mercator
#115      Grand Apostle, Gadritan Sar'Alainn, Fury of the Dove
#116      Sharael, Systematic Chaos
#117      Heir of Glinshari, Eamon Mes'ard, of the White Foal
#118      Herbalist Fulior Aramanth, Taisi
#119      Arundor Mes'ard
#120      Tormentor Shikha d'Murani, Thorn of the Amaranth
#121      Yukari Auralius, Moonlight Apprentice
#122      Cleric Aison La'Saet, Merciful Judge         (5th Circle)
#123      Postulant Yevah Luminare, Methrenton's Ange  (5th Circle)
#124      Squire of the Armies of Light, Shinza Thare  (5th Circle)
#125      Archmage Veonira d'Murani, the Earth Wench   (5th Circle)
#126      Ecclesiar Trakis                             (5th Circle)
#127      Prince Shamarah, the Terror of the Night     (5th Circle)
#128      Torturer Alger, Venenum Celer                (5th Circle)
#129      Fionn Freewind, Dawn's Dew                   (5th Circle)
#130      Wildeflower Aramel Talnara-Mes'ard, Votive   (5th Circle)
#131      Carameshian                                  (5th Circle)
RANKINGS XP 132 to see more.


Does anyone have it/know where it is/want to give me something like it since I am completely incompetent when it comes to coding?

Thanks!
Eldanien2007-11-09 12:35:52
That sounds a lot like an MXP thing. Set your client to recognize MXP tags, and set triggers to replace certain text with MXP-ified versions.

For example, trigger on
You are ranked (%d) in Lusternia.

Gag it. Have a script set a variable MYVARIABLE to %1 - 10, and change it to 1 if you go below that. Then output the text

You are ranked %1 in Lusternia.

Note, my example is a bit rough. It's been a while since I played with MXP. Pattern matching is a game I'll leave up to you.

The MXP specification can be found here.
Lendren2007-11-09 15:37:31
That was me, and it's here.
Xinael2007-11-09 16:04:55
zMUD or CMUD?

#trig {(You are ranked )(%d)({st|nd|rd|th} in Lusternia)} {#sub {%1%2%3}}

Much simpler. You could even do:

#trig {(You are ranked )(%d)({st|nd|rd|th} in Lusternia)} {#sub {10,%eval(%2-10),1)'>%1%2%3}}
Aison2007-11-10 10:00:40
QUOTE(Lendren @ Nov 9 2007, 07:37 AM) 457152
That was me, and it's here.



Hmm, for some reason, upon clicking the link, I only get:

CODE
Rank      Player                                       Title
---------------------------------------------------------------------
End of the Rankings.


mxp is enabled. Not sure what else to do.
Xinael2007-11-10 13:00:55
It'd be much more useful if you gave us the command the client was sending to get that text. It could be doing almost anything. And you could just use the one I gave, it's tested and works fine.
Ildaudid2007-11-10 15:14:19
the command to show the rankings is

rankings xp ##


the ## would be the area you want to search. So in her case, instead of 122 I would go with 115 that would give her a few names ahead of her and a few behind her

so if she wanted it like that the command would be: rankings xp 115
Lendren2007-11-10 19:13:53
If you include the "You are" part, then you won't get to do the same thing on other people's HONOURS.

My version goes 10 back from the number of the person given so they should be right in the middle.

To avoid the <10 thing it's simpler to do %max(1,%eval(%1-10)). That's what mine does, though I never posted the update.
Aison2007-11-11 00:53:08
CODE
4188h, 4188m, 4188e, 10p ex-rankings xp -10
Rank      Player                                       Title
---------------------------------------------------------------------
End of the Rankings.


is what it does when I click on the link.
Eldanien2007-11-11 02:59:46
What you're sending to Lusternia is 'rankings xp -10'.

Somewhere along the lines, your syntax is messed up and instead of mathing out ten from your captured ranking, minimum one, you're just going with the -10.

What client are you using, just so we know where to start?
Aison2007-11-11 06:48:35
I'm using zMud 7.21.

This is what the code says:

CODE
#sub {ranked %1%2 in Lusternia}


I played with it a bit, but didn't solve the problem.
Eldanien2007-11-11 08:15:33
#sub {ranked %1%2 in Lusternia}

I'm not a zMUD user, but this looks like it's what you need.
Aison2007-11-11 09:12:44
QUOTE(Eldanien @ Nov 11 2007, 12:15 AM) 457531
#sub {ranked %1%2 in Lusternia}

I'm not a zMUD user, but this looks like it's what you need.


Perfect, thank you!