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


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: Tue Jan 14, 2003 2:14 pm   

Variables
 
I am looking for some help to tackle this variable Im using in my Mud. I use quite a few teleportation pills in my mud. These pills are labeled pillxxxxx. The x's would be a 5 digit number. The problem I have is I may hold several pills to multiple locations. I handle this problem by making several variables to the same location. For example, @guildpill1 @guildpill2 and so on. After I eat a @guildpill1 I change @guildpill2 to @guildpill1. This works but there probably is a better way to handle this. Any suggestions.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jan 14, 2003 6:20 pm   
 
Use stringlists. Assuming you will never have two pills with the same number you can put all your guildpills into @guildpill, using
#ADDITEM guildpill pill12345
#ADDI guildpill pill39821
#ADDI guildpill pill08972
etc.
Then, when its time to eat one
#AL goguild {eat %item(@guildpill, 1);#DELNITEM guildpill 1)

LightBulb
Senior Member
Reply with quote
Curtis
Novice


Joined: 25 Nov 2002
Posts: 39
Location: USA

PostPosted: Tue Jan 14, 2003 7:32 pm   
 
Thanks again Lightbulb. Works like a charm and I learned something too.
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