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
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Jan 21, 2016 7:10 pm   

Echo
 
Is there a way to turn off the echo on a case-by-case basis? I don't want to turn off global echo, just in specific triggers.
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Thu Jan 21, 2016 9:00 pm   
 
Well, I don't know of a way to specifically disable the local echo of a trigger's output, but there are ways to send output without echos.

First, if you are simply sending some command to mud, and don't need to parse or evaluate it, you can use #SENDRAW. Having a trigger like, "You are thirsty." with a value of "#Sendraw drink waterskin" will send the command "drink waterskin" to the mud without echoing to you buffer. The usefulness of that method disappears, however, if you're sending something that needs to be evaluated. If the name of your drinking container were stored in a variable, and the trigger used something like "drink @container," than that would be sent verbatim, rather than sending the value of the variable container.

No workarounds for sendraw exist that I know of. Another option would be to use oninput triggers with #gag. Doing so would allow you to gag the local echo of any input matching the pattern. The drawback there is that manually typing and sending the same commands as the trigger you're trying to quiet outputs would cause those lines to be gagged as well. as a further workaround, you could cause the original trigger to turn on (#t+) the oninput triggers that gag its output, and have those oninput triggers turn themselves off after firing once.

It would be nice, I guess, to have a trigger option you could check or uncheck, and maybe there's a simpler way than those I've listed, but I love local echo and have never wanted it gone. :)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4702
Location: Pensacola, FL, USA

PostPosted: Thu Jan 21, 2016 9:34 pm   
 
#CALL %pref(LocalEcho, 0)

Just toggle the setting as needed with the pref function
_________________
Discord: Shalimarwildcat
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Jan 21, 2016 9:55 pm   
 
Thank you Shalimar
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Jan 21, 2016 10:07 pm   
 
Okay maybe not. I'm trying to call that function, but it's not letting me. Tried using it in a trigger, and just in the command line, and it doesn't turn the local echo on or off...
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Jan 21, 2016 10:25 pm   
 
Okay so after some testing, #call %pref(clock,0) works just fine. I turned off the local echo in my preferences, and it's still echoing. That might be a problem. I'm not sure what's going on there, but I can't figure out that problem.

Any suggestions?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 22, 2016 5:32 am   
 
The best way is the #SENDRAW command. Llohr was mistaken in saying that this command will not expand or evaluate its parameters. The expansion rules are the same used for many other commands
Code:
#SENDRAW drink @container
#SENDRAW {drink @container}
#SENDRAW %concat("drink ",@container)
would all expand the variable 'container'. The only thing #SENDRAW does, that #SEND does not do, is bypass echo and input triggers. If you might need a command input trigger to act on that command then you will have to use another method.

You should be able to follow the command sent #GAG to cause it to disappear, but you might also disappear some things you don't want gone such as prompt information or other lines. Note the #GAG would be in the same code block that is originally sending the command, and if the command is acted on by an input trigger then it might be visible on the screen long enough to be noticed.

Looking at the help for %pref there is also 'EchoCom', 'EchoScripts', and 'EchoMessages' that you might toggle. I think that 'EchoCom' is the most likely.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Llohr
Apprentice


Joined: 17 May 2005
Posts: 108

PostPosted: Fri Jan 22, 2016 11:58 am   
 
Well, now I know, in case I ever want to use the #sendraw function. Guess I was confused by the whole: "To send raw text to the MUD" thing.
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Fri Jan 22, 2016 5:15 pm   
 
Vijilante that is ultra awesome, thank you very much!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4702
Location: Pensacola, FL, USA

PostPosted: Fri Jan 22, 2016 5:45 pm   
 
To send a literal string, wrap it in double quotes.
_________________
Discord: Shalimarwildcat
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