|
Curtis Novice
Joined: 25 Nov 2002 Posts: 39 Location: USA
|
Posted: 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.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
Curtis Novice
Joined: 25 Nov 2002 Posts: 39 Location: USA
|
Posted: Tue Jan 14, 2003 7:32 pm |
Thanks again Lightbulb. Works like a charm and I learned something too.
|
|
|
|
|
|