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 Goto page Previous  1, 2
chamenas Posted: Mon May 12, 2008 12:17 am
Alright, running through a string... couple of purposes
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun May 18, 2008 6:01 pm   
 
Doh! Yeah, sorry. And swears are bad for you. Shocked
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun May 18, 2008 6:12 pm   
 
So I fixed it, still a couple issues though.

Here it is, fixed:
Code:

#REGEX sleep {^You go to sleep(?: (?:on|in) a )?(.*)?\.$} {posn=sleep
bed={%replace(%1," ","|")}
#FORALL @commons {#DELI @bed %i} } {General Triggers}



You go to sleep on a sleeping pad.

Bed: sleeping|pad

Code:

#TRIGGER thirsty {^You are thirsty.$}
{
 #IF (@posn="wake")
  {
   #5 {#send "drink decan"}
  } {
   #send rest
   #5 {#send "drink decan"}
   #send {sleep %replace(@bed,"|"," ")}
  }
} {General Triggers}


Is just one think I'm trying to use it on, there will be others.

But that last line sends:
sleep sleeping pad

That should work right? Nope, my MUD requires quotes around a multiple word argument. But whenever I put quotes around the replace function, or I escape quotes, it does not come out with "sleeping pad"
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon May 19, 2008 2:34 pm   
 
bump, this must have a simple solution that I'm just missing...
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon May 19, 2008 4:39 pm   
 
Why not try?

#send {sleep ~"%replace(@bed,"|"," ")~"}

And no I'm not reading the billion threads, or this whole one.
Just got bored for a moment and saw the bump.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon May 19, 2008 4:46 pm   
 
When I tried that it sent

sleep " "

I thought I mentioned it, maybe I didn't. I can try it again when I get out of work.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon May 19, 2008 6:47 pm   
 
This doesn't seem quite like proper syntax to me, but it worked when I tested it.
Code:
sleep %concat(~", %replace(@bed,"|"," "), ~")
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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