|
LordFett213 Novice
Joined: 20 Aug 2008 Posts: 34
|
Posted: 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} |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
LordFett213 Novice
Joined: 20 Aug 2008 Posts: 34
|
Posted: 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.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
|
|