Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Execute without echo
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Shadox
(2 posts) Bio
|
Date
| Sun 13 Sep 2009 05:25 PM (UTC) |
Message
| Is there any way to send an Execute style command, meaning one that will be evaluated against aliases, without it local echoing? I can find no way to do it. | Top |
|
Posted by
| Blainer
(191 posts) Bio
|
Date
| Reply #1 on Sun 13 Sep 2009 11:20 PM (UTC) Amended on Sun 13 Sep 2009 11:44 PM (UTC) by Blainer
|
Message
| I have echo off for all my commands.
Game -> Configure -> Commands menu has an Echo My Input Option. This will toggle echoing all your commands.
Help for the Commands dialog is here.
http://mushclient.com/scripts/doc.php?dialog=IDD_PREFS_P9
The is an option on the alias or trigger dialog to Omit from Command history.
To send one command without echoing it use this function.
| Top |
|
Posted by
| Shadox
(2 posts) Bio
|
Date
| Reply #2 on Mon 14 Sep 2009 01:51 AM (UTC) |
Message
| That doesn't address my issue.
I'm scripting, and at present just setting EchoInput to False, sending all of my commands, and then changing it back to true.
The issue is sending commands (in a script) with execute level processing but having them not echo (primarily those commands that turn out to not get processed as aliases, as an alias can already be set to not echo). | Top |
|
Posted by
| Blainer
(191 posts) Bio
|
Date
| Reply #3 on Mon 14 Sep 2009 02:13 AM (UTC) Amended on Mon 14 Sep 2009 02:15 AM (UTC) by Blainer
|
Message
| Sorry I didn't understand your post. As a work around until an expert can answer this worked for me.
SetOption ("display_my_input", 0)
Execute ("look")
SetOption ("display_my_input", 1)
| Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #4 on Mon 14 Sep 2009 10:19 AM (UTC) |
Message
| I am inclined to agree with Blainer. Make your own execute function like this:
function ExecuteNoEcho (whatever)
SetOption ("display_my_input", 0)
Execute (whatever)
SetOption ("display_my_input", 1)
end -- function
Then in your script call ExecuteNoEcho instead of Execute. Anything that execute does, that would have echoed your input, won't.
Or, if you have lots of scripts with Execute in them and don't want to rename Execute as ExecuteNoEcho, you could do this in your script file:
function fixup_execute ()
local Execute = Execute
return function (whatever)
SetOption ("display_my_input", 0)
Execute (whatever)
SetOption ("display_my_input", 1)
end
end -- function
Execute = fixup_execute ()
That replaces the Execute function with one that saves a copy of the original, changes the option, executes the original Execute, and puts the option back. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Fiendish
USA (2,535 posts) Bio
Global Moderator |
Date
| Reply #5 on Mon 04 Apr 2016 03:09 PM (UTC) |
Message
| The previous replies in this thread are bad. Safer code would be
local original_echo_setting = GetOption("display_my_input")
SetOption ("display_my_input", 0)
Execute (whatever)
SetOption ("display_my_input", original_echo_setting)
|
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #6 on Mon 04 Apr 2016 08:18 PM (UTC) |
Message
| My code was bad in the sense it assumed echo was already on. Fiendish has a point that if it is already off, my suggestion would turn it on. So an improved function would be:
function ExecuteNoEcho (whatever)
local original_echo_setting = GetOption("display_my_input")
SetOption ("display_my_input", 0)
Execute (whatever)
SetOption ("display_my_input", original_echo_setting)
end -- function
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
26,027 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top