|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Sep 11, 2005 12:57 am
Creating multiple variables... |
Below is a copy of what our users list looks like. Now what I want to do is be able to capture all the names there and store them into their own separate variables. Then I need to make an alias that will allow me to execute a command per person online (such as "scry <name>"). However, I'm not positive that this can be done. Any suggestions would be appreciated. Thank you.
Charneus
Code: |
-=-=-| USERS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Almighty Apolla Aquila Arien
Astoria Azmect Beeg CAB
Cairtan Charneus Cloud Strife Commando
Czechtog Damogran Ease Emulous
Entry Ephrisian Fernao Gohanssb
Insomnia Jagermister Jangles Jedi
Kittykat Link Meneloth Moonray
Neochi Porphyria Pravus Prin
Ripper Sakura Kamakazi Seras Sevore
Shamo Stealth Suffer Suncatcher
Sweetie Tarina Tryage Wai
44 players currently in Merentha |
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Sep 11, 2005 10:42 am |
Code: |
#CLASS PlayerData
#VAR UOnline {} {}
#TR "OLCapture" {^-=-=-| USERS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-$} {UOnline=""}
#COND {} {#IF (%match(%line,"%d players currently in Merentha")=0) {#ADDITEM UOnline {%line}} {#STATE OLCapture 3;#SET OLCapture 3 1} {looplines|param=99}
#COND {*} {#ECHO Error in OLCapture! Exceeded line limit without detecting end.;#STAT OLCapture 0}
#COND {} {UOnline=%replace(@UOnline," ","|");#DELITEM UOnline {};#ECHO Online capture complete, beginning scry.}
#CLASS 0 |
That is off the top of my head for capturing all the names. I would suggest that the scry output should be used to create the player specific variables. One problem I noticed in your list is a player seems to have 2 words in thier name.
Code: |
Ripper Sakura Kamakazi Seras Sevore |
This will not be picked up properly in the list that is created. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Sep 11, 2005 3:31 pm |
This didn't seem to capture anything at all. However, I've thought of a new way to do this, and it would probably be a lot easier to devise rather than go off the "Users" list. Here is what I am going to base it off now.
We have an "inform" command that I just set up to be captured and logged with a time stamp. I can use that "inform" to add users or remove users as the case may be. Here's the input:
To add a player to the list:
Code: |
<inform> Player1 has entered Merentha.
or
<inform> Player2 is no longer link-dead. |
To remove a player from the list:
Code: |
<inform> Player3 just went link-dead.
or
<inform> Player4 has left Merentha. |
Basing it off that, I know I could use wildcard characters so I can get the name, such as "Sakura Kamakazi" or "Eli'Andre." I'm not a total newbie to this, but there are still things that I need to learn. I think that I'd have to store them into a database or something first, then when I want to issue a command to the entire MUD, I'd have to call that database. I'm going to wind up putting that in an alias:
Code: |
#ALIAS mass {%1 @userlist} |
But then, I'm not sure how that would work, either. The %1 would have to go to each name itself, otherwise, it wouldn't fire properly.
Then, there's another stipulation, but I think that can be solved...
Code: |
#IF ((@player = ADMIN1) OR (@player = ADMIN2) OR (@player = ADMIN3)) {} {<command to add player to database>} |
The reason is because I don't want to send the command to an Admin. As you can see, this is a highly complicated script, and any help on it would be appreciated. This is something I've never done before, and each time I get a response, I'm closer to fully understanding zMUD. Thanks again for the help. :)
Charneus |
|
|
|
|
|
|
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
|
|