[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  need some help

need some help

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Shou   USA  (30 posts)  [Biography] bio
Date Sun 01 Aug 2010 10:24 PM (UTC)
Message
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!

My computer once beat me at chess, but it was no match for me at kickboxing.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #1 on Mon 02 Aug 2010 03:19 AM (UTC)
Message
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...
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #2 on Mon 02 Aug 2010 04:26 AM (UTC)
Message
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:

<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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #3 on Mon 02 Aug 2010 04:51 AM (UTC)
Message
oh yea, better idea.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Mon 02 Aug 2010 04:59 AM (UTC)
Message
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.

Template:post=8768 Please see the forum thread: http://gammon.com.au/forum/?id=8768.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shou   USA  (30 posts)  [Biography] bio
Date Reply #5 on Mon 02 Aug 2010 05:09 AM (UTC)
Message
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!

My computer once beat me at chess, but it was no match for me at kickboxing.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #6 on Mon 02 Aug 2010 05:34 AM (UTC)

Amended on Mon 02 Aug 2010 05:35 AM (UTC) by Twisol

Message
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:
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?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Mon 02 Aug 2010 06:00 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #8 on Mon 02 Aug 2010 07:24 AM (UTC)

Amended on Mon 02 Aug 2010 07:40 AM (UTC) by Nick Gammon

Message
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

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Mon 02 Aug 2010 07:43 AM (UTC)
Message
According to the VBscript help file:


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. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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,872 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]