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
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Wed Aug 16, 2006 2:34 pm   

^{ |}{^A white rabbit}(*) is now here.
 
What is the problem with this syntadx I can't figure it out

I want to capture stuff like the highlighted bits from the below example lines (no, not just wizard, that's why I did the exclude for rabbit, or tried to anyway):

A fat wizard is now here.
A fat wizard is now here. [with a space at the start of the line]
WITHOUT capturing the below example lines
A white rabbit is now here.
A white rabbit is now here.[with a space at the start of the line]

Soooo, how do I make it still capture the name? At the moment it just ignores the excluder bit in curly brackets entirely, I don't know why
_________________
mhm..
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Aug 16, 2006 3:07 pm   
 
^ means the literal start of the line.
with the way you have it might be thinking that the 2nd ^ is IN the trigger
The (*) wont help either

^{ |}{A white rabbit} is now here.

or

^{ A white rabbit|A white rabbit} is now here.

I think either will work. Don't have zmud at work anymore so can't test.
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Aug 16, 2006 3:13 pm   
 
Here, luckily i'd brought over my exported mud file to print out.
Looked thru it and found this part:

#TRIGGER "globalquestended" {^Global Quest: The global quest has {been won by |expired~. There is no winner~.}} {


SOOOO

#trigger {^{ A white rabbit|A white rabbit} is now here.}

I think that should work, tho i dont see any reason why this shouldnt work either.

#trigger {^{ |}{A white rabbit} is now here.}
_________________
http://www.Aardwolf.com
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Aug 16, 2006 5:21 pm   
 
exclusions require [] square brackets and a carrot^ so it would be [^a white rabbit]
_________________
Discord: Shalimarwildcat
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Aug 16, 2006 7:40 pm   
 
crud, now that I actually READ the post I see what the question is.

#trigger {^{(%*)| (%*)} is now here.} {#var mobcap "%1"}

that should be it.
For some reason I thought u were looking to trigger on a specific mob.
_________________
http://www.Aardwolf.com
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Aug 16, 2006 11:52 pm   
 
I would actually say that this can't really be done with the zScript pattern syntax and would be extremely hard even in a direct regex pattern. I think the way it would have to be done is matching a list within a list something along the lines of:
zScript: ^{ |}({{^A white rabbit|A blue rabbit}|*}) is now here.$
REGEX: ^(?: |)(?=(?!A white rabbit|A blue rabbit)|.*) is now here.$

I think it would just be simpler to use the open match then just #IF in the code for the trigger:
#TRIGGER {^{ |}(*)is now here.$} {#IF (!%match("%1","{A white rabbit|A blue rabbit}")) {Do something}}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Aug 17, 2006 3:37 am   
 
If I'm not mistaken, lists within lists are not possible. That wouldn't make sense though since we DO have nested list capabilities, so it was probably just a trigger/pattern issue I didn't feel like dealing with at the time.
_________________
EDIT: I didn't like my old signature
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Sun Aug 20, 2006 7:06 am   
 
erm ok I'm confused :(

what do you all recommend I do then for it to work?
_________________
mhm..
Reply with quote
Xolademoness
Wanderer


Joined: 18 Jun 2004
Posts: 73
Location: United Kingdom

PostPosted: Wed Aug 23, 2006 7:50 pm   
 
bump
_________________
mhm..
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