Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
myrddhin123
Newbie


Joined: 05 Aug 2015
Posts: 2

PostPosted: Wed Aug 05, 2015 7:56 am   

Multiline Identify trigger
 
+--------------------------------+
| Object: a green pol'ana seed |
| Flags: magic |
| Weight: 0.5 |
| Size: small |
| Level: 20 |
| Material: plant |
| ------------------------------ |
| Type: pill |
| Spell Level: 20 |
| Spell: regeneration |
| Spell: cure serious |
+--------------------------------+

This is what I get from the mud to work with. I've successfully grabbed everything that the mud offers as far as keys except multi-line spells.

I need some sort of loop that adds each of 5 possible spells into keys Spell1, Spell2, ~ Spell5. I can capture and record the first one well enough, except that the next and last ones overwrite it in the key before I can write the @Item variable into the database. I end up with the last spell in the list as the first spell and nothing else. So I'm looking for something that checks the @Item key for a nonzero and then moves to the next key, adding in the captured spell when it comes to an empty slot.
Reply with quote
myrddhin123
Newbie


Joined: 05 Aug 2015
Posts: 2

PostPosted: Wed Aug 05, 2015 7:57 am   
 
And those |'s at the right side line up - the formatting didn't carry over well.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Aug 05, 2015 4:22 pm   
 
Sounds like you want to make it a list. Instead of overwriting the spell with "spell = %1", try "#additem spell %1". Then at the end, your spell variable will contain spell1|spell2|etc. You can then use all list functions to manipulate it as needed (#forall, %item, etc).
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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