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: Tue Jul 15, 2008 1:11 pm   

More than one line in send?
 
Is sending more than one line in Send possible?

Here's what I have:
Code:

#10 #send {get 5 'white stone' green;put 5 'white stone' vault}


As you can see, I have two lines I want sent, divided by a ;. However, as a result of the command, the semicolon isn't parsed and is just sent to the MUD. If I try doing...

Code:

#10 #send {get 5 'white stone' green
put 5 'white stone' vault}


I get an unmatched bracer error. I need a little help here. Sad

Edit:

Also, just in case you really want to help....

Code:

#trigger fifty {@warp>=50} {#IF (vault) {w;s;s;s;w;w;w;w;s;e;e;n;w;#wait 6000;#10 #send {get 5 'white stone' green;put 5 'white stone' vault};warp=0;#wait 6000;e;s;w;w;n;e;e;e;e;n;n;n;e;#wait 6000;get 'jewel stopper' green;c 'enchant gem' jewel stopper} {w;w;#10 #send {get 5 'white stone' green;put 5 'white stone' box};#wait 6000;e;e;get 'jewel stopper' green;c 'enchant gem' jewel stopper} } {General Triggers|Warpstones} {exp}


Doesn't fire properly when the variable hits 50, and suffers from the same problems with the send command.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Nicodareus
Wanderer


Joined: 24 Jun 2008
Posts: 68
Location: Texas

PostPosted: Tue Jul 15, 2008 3:03 pm   
 
Using #exec instead of #send makes the first work for me...

Code:

#10 {
    #exec {
       get 5 'white stone' green;put 5 'white stone' vault
    }
}

OR if you don't like my method of spacing...

#10 #exec {get 5 'white stone' green;put 5 'white stone' vault}

Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Jul 15, 2008 3:15 pm   
 
Thanks, I think that will work. I can make a separate thread about the expression trigger, which seems to want to fire when I copy and paste it in, and then doesnt after that.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Jul 15, 2008 3:38 pm   
 
Just do two sends.

#send {get 5 'white stone' green}
#send {put 5 'white stone' vault}

#exec works slightly differently to #send, but will probably be fine for this, too.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Jul 15, 2008 5:10 pm   
 
I figured out the trigger problem too
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jul 15, 2008 5:14 pm   
 
The %crlf can also be used to send a newline to the MUD. So:

#send {get 5 'white stone' green%{crlf}put 5 'white stone' vault}

would work. But it's more readable code to just split it into two #send statements as Fang suggested. Using #EXEC is a lot slower because then CMUD is going to compile your text as a script, which might also cause problems if you ever had other special characters in the text.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Jul 15, 2008 5:55 pm   
 
Oh...

so...

#10 {#send { }
#send { } }
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jul 15, 2008 6:23 pm   
 
or just:

#10 {#send { };#send { }}
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Jul 15, 2008 6:53 pm   
 
Will that send them interchangeable or the first send 10 times and then the second one 10 times?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jul 15, 2008 8:25 pm   
 
The #10 executes whatever is in {} 10 times. So it's going to do exactly what you want and send them "interchangeable"
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Jul 15, 2008 9:10 pm   
 
yea, interchangeable wasn't the best word. I have a headache. I meant that it would send one, then the other, then the first one again, then the other. Alternating between the two... there we go, alternating is the word I was looking for.
_________________
Listen to my Guitar - If you like it, listen to more
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