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


Joined: 17 Oct 2008
Posts: 11

PostPosted: Sun Nov 09, 2008 7:04 pm   

Searching for an easier solution
 
I've made a alias for a mud that replaces the say command. The following code is

Code:

temp1 = %1+" "+%2+" "+%3+" "+%4+" "+%5+" "+%6+" "+%7+" "+%8+" "+%9+" "+%10+" "+%11+" "+%12+" "+%13+" "+%14+" "+%15+" "+%16+" "+%17+" "+%18+" "+%19+" "+%20+" "+%21+" "+%22+" "+%23+" "+%24+" "+%25+" "+%26+" "+%27+" "+%28+" "+%29+" "+%30+" "+%31+" "+%32+" "+%33+" "+%34+" "+%35+" "+%36+" "+%37+" "+%38+" "+%39+" "+%40+" "+%41+" "+%42+" "+%43+" "+%44+" "+%45+" "+%46+" "+%47+" "+%48+" "+%49+" "+%50
#send "say (Quietly) "@temp1
temp1=""


Im curious if there is an easier solution for the first line
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Sun Nov 09, 2008 7:25 pm   
 
What exactly are you trying to get it to do?
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Nov 09, 2008 7:29 pm   
 
Try using %-n, which contains the nth parameter and every parameter after it. So you could do something like:

#alias say {say ~(Quietly~) %-1}

Also, I'd like to commiserate in advance with you on your typing that mass of text out :(
_________________
Rorso's syntax colouriser.

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


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Nov 09, 2008 7:33 pm   
 
I'm still finding a problem where using %-1 or whatever will cut out text after a certain point for no reason.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sun Nov 09, 2008 9:52 pm   
 
does your mud wrap text? I think that %-1 doesn't work if there is a carriage return in the text the mud sends. I know IRE allowed people to go around this but not if others have a way to.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Nov 09, 2008 10:58 pm   
 
This isn't a trigger, though, it's an alias, so that restriction doesn't apply.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Ethershade
Beginner


Joined: 17 Oct 2008
Posts: 11

PostPosted: Sun Nov 09, 2008 11:13 pm   thanks
 
thank you, it works perfectly
Reply with quote
Mandelbrot
Newbie


Joined: 19 Oct 2008
Posts: 8

PostPosted: Tue Nov 11, 2008 7:37 pm   
 
If you want a simpler way, I believe this would do the exact same thing as all that:

Code:
#send "say (Quietly) " %1
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Tue Nov 11, 2008 7:43 pm   
 
Except it won't, it would only take the first word. You would STILL have to use %-1
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Nov 11, 2008 7:45 pm   
 
No, it wouldn't - you'd need to use %-1 to get all the parameters. Otherwise, that'd only append the first parameter, which in most cases is the first word of your say and thus not what you're after. Also, it'd have an extra space in it between the closing bracket of "Quietly)" and the start of the parameter.

Also, beaten :(
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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