![](templates/Classic/images/spacer.gif) |
myrddhin123 Newbie
Joined: 05 Aug 2015 Posts: 2
|
Posted: 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. |
|
|
![](templates/Classic/images/spacer.gif) |
myrddhin123 Newbie
Joined: 05 Aug 2015 Posts: 2
|
Posted: Wed Aug 05, 2015 7:57 am |
And those |'s at the right side line up - the formatting didn't carry over well.
|
|
|
![](templates/Classic/images/spacer.gif) |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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).
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|