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
Churlant
Novice


Joined: 17 Oct 2002
Posts: 44
Location: USA

PostPosted: Mon Nov 25, 2002 9:24 pm   

List into Variables
 
This may sound a bit extreme.. but I'm trying to figure out a way to set a list of say 70-100 names into individual variables. After getting the list with a >who command, I would want to enter each name into a variable starting with @player_1 etc until @player_100.. or something to that effect so I can check a piece of info specific to each name automatically. If possible I would want the variables to recycle each time so that @player_1 might change depending on who is on at the time and when I do a >who command.

So something approximating:
>who

>Joe
>Bob
>Jessica
>Karl
>4 out of 4 Players

#VAR player_1 Joe
#VAR player_2 Bob

etc until it gets to the end of the list

>-Churlant-<
Reply with quote
Churlant
Novice


Joined: 17 Oct 2002
Posts: 44
Location: USA

PostPosted: Mon Nov 25, 2002 10:19 pm   
 
I forgot the second part.. I also wanted to perform an action on each variable in turn.. such as

>finger @player_1
>finger @player_2

Until specific info was obtained, then hault the process. So if @player_3 was last logged in on November 22, it would stop there, if not the actions would keep going until the end of the player list. Thanks :)

>-Churlant-<
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Nov 26, 2002 1:26 am   
 
#AL wholist {#VAR players {};#T+ wholist;who}
#TR "wholist" {^(%w)} {#ADDITEM players %1}
#TR (^%d of %d Players} {#T- wholist;#VAR playernumber 1;whocheck}
#T- wholist
#AL whocheck {finger %item(@players, @playernumber)}
#TR {was last logged in on (%w) (%d)} {#IF ((%1 = "November") AND (%2 = 22)) {#NOOP} {#IF (@playernumber < %numitems(@players)) {#ADD playernumber 1;whocheck}})

LightBulb
Senior Member
Reply with quote
Churlant
Novice


Joined: 17 Oct 2002
Posts: 44
Location: USA

PostPosted: Tue Nov 26, 2002 3:53 pm   
 
Thanks much :) This is very perfect


>-Churlant-<
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