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
MadBomber
Beginner


Joined: 17 Oct 2002
Posts: 26
Location: USA

PostPosted: Mon Nov 04, 2002 9:59 am   

How to put this line into a db
 
I get the following when I identify a sroll or wand:
Item: 'papers treatise pact'

Weight: 2 Typical cost: 3244 Level: 20 (very uncommon)
Type: SCROLL Composition: NONE
Wear locations are: HELD
Item has level 25 spells of:
peace
This is the part that I need to capture into my 'spell_affects' field:
Item has level 25 spells of:

peace
More or less just where it says 'peace', but I figure the previous line is what would trigger that, not sure... I can get all the rest just fine. Any ideas?

Thanks,
MadBomber
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Nov 04, 2002 1:22 pm   
 
Do the spells appear all in one line after the other line or do they each appear on its own line? If the former is true, then this pattern should work:
^Item has level %d spells of:$(*)$

Kjata
Reply with quote
MadBomber
Beginner


Joined: 17 Oct 2002
Posts: 26
Location: USA

PostPosted: Wed Nov 06, 2002 3:28 am   
 
Well, I have an item such as this that has every spell on a line following the last:
Item: 'potion travel teleport tele port'

Weight: 3 Typical cost: 15165
Object is:
Type: POTION Composition: WET_ORGANIC
Item has level 25 spells of:
teleport
teleport
teleport
teleport
teleport
Is there a way to capture all of those? And it's not always the same spell listed, sometimes it might be 2 teleports and a 3 strength in a potion, for example.

Thanks,
MadBomber

--------------------
Currently Using zMUD 6.36Beta
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Nov 06, 2002 3:40 am   
 
Start capturing when you see the line "Item has level..." and stop capturing when you see a blank line.

Kjata
Reply with quote
MadBomber
Beginner


Joined: 17 Oct 2002
Posts: 26
Location: USA

PostPosted: Wed Nov 06, 2002 6:03 am   
 
Is a blank line considered '%null'? Cause I've made the following two triggers that I thought *should* capture this information from my id:
Item: 'potion travel teleport tele port'

Weight: 3 Typical cost: 15165
Object is:
Type: POTION Composition: WET_ORGANIC
Item has level 25 spells of:
teleport
teleport
teleport
teleport
teleport
until a blank line, where it would write the record, though it's not doing anything for me:
#TRIGGER {^Item has level %d spells of:$} {#T+ ih_temp}

#TRIGGER "ih_temp" {^(*)$} {#IF (%1=%null) {#NEW All @eq;#VAR DBItemName %null;#T- ih_temp} {@eq.spell_affects=%if( @eq.spell_affects=%null, %1, @eq.spell_affects -- %1)}}
If a blank line would be '%null', I don't see why this wouldn't work...hmm. Any more ideas or know what I did wrong?

Thanks,
MadBomber

--------------------
Currently Using zMUD 6.37aBeta
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Nov 06, 2002 6:24 am   
 
Technically, a blank line isn't a null line, but since ZMud uses the carriage return strictly as an unchangeable boundary between lines there's nothing left for ZMud to process.

This means that even the %* and * wildcards will not have anything to match them, which is why your trigger isn't working.

A blank line can be matched with a pattern of ^$ ($ works by itself, but I don't know if it only matches blank lines or just matches the end of a non-prompt line).

li'l shmoe of Dragon's Gate MUD
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