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


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Tue Jul 23, 2002 9:46 am   

To #VAR or not to #VAR...
 
Ok, cheesy title but I couldnt figure out what to title this. I have a mux that sends out lists of contacts and junk like that. Say the following is that list:

Line of Sight Contacts:
r[hv]Q AI Serengeti x:194 y:180 z: 2 r:93.9 b:125 s: 0.0 h:252 S: DFS
r[SQ]B PS Phoenix H x:207 y:148 z: 2 r:90.6 b:103 s: 0.0 h:300 S: DFS
End Contact List

Now, my delema is simple. I get that and I have a trigger that saves all the information in each individual variable, like CONhv has in it [hv] AI Serengeti 194,80,2 s:0.0 h:252 S: DFS

Get it so far? Now I also have a variable called CONS. Its lists all the IDs of the contacts. The id is located in the []'s. Now. What I want to do is every time the list refreshes I want to refresh the CONhv variables. It does that now, but it also spamms the CONS variable with multipls hv|hv|hv and so on. Is there a way to check to see if a singe id is in the list and if it is dont add it? Heres an easy example. Say you have the numbers 5 6 8 9 in the variable as a list. Then you get the number 9 again. You dont want to add it cause its already there, but if you get a 3 you want it cause its not. Get it?
Also, I want to know if there is a way to remove all variables in a folder without haveing to open up the settings and deleting it manually. Like when I erase my cons I want to get rid of all the CONvh and CON* variables.


Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jul 23, 2002 11:58 am   
 
Sicne I didn't understand much your real example, I'm going to go with the simpler one (the 5|6|8|9 list.) If you want to add something to this list but not add it if it is a duplicate, you use #ADDITEM. Example:
#VAR test {5|6|8|9}
#ADDITEM test {9}
#ADDITEM test {3}

will result in having a list of 5|6|8|9|3

To delete all settings (including buttons, triggers, variables, etc.) inside a specific class folder, you can use #DELCLASS. This will also delete the class folder, but you can create it again with the #CLASS command.

Kjata
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