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
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Sat May 24, 2003 11:14 pm   

Store values in a data record and print to window?
 
I want to store two values in a data record set. Only problem is that I have never worked with datar ecords in zmud, so as a temporary solution I stored the values in a LIST {list_enemies_whereabout}

So, the first question is: How do I write a trigger to store value %1 and %2 in a data record set and sort it after %1?

Next question is: How do I write a trigger to print all the values from the data recordset to an open (stacked) window (called "enemies")?

Any help as always much appreciated!

This what I've got so far (Trigger value):

#IF (%ismember( %2, @list_enemy_pk)) {
#ADDITEM list_enemies_whereabout {%2, %1}
} {}
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun May 25, 2003 1:04 pm   
 
What are you trying to do? I don't understand. What are %1 and %2 supposed to contain? How do you want to access and use this information?

Record variables are not just a simple substitution or an extension for lists. Record variables associate a set of keys with a set of values. Each record variable logically composes one entity. Lists, on the other hand store separate entities. Thus, if you want to store a set of entities, each which contains more than one value, you would use a list of records. There are other ways to do it, depending on how you want to store and retrieve the data, but this is the one that is easiest to visualize, although it is not normally the one that is easiest to extract data from.

Kjata
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Sun May 25, 2003 11:12 pm   
 
This is what I'm doing.

From a "who" list I receive every player online. From that list I extract two values, NAMES and PLAYER LOCATION, conditional that the NAME is a member of my "list_enenmy_pk" list.

NAME is %2
PLAYER LOCATION is %1

I want to store these (names with location) in a record set (or small database, whatever is easiest), like this:

NAME, PLAYER LOCATION
Enbringer, City Town
Diablo, Keep
Messiah, Rune
Darkstar, Rune


etc...

Notice that this list is only temporary and will be cleared each time before I run the trigger (after all, players move around to different locations all the time).

Now, after I have the names and location in a record set (or other kind of database) I want a second trigger to "print" all the values from the record set to an open window (called "enemy"), and if possible, sort the values in the window after "player location" and then "name".

I have previously worked with "variable list" but not database or record set... which I guess is what I need this time because I need to sort the list after the second value... (player location).

Please let me know what you think!
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