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


Joined: 20 Aug 2008
Posts: 34

PostPosted: Fri Oct 09, 2009 8:02 pm   

How to create a list and advance to the next item on the list?
 
I believe you make a list using #var list {item1|item2|item3|item4}.

The mud i play on (toril) you can not do anything while scribing a new spell into your spellbook. I want to make a trigger that I can load all of the spells I want to scribe into my list and when it completes scribing it moves to the next item on the list.

#t {You finish scribing spell * to a gold leaf spellbook.} {scribe @list}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Oct 10, 2009 3:01 am   
 
#delnitem list 1
scribe %item(@list,1)

That's one way to do it. %pop() or %push() is another way.
_________________
EDIT: I didn't like my old signature
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 10, 2009 3:49 am   
 
If you're not wanting to delete any item, then you'll have to deal with a counter, which is easy enough to do.

#ALIAS scribeall {#VAR itemcount 1;scribe %item(@list,@itemcount)}
#TRIGGER {You finish scribing spell * to a gold leaf spellbook.} {#IF (@itemcount!=%numitems(@list)) {#ADD itemcount 1;scribe %item(@list,@itemcount)} {#SAY Finished scribing spells!}}

Charneus
Reply with quote
LordFett213
Novice


Joined: 20 Aug 2008
Posts: 34

PostPosted: Fri Oct 16, 2009 6:04 am   
 
Thanks Carneus, working great! Many back up copies of my spell books. Now I just need to get it to remove the book when full and hold another one that has no spells in it.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Oct 16, 2009 9:25 am   
 
That part is easy enough. Just add the 'remove book;wear 2.book' or whatever the command would be to wear an empty book to the 'Finished scribing spells!' bit. It'd look like this, of course: Finished scribing spells!;remove book;wear 2.book.

Glad it's working great for you! :)

Charneus
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