Need help making a complex replacement

Posted by Hoinzor on Sat 27 Jan 2007 09:49 AM — 21 posts, 69,848 views.

#0
Basically, what I want to do is be able to add "notes" to a character. For example:

I type "Who" in the mud I play and it will display something along the lines of:

[ 2 H-Elf Bar] Jezzabelle the Jester
[ 8 H-Drw Asn] Ghuron the 1st Brown
[ 1 Gnome Ran] Shizra the Tenderfoot
[ 5 Storm War] Leinadynous the Cadet


I would like to be able to add notes next to their names. I would like it to display something like:

[ 2 H-Elf Bar] Jezzabelle the Jester (Information here)
[ 8 H-Drw Asn] Ghuron the 1st Brown (I don't like this guy)
[ 1 Gnome Ran] Shizra the Tenderfoot (He's okay)
[ 5 Storm War] Leinadynous the Cadet (Blah blah)

I would like this information stored, and triggered each time I type "Who", or a variation "Whois" (You type "Whois Jezzabelle" and it will list one person at a time)

Is there any possible way to create something like this?

I searched a bit and came up with nothing near what I would like to accomplish, so if there is something already posted, I apologize.

Thanks in advance.


Edit: Also, could you make the note portion in a different color?



EDIT EDIT EDIT EDIT EDIT EDIT EDIT EDIT EDIT


The final revisions have been made by the wonderful Mister Gammon: It is!



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, January 28, 2007, 1:50 PM -->
<!-- MuClient version 3.84 -->

<!-- Plugin "Improved_who" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Improved_who"
   author="Nick Gammon"
   id="b8e59c12ea2d835e5a96d2bc"
   language="Lua"
   purpose="Adds comments to a 'who' list"
   save_state="y"
   date_written="2007-01-28 13:49:50"
   requires="3.84"
   version="1.0"
   >

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^\[\s*\d+\s+[-\w]+\s+\w+\] ([\[\(]\w+?[\]\)] )*(?P&lt;player&gt;[\w ]+?) the \w+"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>-- display original line with original colours
for k, v in ipairs (TriggerStyleRuns) do
  ColourTell (RGBColourToName (v.textcolour), 
              RGBColourToName (v.backcolour),
              v.text)
end -- for

notes = player_notes ["%&lt;player&gt;"] -- any notes?

if notes then
  ColourTell ("blue", "", " (" .. notes .. ")")
end -- notes found

Note ""  -- end line</send>
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   match="^note (?P&lt;player&gt;[\w]+?) (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>

  <alias
   match="shownotes"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>for k, v in pairs (player_notes) do
  Note (k, ": ", v)
end -- for</send>
  </alias>

<alias
   match="^note &quot;(?P&lt;player&gt;[\w ]+)&quot; (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>

<alias
   match="^deletenote (?P&lt;player&gt;[\w]+?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>

  <alias
   match="^deletenote &quot;(?P&lt;player&gt;[\w ]+)&quot;$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>

</aliases>

<!--  Timers -->

<timers>
  <timer enabled="y" minute="5"    send_to="12"
>
  <send>SaveState ()</send>

  </timer>
</timers>

<!--  Script -->

<script>
<![CDATA[

-- load data from variable in state file into a Lua table

function OnPluginInstall ()
  assert (loadstring (GetVariable ("player_notes") or "")) ()
  player_notes = player_notes or {}  -- ensure table exists
end -- function OnPluginInstall

-- save Lua table into MUSHclient variable "player_notes",
--  ready to save the state

require "serialize"

function OnPluginSaveState ()
  SetVariable ("player_notes", serialize.save ("player_notes"))
end --- function OnPluginSaveState

]]>
</script>

</muclient>



Note Name Information
- Enters information that will display next to the characters name on the Who list. Use quotation marks if the person has a two word name (Note "Robert Marley" Information)

Shownotes
- Will display all notes that you have written about everyone.

Deletenote Name
- Will delete a single persons name and note from your Shownotes list. Use quotation marks if the person has a two word name (Deletenote "Robert Marley")

Amended on Mon 29 Jan 2007 06:21 AM by Hoinzor
Australia Forum Administrator #1
This is an interesting challenge. I have done this using a plugin, because that makes saving and loading a bit simpler, as the plugin automatically saves its state when it is closed.

I have also added a timer to save automatically every 5 minutes, so if the PC crashes you haven't lost everything.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, January 28, 2007, 1:50 PM -->
<!-- MuClient version 3.84 -->

<!-- Plugin "Improved_who" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Improved_who"
   author="Nick Gammon"
   id="b8e59c12ea2d835e5a96d2bc"
   language="Lua"
   purpose="Adds comments to a 'who' list"
   save_state="y"
   date_written="2007-01-28 13:49:50"
   requires="3.84"
   version="1.0"
   >

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="\[ \d+ [-\w]+ \w+\] (?P&lt;player&gt;\w+) the \w+"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>-- display original line with original colours
for k, v in ipairs (TriggerStyleRuns) do
  ColourTell (RGBColourToName (v.textcolour), 
              RGBColourToName (v.backcolour),
              v.text)
end -- for

notes = player_notes ["%&lt;player&gt;"] -- any notes?

if notes then
  ColourTell ("white", "", " (" .. notes .. ")")
end -- notes found

Note ""  -- end line</send>
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   match="^note (?P&lt;player&gt;[\w]+?) (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>

  <alias
   match="shownotes"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>for k, v in pairs (player_notes) do
  Note (k, ": ", v)
end -- for</send>
  </alias>

</aliases>

<!--  Timers -->

<timers>
  <timer enabled="y" minute="5"    send_to="12"
>
  <send>SaveState ()</send>

  </timer>
</timers>

<!--  Script -->

<script>
<![CDATA[

-- load data from variable in state file into a Lua table

function OnPluginInstall ()
  assert (loadstring (GetVariable ("player_notes") or "")) ()
  player_notes = player_notes or {}  -- ensure table exists
end -- function OnPluginInstall

-- save Lua table into MUSHclient variable "player_notes",
--  ready to save the state

require "serialize"

function OnPluginSaveState ()
  SetVariable ("player_notes", serialize.save ("player_notes"))
end --- function OnPluginSaveState

]]>
</script>

</muclient>



This requires MUSHclient version 3.84 (onwards), because it uses the new concept of omitting from output, and then writing to the output window.

You may need to modify the trigger that matches the who list a bit, but this one should work OK.

First thing you need to do is make notes, eg.


note Ghuron I don't like this fellow


This adds a note for Ghuron into the table (this is case-sensitive, so you better copy the name from the screen).

You can check your current notes by typing:


shownotes


You should see something like this:


Jezzabelle: is a nice person
Ghuron: I don't like this fellow


Now when you do a "who" the trigger matches the "who" line, looks up the name in the table, and adds the extra stuff, like this:


[ 2 H-Elf Bar] Jezzabelle the Jester (is a nice person)
[ 8 H-Drw Asn] Ghuron the 1st Brown (I don't like this fellow)
[ 1 Gnome Ran] Shizra the Tenderfoot
[ 5 Storm War] Leinadynous the Cadet


The last few lines in the plugin handle serialization of the Lua table into a MUSHclient variable, for saving, and the loading back into a Lua table when the plugin is loaded.
Amended on Sun 28 Jan 2007 05:04 AM by Nick Gammon
#2
I upgraded to the version you required and copied/pasted into a new XML document. I saved that file in the plugins directory and loaded it via "Load Plugin".

The plugin is functioning to the point that:

Note Name information

If I typed the above (Obviously modified to a true name and information) it will register the information and will output it upon typing "Shownotes", however, it does not show anything on my "Who" list.

I've pasted some more variations of the "Who" list in order for you to better see what can be done. I do appreciate the work you've put forward towards this. Really. Thank you.




<100%hp 96%m 100%mv 12957tnl (5.01%) 5 AM><forest-outdoor-cloudy>
 *51 Felar War* (PK) Myname the editedforcoolness
[33  Fire A-P] Krirga the Captain of Legion
[24 Svirf War] Ajirun the Knight
[20 W-Elf Ran] Mikirel the Ranger
[29  Elf  Pal] (PK) [TRIBUNAL] Wionlohs the Bestower of Charity, Magistrate of Seantryn Modan
[24  Orc  Ber] Gnashgaar the Impaler
[35 Human Nec] (PK) Kore the Abomination, Imperial Black Magician
[24  Fire War] (PK) Thrakazhaar the Knight
[30 Human War] (PK) Gatto the Man-At-Arms
[27  Orc  Ber] (PK) Charnak the Spinebreaker
[21 Felar Ran] Abulin the Howler
[35 Svirf War] (PK) Rhoth the Warrior of the Blade
[24 Human Nec] Gothinat the Bringer of Plague, Bloodchild
[33 Storm Pal] Dahltu the Protector of the Meek
[32 Felar War] (PK) Gharral the Master of Defense

Players found: 15


I edited my name, some people who play Carrion Fields may read this and obviously giving out who I play is not a good thing, but... to show how it displays my, and people whom I can PK, I've attached that. Perhaps this is causing a problem?(The (PK) or even the spaces, or titles?)

Peoples Titles change each level, so tomorrow, Gharral the Master of Defense will likely be something else. Is this effecting the plugin at all?
Amended on Sun 28 Jan 2007 08:53 PM by Nick Gammon
Australia Forum Administrator #3
OK I see the problem here. Triggers are very sensitive to getting things like spacing right.

Also, unless you use the [code] tag, the forum reduces multiples spaces to a single space. I have modified your post to add that tag.

Based on your original posting, I assumed there was a space before the level number, eg.


[ 2 H-Elf Bar] Jezzabelle the Jester


I see now that if the level is above 9, then that space is not there.

Also in this example:


[29  Elf  Pal] xxxxx


There are 2 spaces on each side of "Elf".

In addition, some names have things like "(PK) [TRIBUNAL]" before them.

I have modified the match line (just replace that in the plugin), and the plugin seems to work for me for the test data you gave then.


match="^\[\s*\d+\s*[-\w]+\s*\w+\] (\(PK\) )?(\[TRIBUNAL\] )?(?P&lt;player&gt;\w+) the \w+"

Amended on Sun 28 Jan 2007 09:03 PM by Nick Gammon
#4
Fantastic!

It works just as it should with one exception. How can I enable it to note on people with two names. A reward in CF is that you get a last name, and by doing so it messed with the "the" part of the trigger because the word after their first name is not "the".

Would enabling "_" (an underscore) as an input for two named people work?
Australia Forum Administrator #5
You mean, like "Dahltu Strongsword the Protector of the Meek"?

I think you just need to allow for a space in the player name part.

Instead of:

match="^\[\s*\d+\s*[-\w]+\s*\w+\] (\(PK\) )?(\[TRIBUNAL\] )?(?P&lt;player&gt;\w+) the \w+"

Try:

match="^\[\s*\d+\s*[-\w]+\s*\w+\] (\(PK\) )?(\[TRIBUNAL\] )?(?P&lt;player&gt;[\w ]+) the \w+"

I have changed \w+ to [\w ]+, which effectively matches on "word" characters, or a space.
#6
No dice. Hrm.

Perhaps allow the input to accommodate for quotation marks to input multiple words? Instead of typing Note Dahltu Stronghold (As, currently, it will read Dahltu: Stronghold) Perhaps note "Dahltu Stronghold" information so that it may read:


Shownotes

Dahltu Stronghold: Information



as opposed to the current:

Dahltu: Stronghold information



That's the only way I can think of doing it, but... I have no idea what I'm doing in the first place.
Amended on Sun 28 Jan 2007 10:23 PM by Hoinzor
Australia Forum Administrator #7
Yes you are on the right track there.

My change would make the trigger work, but didn't address the question of adding the note in the first place.

Try adding this extra alias, by pasting this just before the line: </aliases>


<alias
   match="^note &quot;(?P&lt;player&gt;[\w ]+)&quot; (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>


This adds an alias that matches on a quoted name, eg:


note "Dahltu Stronghold" should be avoided


However for single names, you can still use the unquoted version, that is matched by the original alias.
#8
match="^[\s*\d+\s*[-\w]+\s*\w+] (\(PK\) )?([TRIBUNAL] )?([BATTLE] )?([FORTRESS] )?([SCION] )?([EMPIRE] )?([OUTLANDER] )?(\(WANTED\) )?(?P&lt;player&gt;\w+) the \w+"




The above is posted for players from Dio's. Copy and paste that to replace your current. It's as up to date as the other, but contains all cabals so that you can make notes on your cabal mates.
#9
The new portion you added now prevents anyone with (Wanted) or a cabal name (In the brackets) from displaying notes now.

Hrm.
Australia Forum Administrator #10
Hmm, this is getting a bit out of hand with all the extra words that might appear in brackets.

Also, this isn't right: "([TRIBUNAL] )"

Something in square brackets like that matches on a set, in other words it simply matches a single letter, which can be one of T, R, I, B, U, N, A or L.

You really mean: "(\[TRIBUNAL\] )"

The backslash escapes the brackets, so that we are literally looking for "[TRIBUNAL]".

To make the whole thing more general, try this:


 match="^\[\s*\d+\s*[-\w]+\s*\w+\] ([\[\(]\w+?[\]\)] )*(?P&lt;player&gt;[\w ]+) the \w+"


This matches on any number of things, in brackets, before the player name. All the brackets and backslashes may look confusing, but the important part is here:


([\[\(]\w+?[\]\)] )*


This is saying, match zero or more of (that is the final asterisk):

  • A [ or ( symbol
  • One or more "word" characters (letters, numbers, underscore) - that is the \w+? symbol.
    The ? at the end makes it non-greedy, so it matches the least number of things it can.
  • A ] or ) symbol
  • A final space


So that will match on something like:


(PK) [TRIBUNAL] [BATTLE] [EMPIRE] (dead) Fred Nurk the sword swinger



Amended on Mon 29 Jan 2007 01:36 AM by Nick Gammon
#11
Well, after all of that, it's breaking it more and more each time. Some names work (Now, with the most current anyone with (PK) in front of their name that starts with an I will not display notes for some reason) and some don't. No one with a [TRIBUNAL] or any bracket in their name works at all.

I reverted back to the second one:

match="^[\s*\d+\s*[-\w]+\s*\w+] (\(PK\) )?([TRIBUNAL] )?(?P&lt;player&gt;\w+) the \w+"


If you feel like trying to figure it out, fantastic, if you don't, no hard feelings. Truly. You've spent far too much time on this as is. I can live with not being able to make notes on a few different types of names.

Thanks again.

Also, the last favor I'm going to ask. How do I delete entries?
Amended on Mon 29 Jan 2007 02:05 AM by Hoinzor
Australia Forum Administrator #12
Quote:

No one with a [TRIBUNAL] or any bracket in their name works at all.

I reverted back to the second one:

match="^[\s*\d+\s*[-\w]+\s*\w+] (\(PK\) )?([TRIBUNAL] )?(?P&lt;player&gt;\w+) the \w+"


Well you didn't really, because my 2nd one had more backslashes in it:


match="^\[\s*\d+\s*[-\w]+\s*\w+\] (\(PK\) )?(\[TRIBUNAL\] )?(?P&lt;player&gt;[\w ]+) the \w+"


I explained that you needed them or it would not match.

It is working for me, so you need to copy and paste carefully. Even my last one should have worked.

If there is a case that is not working you need to paste the exact text from the MUD, perhaps there is something there that the regular expression is not testing for.

Quote:

How do I delete entries?


You could add two more aliases before the </aliases> line, like this:


 <alias
   match="^deletenote (?P&lt;player&gt;[\w]+?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>

  <alias
   match="^deletenote &quot;(?P&lt;player&gt;[\w ]+)&quot;$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>


Now you can type: deletenote "Dahltu Stronghold"
or: deletenote Dahltu

Amended on Mon 29 Jan 2007 03:27 AM by Nick Gammon
#13
For some reason when I paste on the forum it's taking out the backslashes, they're all there in my xml. Weird.

Trying it again to be 100%.
Australia Forum Administrator #14
If you post with forum codes enabled, you need to "escape" the backslashes and brackets, or the forum will take them away for you.

MUSHclient has a function to do that, use Edit menu -> Convert Clipboard Forum Codes, once you have something on the clipboard you are intending to paste here. That will put extra backslashes in front, so it comes out right.
#15
I just sent you an email.
Australia Forum Administrator #16
Just as well you warned me, I don't often read emails, being 99.9% spam. (In case anyone is wondering, the email contained an example who list).

A minor tweak was necessary, the test for the name needed to be made "not greedy" as, once we added in the space, it was sucking in all the letters and spaces onwards, including the word "the". This seemed to work with your test data:


match="^\[\s*\d+\s+[-\w]+\s+\w+\] ([\[\(]\w+?[\]\)] )*(?P&lt;player&gt;[\w ]+?) the \w+"


Basically there is a ? after the + in the test for the player name.
Amended on Mon 29 Jan 2007 05:27 AM by Nick Gammon
Australia Forum Administrator #17
Just to break this regexp down into its component parts, this is what it does:

  • ^ - match start of line
  • \[ - match a LH square bracket
  • \s* - match zero or more spaces
  • \d+ - match one or more digits (the level)
  • \s+ - match one or more spaces
  • [-\w]+ - match one or more of the set "word" characters or hyphens (the race)
  • \s+ - match one or more spaces
  • \w+ - match one or more word characters (the class)
  • \] - match a RH square bracket
  • Now we have a group consisting of the next few things inside round brackets (the optional things) with a * afterwards, to indicate "zero or more of these things".
    • ( - start of the group
    • [\[\(] a set consisting of the [ or ( character
    • \w+? - one or more word characters, not greedy
    • [\]\)] - a set consisting of the ] or ) character
    • ) - end of the group
    • * - match this entire group zero or more times
  • (?P<player> - start of group named "player"
  • [\w ]+? - match one or more of the set "word" characters or spaces (the player name), not greedy
  • ) - end of the group named "player"
  • the \w+ - the word "the" followed by another word


Simple, huh?

But at least, looking at this you should be able to understand it, and be better able to design modifications.

In the XML code "<player>" is represented as "&lt;player&gt;", but that is just for inside the plugin, internally the regular expression is just "<player>".
Amended on Mon 29 Jan 2007 05:31 AM by Nick Gammon
#18
I love you! It works perfectly now. I cannot thank you enough.
Australia Forum Administrator #19
Good!

In case anyone wants to use it, this is the final version I had:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, January 28, 2007, 1:50 PM -->
<!-- MuClient version 3.84 -->

<!-- Plugin "Improved_who" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Improved_who"
   author="Nick Gammon"
   id="b8e59c12ea2d835e5a96d2bc"
   language="Lua"
   purpose="Adds comments to a 'who' list"
   save_state="y"
   date_written="2007-01-30 17:00:00"
   requires="3.84"
   version="1.1"
   >

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^\[\s*\d+\s+[-\w]+\s+\w+\] ([\[\(]\w+?[\]\)] )*(?P&lt;player&gt;[\w ]+?) the \w+"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>
-- display original line with original colours
for k, v in ipairs (TriggerStyleRuns) do
  ColourTell (RGBColourToName (v.textcolour), 
              RGBColourToName (v.backcolour),
              v.text)
end -- for

notes = player_notes ["%&lt;player&gt;"] -- any notes?

if notes then
  ColourTell ("green", "", " (" .. notes .. ")")
end -- notes found

Note ""  -- end line
</send>
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   match="^note (?P&lt;player&gt;[\w]+?) (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>

  <alias
   match="shownotes"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>for k, v in pairs (player_notes) do
  Note (k, ": ", v)
end -- for</send>
  </alias>

  <alias
   match="^note &quot;(?P&lt;player&gt;[\w ]+)&quot; (?P&lt;description&gt;.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = "%&lt;description&gt;"</send>
  </alias>

 <alias
   match="^deletenote (?P&lt;player&gt;[\w]+?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>

  <alias
   match="^deletenote &quot;(?P&lt;player&gt;[\w ]+)&quot;$"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
player_notes ["%&lt;player&gt;"] = nil</send>
  </alias>


</aliases>

<!--  Timers -->

<timers>
  <timer enabled="y" minute="5"    send_to="12"
>
  <send>SaveState ()</send>

  </timer>
</timers>

<!--  Script -->

<script>
<![CDATA[

-- load data from variable in state file into a Lua table

function OnPluginInstall ()
  assert (loadstring (GetVariable ("player_notes") or "")) ()
  player_notes = player_notes or {}  -- ensure table exists
end -- function OnPluginInstall

-- save Lua table into MUSHclient variable "player_notes",
--  ready to save the state

require "serialize"

function OnPluginSaveState ()
  SetVariable ("player_notes", serialize.save ("player_notes"))
end --- function OnPluginSaveState

]]>
</script>

</muclient>



To use:


note person comment   (eg. note Nick avoid him)
note "person" comment (eg. note "Nick Longsword" herbalist)
deletenote person     (eg. deletenote Nick)
deletenote "person"   (eg. deletenote "Nick Longsword")
shownotes             (lists existing notes)

Amended on Tue 30 Jan 2007 05:12 AM by Nick Gammon
#20
-------------Immortals--------------
[Goddess 96 Ang Asn] Bryn

-------------Mortals--------------
[SacredC 91 Drg Pal] [AFK] Baja If Not Why Not [IAW]
[Keeper 84 Vmp Wit] Elektra Blood Sucker Extrordinare!
[CircleC 70 Lch Wiz] [AFK] Cavcav
[Keeper 43 Hum Cle] [AFK] Sasuke, The Magician of Faith
[ 1 Hum Cle] Testing the Believer

This is the wholist for the mud Im on. emperia.org 5002

Its basically like this

[tribe level race class] Name Title

As you can see the player Testing has no tribe, so his spot there is blank. Also, we have an option for AFK (away from computer) that shows people are afk. This puts [AFK] in front of the player name when enabled.

Can someone please come up with a script that will work for me?