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


Joined: 27 Jun 2012
Posts: 17

PostPosted: Fri Aug 24, 2012 1:26 pm   

Wildcard trigger patterns.
 
Alright, I've got one prompt that can be four multiple ways. Below are examples

"grid57467" the empathic grid 100% / no damage [Rastamutti]
"grid57467" the empathic grid 100% / no damage
"grid57467" the empathic grid 100% / no damage [Rastamutti] PARASITE!
"grid57467" the empathic grid 100% / no damage PARASITE!

So far, I've got this for parsing the data:
Code:
~"(%w)(%d)~"%s(*)%s(%d)~%%s/%s(*)%s{~[(%w)~]|}{(%w)~!|}


for my checks, I'd like to make it go,
Code:
#if (!%null( %6)) {#say Parasite on %6 %1%2} {#say Parasite on empty %1%2}

Problem being, I can't use %null. what should I be trying to use?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Aug 24, 2012 6:56 pm   
 
You can just use:
Code:
#IF (%6) {

A variable or other parameter will evaluate as FALSE if it is zero or null.
Reply with quote
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: Sun Aug 26, 2012 4:32 am   
 
~"(%w)(%d)~"%s(*)%s(%d)~%%s/%s(*)%s{~[(%w)~]|}{(%w)~!|}

That forward slash needs to be ~/ and I assume you have it set to trigger on prompt.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 26, 2012 3:42 pm   
 
You don't need to quote slashes, they're not special characters. It won't hurt, but it doesn't matter if you leave it out (same with the exclamation point at the end).
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