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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Feb 09, 2007 5:10 am   

Any suggestions on this script?
 
I've set up a script in CMUD to toggle my channels off and on. Since this isn't a MUD feature, I added it into my own. Now the problem is, I can't use the semi-colon when I'm using channel lines. For instance, if I type 'ft It's you again! ;)', it'll return 'You tell your friends 'It's you again!'' then tries to do the command ')'. I know -what- the problem is, and I can correct it by putting the escape character (`) in front of whatever I'm typing. However, I'd love to just be able to type 'It's you again! ;)' and have it displayed correctly. Any way I can go about doing this? Thanks! The code is listed as below.

Code:
#CLASS {Channels|Triggers}
#TR {Turning ON the %1 channel.} {#VAR %1 {1} _nodef {Channels|Variables}}
#TR {Turning OFF the %1 channel.} {#VAR %1 {0} _nodef {Channels|Variables}}
#CLASS 0
#CLASS {Channels|Aliases}
#ALIAS {advice} {#IF @advice=0 {#IF %0=on {~advice} {#SAY Advice is currently %ansi(high, red)OFF.}} {#SAY Advice is currently %ansi(green)ON.}}
#ALIAS {ans} {#IF @answer=0 {#IF %0=on {~answer} {#SAY Answer is currently %ansi(high, red)OFF.}} {~ans %0}}
#ALIAS {auction} {#IF @auction=0 {#IF %0=on {~auction} {#SAY Auction is currently %ansi(high, red)OFF.}} {~auction %0}}
#ALIAS {barter} {#IF @barter=0 {#IF %0=on {~barter} {#SAY Barter is currently %ansi(high, red)OFF.}} {~barter %0}}
#ALIAS {curse} {#IF @curse=0 {#IF %0=on {~curse} {#SAY Curse is currently %ansi(high, red)OFF.}} {~curse %0}}
#ALIAS {debate} {#IF @debate=0 {#IF %0=on {~debate} {#SAY Debate is currently %ansi(high, red)OFF.}} {~debate %0}}
#ALIAS {ft} {#IF @ftalk=0 {#IF %0=on {~ftalk} {#SAY Ftalk is currently %ansi(high, red)OFF.}} {~ft %0}}
#ALIAS {gamet} {#IF @gametalk=0 {#IF %0=on {~gametalk} {#SAY Gametalk is currently %ansi(high, red)OFF.}} {gametalk %0}}
#ALIAS {gossip} {#IF @gossip=0 {#IF %0=on {~gossip} {#SAY Gossip is currently %ansi(high, red)OFF.}} {~gossip %0}}
#ALIAS {gratz} {#IF @gratz=0 {#IF %0=on {~gratz} {#SAY Gratz is currently %ansi(high, red)OFF.}} {~gratz %0}}
#ALIAS {gt} {#IF @gtell=0 {#IF %0=on {~gtell} {#SAY Gtell is currently %ansi(high, red)OFF.}} {~gt %0}}
#ALIAS {helpe} {#IF @helper=0 {#IF %0=on {~helper} {#SAY Helper is currently %ansi(high, red)OFF.}} {~helper %0}}
#ALIAS {imm} {#IF @immtalk=0 {#IF %0=on {~immtalk} {#SAY Immtalk is currently %ansi(high, red)OFF.}} {~immtalk %0}}
#ALIAS {lasertag} {#IF @lasertag=0 {#IF %0=on {~lasertag} {#SAY Lasertag is currently %ansi(high, red)OFF.}} {#SAY Lasertag is currently %ansi(green)ON.}}
#ALIAS {music} {#IF @music=0 {#IF %0=on {~music} {#SAY Music is currently %ansi(high, red)OFF.}} {~music %0}}
#ALIAS {newbie} {#IF @newbie=0 {#IF %0=on {~newbie} {#SAY Newbie is currently %ansi(high, red)OFF.}} {~newbie %0}}
#ALIAS {noble} {#IF @nobletalk=0 {#IF %0=on {~nobletalk} {#SAY Nobletalk is currently %ansi(high, red)OFF.}} {~nobletalk %0}}
#ALIAS {pokerinfo} {#IF @pokerinfo=0 {#IF %0=on {~pokerinfo} {#SAY Pokerinfo is currently %ansi(high, red)OFF.}} {~pokerinfo %0}}
#ALIAS {question} {#IF @question=0 {#IF %0=on {~question} {#SAY Question is currently %ansi(high, red)OFF.}} {~question %0}}
#ALIAS {quote} {#IF @quote=0 {#IF %0=on {~quote} {#SAY Quote is currently %ansi(high, red)OFF.}} {~quote %0}}
#ALIAS {racet} {#IF @racetalk=0 {#IF %0=on {~racetalk} {#SAY Racetalk is currently %ansi(high, red)OFF.}} {~racetalk %0}}
#ALIAS {rauction} {#IF @rauction=0 {#IF %0=on {~rauction} {#SAY Rauction is currently %ansi(high, red)OFF.}} {~rauction %0}}
#ALIAS {rp} {#IF @rp=0 {#IF %0=on {~rp} {#SAY Rp is currently %ansi(high, red)OFF.}} {~rp %0}}
#ALIAS {tech} {#IF @tech=0 {#IF %0=on {~tech} {#SAY Tech is currently %ansi(high, red)OFF.}} {~tech %0}}
#ALIAS {telep} {#IF @telepathy=0 {#IF %0=on {~telepathy} {#SAY Telepathy is currently %ansi(high, red)OFF.}} {~telepathy %0}}
#ALIAS {wang} {#IF @wangrp=0 {#IF %0=on {~wangrp} {#SAY Wangrp is currently %ansi(high, red)OFF.}} {~wangrp %0}}
#CLASS 0


