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
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 12:36 am   

DSL quest regex
 
Quote:

The ancient elven questmaster says 'Thank you, brave Yasan!'
You have asked to find a lost item.
The ancient elven questmaster says 'Vile pilferers have stolen the King's sceptre from the royal treasury!'
The ancient elven questmaster says 'My court wizardess, with her magic mirror, has pinpointed its location.'
The ancient elven questmaster says 'Look in the general area of Dividing Tunnels for Dwarven Barracks!'
The ancient elven questmaster says 'You have 21 hours to complete this quest.'
The ancient elven questmaster says 'May the gods go with you!'


regex:
Code:

^The ancient elven questmaster says 'Thank you, brave Yasan!'\nYou have asked to find a lost item.\nThe ancient elven questmaster says 'Vile pilferers have stolen .* from the royal treasury!'\nThe ancient elven questmaster says 'My court wizardess, with her magic mirror, has pinpointed its location.'\nThe ancient elven questmaster says 'Look in the general area .*!'\nThe ancient elven questmaster says 'You have .* to complete this quest.'\nThe ancient elven questmaster says 'May the gods go with you!'$
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 1:03 am   
 
Just tried what I typed in... all the capture window caught was:

Quote:

The ancient elven questmaster says 'May the gods go with you!'
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Mar 27, 2008 1:06 am   
 
A multiline regex accrosed that many lines will seriously hamper your overall script speed. Try a multistate trigger like this instead.
Code:
#CLASS DSLQuest
#VAR QuestItem {} {}
#VAR QuestLocation {} {}
#VAR QuestArea {} {}
#VAR QuestTime {} {}
#TRIGGER "quest" {^The ancient elven questmaster says 'Thank you, brave %w!'$} {QuestItem="";QuestLocation="";QuestArea=""}
#COND {^The ancient elven questmaster says 'Vile pilferers have stolen (*) from the royal treasury!'$} {QuestItem=%1} {within|param=2}
#COND {^The ancient elven questmaster says 'Look in the general area of (*) for (*)!'$} {QuestArea=%1;QuestLocation=%2} {within|param=2}
#COND {^The ancient elven questmaster says 'You have (%d) hours to complete this quest.'$} {QuestTime=(%1*60);#T+ QuestBar status;#T+ QuestAlarm} {within|param=1}
#TRIGGER "QuestAlarm {*1} {QuestTime=(@QuestTime-1);#IF (@QuestTime=30) {#SAY HurrY!  You are almost out of time} {#IF (@QuestTime=-60) {#T-QuestAlarm;#T- QuestBar status}}} "" {alarm|disable}
#STATUS {QT: (@QuestTime/60):(@QuestTime\60) @QuestItem in @QuestLocation @QuestArea} "" {QuestBar}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 1:14 am   
 
What does %w do again? and thanks.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 1:19 am   
 
Hmm, so I entered it all in, but it isn't capturing anything. So I need to look back and see what I want to capture.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Mar 27, 2008 1:26 am   
 
Assuming I didn't make any mistakes it should be capturing all sorts of stuff to variables. Then it should display a status bar on the bottom of your screen that has all that information. If you wanted some other type of capture then perhaps it would have been intelligent to say what you wanted in your first post of the topic. I only vaguley browsed the other topic you had going where you started to mention this quest thing; and on further review, your last post there doesn't make it any clearer what you really wanted here.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 1:37 am   
 
I actually found where yours was keeping it, but I figured it would still work better in the capture window. I saved it though, to look at later. What I'm wondering now is how to make the capture triggers be disabled, only turned on when the first part occurs:

^The ancient elven questmaster says 'Thank you, brave Yasan!'$

Then it would enable the other triggers.

I could then have it disable them as a part of the returning. But I need to know how a trigger can disable and enable another one.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 1:40 am   
 
Vijilante wrote:
Assuming I didn't make any mistakes it should be capturing all sorts of stuff to variables. Then it should display a status bar on the bottom of your screen that has all that information. If you wanted some other type of capture then perhaps it would have been intelligent to say what you wanted in your first post of the topic. I only vaguley browsed the other topic you had going where you started to mention this quest thing; and on further review, your last post there doesn't make it any clearer what you really wanted here.


I believe I converted it all but haven't been able to test it. I just need to figure out how to let triggers enable/disable other ones.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Mar 27, 2008 2:16 am   
 
Pattern: ^The ancient elven questmaster says 'Thank you, brave Yasan!'$
Command: #T+ quest

I set the ID of the two capture triggers to quest.

That should work?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Mar 27, 2008 6:31 am   
 
You should read up on multi-state triggers. The other triggers don't do anything until you get that first line. You don't need to enable or disable anything. Specifically look at #CONDITION in the reference.
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