|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Thu Sep 06, 2007 5:47 pm
[2.02] %pref not changing values |
I'm writing a script, and for a certain portion it sends a lot of commands to the mud I don't want to see. As such, I've been looking for a way to disable to local echo for commands, then re-enable when all the data is sent. I found the %pref function, which looked promising, and the preference settings:
EchoCom
EchoMessage
EchoScripts
I think EchoCom is the only one I need, but I've tested with all three. It seems that calling %pref(EchoCom,0) doesn't actually change anything, it still echoes text on my screen, and a subsequent call to "#ECHO %pref(EchoCom)" returns 1.
Am I using the wrong values here, or is the %pref function not working?
Before anyone suggests "LocalEcho", as far as I can tell, this setting isn't what I'm looking for, as it relates to Character Mode, and is already disabled in my preferences menu. |
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Sep 06, 2007 11:51 pm |
It works with most settings, but in the case of EchoCom, CMUD always echos commands that are sent from the command line. The setting only effects commands sent from scripts (such as aliases). When CMUD executes a command, it saves the current value of EchoCom, then sets the new value appropriately based upon EchoScripts and whether or not it is a user command line. When the command is done, CMUD restores the previous value of EchoCom. So in this case, you can't change EchoCom via Prefs. I'll see if I can improve that in the future.
|
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Fri Sep 07, 2007 12:40 am |
I'm not entering the commands from command line, they are being executed from a script. I've tried setting EchoCom,EchoMessage,and EchoScripts all to 0, but the alias is still showing the text its sending to the mud... I'll look again at the settings. I didn't test whether %pref is actually affecting EchoScripts or not.
|
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Sep 07, 2007 2:06 am |
You want to send certain commands to the mud without seeing them echo, but you want to see other commands echo? Use #SEND. If you really want to make this complicated, set up a state variable you can check in an #IF command that determines if the command is echoed or not.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Fri Sep 07, 2007 6:28 pm |
Basically, I have an alias that sends a lot of commands to the mud, I don't want to see any of it sent. So at the beginning of the alias I attempted
Code: |
#CALL %pref(EchoCom,0)
#CALL %pref(EchoScripts,0)
...
code
...
#CALL %pref(EchoCom,1)
#CALL %pref(EchoScripts,1)
|
I put in a few test #ECHO commands, and it seems that EchoScripts is reliably being set to 0, but is having no effect, EchoCom works at 0 until any other alias is called, wherein it is set back to 1. The first command sent to the mud (while EchoCom is still 0) is not shown, whether using #SEND or not. All the commands following the first call to an alias are shown, also regardless of my use of #SEND or not. I'm going to attempt to stick a #CALL %pref() in the aliases that are called and see if this alleviates the issue, but hopefully you can see where my problem lies. |
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
|
|
|
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
|
|