i have been wondering for some time now, if you can gag a message on Mush, and not leave a blank line with a prompt under it. if you can help me, thanks!
need some help
Posted by Shou on Sun 01 Aug 2010 10:24 PM — 10 posts, 41,370 views.
Yup, but it'll be a little bit of scripting...
Basically you're going to trig your prompt line, omit that from output, and write a script to ColourNote it again.
Then in your gag triggers, have a script that sets a boolean.
Then modify your prompt tigger checking If PreviousLineGagged then PreviousLineGagged=false else ColourNote ... end
so your prompt is only re-echoed after lines that aren't gagged...
Basically you're going to trig your prompt line, omit that from output, and write a script to ColourNote it again.
Then in your gag triggers, have a script that sets a boolean.
Then modify your prompt tigger checking If PreviousLineGagged then PreviousLineGagged=false else ColourNote ... end
so your prompt is only re-echoed after lines that aren't gagged...
Since you're using a variable to test if the prompt should be gagged, you can just use the enabled/disabled state of the prompt gagger itself:
When you want the prompt to be gagged, use EnableTrigger("prompt_gag"). It'll automatically disable itself afterwards. No ugly re-echoing cruft needed.
<triggers>
<trigger
keep_evaluating="y"
match="^prompt, goes, here$"
name="prompt_gag"
omit_from_log="y"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="1"
>
<send>EnableTrigger("prompt_gag", false)</send>
</trigger>
</triggers>When you want the prompt to be gagged, use EnableTrigger("prompt_gag"). It'll automatically disable itself afterwards. No ugly re-echoing cruft needed.
oh yea, better idea.
The blank lines are a bit of a problem, mainly because the MUD tries to be smart ... it knows you have a prompt, so it sends a blank line to start a new line before sending the prompt. Even though you omit the prompt you are still left with the blank line.
I sometimes resort to using the Omit_Blank_Lines plugin - that omits all blank lines. This isn't too bad, and it saves blank lines annoyingly appearing in your output.
I sometimes resort to using the Omit_Blank_Lines plugin - that omits all blank lines. This isn't too bad, and it saves blank lines annoyingly appearing in your output.
Please see the forum thread: http://gammon.com.au/forum/?id=8768.
ok thanks alot. now, how exactly do i gag a message by itself? i should have reworded my question. i needed to know how to gag it, and how to remove the prompt too. thanks for the help earlier!
You check the "Omit line from output" checkbox on the right side of the trigger dialog, which is what the exported trigger I posted above has.
Also, I realized that you posted in the VBscript forum, and I stupidly gave a script in Lua. The VBscript syntax, I'm fairly sure, would be:
And you'd use this in another trigger to enable it:
I think the 'world.' prefix is important in VBscript, no?
Also, I realized that you posted in the VBscript forum, and I stupidly gave a script in Lua. The VBscript syntax, I'm fairly sure, would be:
world.EnableTrigger("prompt_gag", false)And you'd use this in another trigger to enable it:
world.EnableTrigger("prompt_gag", true)I think the 'world.' prefix is important in VBscript, no?
No. Not for about 5 years (or maybe 10). It assumes 'world.". The only place you need it is world.Execute because Vbscript has an Execute.
However I think it is vbTrue rather than "true". Or just put a 1 there I think.
However I think it is vbTrue rather than "true". Or just put a 1 there I think.
w3schools [1] says it's True, although True seems to equal -1 and False equals 0, so I assume any non-zero value will be taken as a truth value.
Thanks for correcting me on the 'world.' part!
[1] http://www.w3schools.com/vbscript/vbscript_ref_keywords.asp
Thanks for correcting me on the 'world.' part!
[1] http://www.w3schools.com/vbscript/vbscript_ref_keywords.asp
According to the VBscript help file:
However it also says:
All the examples I had seen used vbTrue and vbFalse, however since they seem to have the same values as True and False, it seems you can use them interchangeably.
As for the "world." bit - that is set up as a "default object" or some such thing. Some of my examples use world.Note and so on, as they were written before I stumbled across that. :)
Since these constants are built into VBScript, you don't have to define them before using them. Use them anywhere in your code to represent the values shown for each.
Constant Value Description
vbUseDefault -2 Use default from computer's regional settings.
vbTrue -1 True
vbFalse 0 False
However it also says:
The True keyword has a value equal to -1.
The False keyword has a value equal to 0.
All the examples I had seen used vbTrue and vbFalse, however since they seem to have the same values as True and False, it seems you can use them interchangeably.
As for the "world." bit - that is set up as a "default object" or some such thing. Some of my examples use world.Note and so on, as they were written before I stumbled across that. :)