TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Can't escape curly braces

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
reality3k



Joined: 11 Feb 2009
Posts: 48

PostPosted: Thu Jun 28, 2012 10:48 am    Post subject: Can't escape curly braces Reply with quote

#var {test} {\{}
#Unmatched braces error!
Back to top
View user's profile Send private message
reality3k



Joined: 11 Feb 2009
Posts: 48

PostPosted: Thu Jun 28, 2012 11:04 am    Post subject: Reply with quote

I'm getting similar and more annoying issues with #regexp. Matching things like \{%d\}.

Any chance we could just throw away the lazy match stuff and replace it entirely with PCRE? Smile The way it is now seems sort of a duct tape solution.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Jun 28, 2012 1:23 pm    Post subject: Reply with quote

From #help escape:

\x7B will send the '{' character.
\x7D will send the '}' character.

If I throw out the pre-parser you get a whole new set of annoyances.
Back to top
View user's profile Send private message Send e-mail
reality3k



Joined: 11 Feb 2009
Posts: 48

PostPosted: Thu Jun 28, 2012 1:42 pm    Post subject: Reply with quote

I'd tried the hex sequences earlier with no luck. It works for #var, but #regexp is still not taking it:

Code:
#var {test} {\x7B5\x7D}
#regexp $test {\x7B%d\x7D} {#showme {caught}} {#showme {not caught}}
not caught


To explain the context, I'm trying to catch "Aegis Assembler Model 68-AS attacking you! {5}." and pull out the number in the braces. In the action body, I'm using #regexp to pull the number from %0, basically.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Fri Jun 29, 2012 3:49 pm    Post subject: Reply with quote

The following should work:

#act {%1 attacking you! \{%2\}.}

Might have to use: #line substitute escapes #var {test} {\x7B5\x7D}
Back to top
View user's profile Send private message Send e-mail
reality3k



Joined: 11 Feb 2009
Posts: 48

PostPosted: Sun Jul 01, 2012 5:46 pm    Post subject: Reply with quote

Yeah, that works in #action. #regexp seems to ignore it. Try that exact same pattern in #regexp and it refuses to match for me.

The reason for using #regexp is that the \{%d\} part from the mud output only occurs if there are multiples of a mob. I imagine making two triggers might work although it's inelegant, and besides I love #regexp.
Back to top
View user's profile Send private message
balthus



Joined: 07 Jul 2009
Posts: 39

PostPosted: Sun Jan 20, 2013 6:36 pm    Post subject: Reply with quote

Try this:

Code:
#ACTION {*(?: \{(\d+)\}|)$}


One action matches:

Code:
Big Monster


and

Code:
Big Monster {3}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group