Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Spectara
Newbie


Joined: 06 Nov 2005
Posts: 9

PostPosted: Sun Nov 06, 2005 7:55 pm   

Data mining
 
I'm wanting to create a string list (what I've learned how to do, haven't figured out databases yet) that contains the names of all the players online.

I've tried this using my muds WHO command, but players can have pretitles that mess up the process (reading in 'The' and things like that). What I want to do is instead go off of a USER list, which just shows the player names in four columns.

-=-=-| USERS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Player____________Player____________Player____________Player
Player____________Player____________Player____________Player
Player____________Player____________Player

There are also instances where the player has a two word name:

Player____________Two names________Player____________Player

(The underscores should be spaces, the forum kept negating them all and shoving the words together with just one space)

The columns stay the same distance apart, even if a name is too long to be fully displayed. How would I go about reading input at these set distances? I'm using zMUD 7.04.

If it's easier to figure it out this way, the WHO command shows this:

(trigger phrase)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

[95] Pretitle Player__________________ Race____Subclass
[90] Player_________________________Race____Subclass
[82] Player_________________________Race____Subclass
[78] Pretitle Player__________________ Race____Subclass

And I've been using the following trigger:

#TRIGGER {*] (%w)} {#additem player {%1}}

Which works fine, unless their pretitle starts with a common word such as 'The' or 'A'. Then the triggers I have that use the player list shoot off all the time for regular text from the mud.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Nov 06, 2005 8:37 pm   
 
Code:
#TRIGGER {~[&2~] (&33)} {
#ADDITEM player {%word(%trim("%1"),%numwords(%trim("%1"))}
}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Spectara
Newbie


Joined: 06 Nov 2005
Posts: 9

PostPosted: Sun Nov 06, 2005 8:58 pm   almost
 
Not quite right, but my fault for not giving all the info, I think. There are also post titles on the names. e.g.

[65] Defender of the Realm Bushwack gonna getcha!__Giant______Warrior

And I would just want to take out Bushwack, which seems to be a nearly impossible task, which is why I wanted to use the USER list instead, if possible. Is there a way to use that same method to cut out the spaces in the USER list and take each one of the names?
Reply with quote
Spectara
Newbie


Joined: 06 Nov 2005
Posts: 9

PostPosted: Sun Nov 06, 2005 10:32 pm   
 
In the USER display, each character name is given up to 18 letters. I'd want to grab 18 letters, trim them, add them to my list, grab another 18, trim, add, grab 18, trim, add, grab 18, trim, add (four times per line). I've set up a trigger for the line directly before the list starts to #T+ a class folder with whatever this turns out to be in it, and another trigger for the line directly after it finishes to #T- the folder. I just need to figure out how to trigger 4 times on the same line.
Reply with quote
Spectara
Newbie


Joined: 06 Nov 2005
Posts: 9

PostPosted: Sun Nov 06, 2005 11:24 pm   
 
Ok, I've got it working with this:

#CLASS {update}
#VAR player
#TRIGGER {^<inform> (%w)} {
#GAG
#additem player {%1}
}
#TRIGGER {-=-=-| USERS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} {#T+ user}
#CLASS 0
#CLASS {update|user}
#TRIGGER {^(&18)(&18)(&18)(&18)} {
#additem player {%1}
#additem player {%2}
#additem player {%3}
#additem player {%4}
}
#TRIGGER {^(&18)(&18)(&18)} {
#additem player {%1}
#additem player {%2}
#additem player {%3}
}
#TRIGGER {^(&18)(&18)} {
#additem player {%1}
#additem player {%2}
}
#TRIGGER {^(&18)} {#additem player {%1}}
#TRIGGER {^%d} {#T- user}
#CLASS 0

This sets it up almost perfectly, however, I'm reading in the original trigger line as names and getting

-=-=-| USERS |-=-=
-=-=-=-=-=-=-=-=-=

as my first two strings in the list. Any way I can tell it to start at the line AFTER the initial trigger?
Reply with quote
Spectara
Newbie


Joined: 06 Nov 2005
Posts: 9

PostPosted: Sun Nov 06, 2005 11:50 pm   
 
Got it working well now. Just threw two %pop (player) in at the end. Now just gonna tinker with it so it won't mess the list up if I check the USER list again. (the two pops take names off instead of the junk).
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net