|
tahnar Beginner
Joined: 21 Mar 2007 Posts: 14
|
Posted: Fri Mar 30, 2007 3:21 am
Building a list from MUD data |
I want to build my own personal WHO window (or Buddy List, if you will) within this game. When you type WHO, the mud responds with:
Code: |
People in the game:
Rank player 1
Rank player 2
Rank player 3
:
:
Rank player n
n players |
Where "Rank" is the one-word rank for each player. I would like to capture the player names (preferably without the ranks) and display them in their own window. That seems reasonably doable (although I can't quite figure out how to get more than one line at a time... just... beyond... my... grasp). The tricker part, however, follows. The game also gives reports on entries/exits from the game:
REPORT: Rank player has entered the game.
REPORT: Rank player has left the game.
When that happens, I would like the list updated (adding or removing a player name, as appropriate). Alternatively, I can just regenerate the entire list by sending another WHO, but that such a scrolling mess that I prefer to just start the session with a WHO and have it updated on the fly (assuming it's possible to do it!).
I suspect this all involves ADDITEM and related commands. It may be that just getting over capturing more than one line of data into the list will solve my mental block, but I am hoping someone has done something similar in the past (for people, items, whatever). I stumbled across a zmud posting involving collecting quest items in the list, but it seemed convoluted and was also written in zmud coding, which would be even harder for me to figure out.
Anyone have some pre-made coding which might handle this with some tweaks?
Thanks! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Mar 30, 2007 3:54 am |
#TR {People in the game:} {#VAR people {}}
#TR {^%s%w (%w) %d} {#ADDI people %1}
#TR {(%w) has entered the game. } {#ADDI people %1}
#TR {(%w) has left the game. } {#DELI people %1} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
tahnar Beginner
Joined: 21 Mar 2007 Posts: 14
|
Posted: Fri Mar 30, 2007 7:55 pm |
The entering/exit portions work well (with a little formatting work). I still cannot get the initial list population down, however. :) The first two lines of the above suggestion do not appear to do anything except clear out any existing data from @people without populating it again.
Edit: Ah - got it. Needed to remove the %d from the second trigger. Works like a charm now. Thank you! |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|