Charneus
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Feb 09, 2007 6:27 am   
 
The command line should actually be picking up on the fact that you don't want a new command - the fact that it's not is a bug. I believe it was reported a while ago, so either it's on the list or it's not as fixed as was thought. There's nothing you can add to the alias to fix it because the splitting happens before the alias is even executed - the only way is to "" quote whatever you want to say or to ~ quote the special character..

There are a couple of general things about these scripts, though - %1 isn't a proper wildcard in the triggers, for example. I also think you're intending to use %-1 rather than %0; I remember someone had a problem with %0 a while ago and it wasn't working how they expected - the solution was to use %-1 instead.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Feb 09, 2007 6:58 am   
 
Ah. I figured it was a bug, but didn't know if I was doing something wrong on my side. To be honest, I also had the %-1 in the aliases. I changed it to %0 because I figured that it would realize at that time I'm not trying to do a second command. Hopefully this does get fixed, though. It's annoying having to use either the ~ character, or using the ` at the beginning of each line. Hmmm... come to think of it, I think I may have found a way to fix it. I wonder if I put '~`ft ' when it executes the alias. I'm gonna try that out. Thanks, Fang. I knew you'd come through. ;)

Charneus

EDIT: Meh. Even ~`ft didn't work. Oh well.
Reply with quote
hogarius
Adept


Joined: 29 Jan 2003
Posts: 221
Location: islands.genesismuds.org

PostPosted: Fri Feb 09, 2007 11:26 am   
 
You could disable the ";" special separator character...

Preferences > Scripting > Special Characters
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Feb 09, 2007 7:22 pm   
 
Just a couple of CMUD style notes... I'd recommend not using %1..%99 in trigger patterns, and using %params instead of %0 to capture all arguments passed to your aliases. You should also put parentheses around expressions, such as those in your #IF commands.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Feb 09, 2007 10:18 pm   
 
You are doing this via the commandline? Just change the special character in Preferences so that ; is no longer interfering with your input. The special characters Preferences are only used and applied to the command line, with all scripts being forced to use the default characters.

Thus, on the command line you can do:

question`pokerinfo`music

but within an alias or some other setting that same sequence would be:

question;pokerinfo;music
_________________
EDIT: I didn't like my old signature
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Feb 09, 2007 10:34 pm   
 
Doesn't the ` apply to an entire line of input and not just per command? So, you should be able to `say hello ;) and not have to escape the ; in your say, for example.

The problem isn't trying to execute three commands without calling aliases. It's trying to use special characters as smileys, which I think is still broken in CMUD. I was actually (pleasantly) surprised to learn (a long time ago, mind you) that the smileys worked in zMUD without problems.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Feb 09, 2007 10:44 pm   
 
Yes, ` does apply to the whole line, but doing that defies the point. If he were to type

`rp Hello!

then it wouldn't run the alias.
_________________
Rorso's syntax colouriser.

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


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Feb 10, 2007 1:15 am   
 
Disabling the ';' in Preferences had crossed my mind. However, that's not an route I want to go for the reason that I'm rather comfortable using the ';' as a separator. And Fang -

`rp Hello!

does work. It just doesn't run the alias, like you said. It escapes it back to the default command on the MUD side. Oh well. I'm making due with putting the quote before the ';' for now.

I will take a look at the %params, though. Thanks for the idea, Larkin. And thanks, Matt, for the suggestion. :)

Charneus
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