Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ Auto-say helper

Auto-say helper

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


Posted by Nick Gammon   Australia  (23,121 posts)  Bio   Forum Administrator
Date Thu 10 Jul 2008 05:52 AM (UTC)
Message
The auto-say option in MUSHclient is great if you want to have a lengthy conversation with a friend online. Instead of having to prefix each line you type with "tell (friend)" you can just type your message and let MUSHclient do it for you.

However there is one drawback. After chatting away I invariably find that I forget auto-say is on, and then send things like "help dwarf" or "cast heal" to my friend, rather than actually doing them.

The small plugin below is designed to stop that happening. What it does is check every second if auto-say is active, and if so, colours the background of your command window a distinctive colour (I chose palegreen, but you could choose any colour with the assistance of the colour picker).

Then a simple glance at the window - the very place you are typing - visually confirms whether or not you have auto-say active.

To use, copy from between the lines below, save as Auto_Say_Visualizer.xml in your MUSHclient -> Worlds -> Plugins folder, and then use the File menu -> Plugins to install it.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, July 10, 2008, 1:28 PM -->
<!-- MuClient version 4.33 -->

<!-- Plugin "Auto_Say_Visualizer" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Auto_Say_Visualizer"
   author="Nick Gammon"
   id="379f2b5475fb85cd8de2a2d5"
   language="Lua"
   purpose="Colours command window if auto-say active"
   date_written="2008-07-10 13:27:28"
   requires="4.00"
   version="1.0"
   >

</plugin>


<!--  Timers  -->

<timers>
  <timer 
    enabled="y" 
    second="1.00" 
    send_to="12"
    active_closed="y"
  >
  <send>
if GetOption ("enable_auto_say") == 1 then
  SetOption ("input_background_colour", ColourNameToRGB ("palegreen"))
else
  SetOption ("input_background_colour", ColourNameToRGB ("white"))
end -- if
</send>

  </timer>
</timers>

</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Cage_fire_2000   USA  (119 posts)  Bio
Date Reply #1 on Fri 05 Sep 2008 02:33 PM (UTC)

Amended on Fri 05 Sep 2008 02:36 PM (UTC) by Cage_fire_2000

Message
I downloaded this a while ago, but I just got around to testing it out, seems neat, but unfortunately, it seems to make my display flicker every time it runs. It might be better if it stores the status of autosay, and only changes the background color if it's changed, thus avoiding the flicker. Seems to me this'd be as easy as moving the code to a script block, and have a global variable declared to store the value of autosay. Like this:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, July 10, 2008, 1:28 PM -->
<!-- MuClient version 4.33 -->

<!-- Plugin "Auto_Say_Visualizer" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Auto_Say_Visualizer"
   author="Nick Gammon"
   id="379f2b5475fb85cd8de2a2d5"
   language="Lua"
   purpose="Colours command window if auto-say active"
   date_written="2008-07-10 13:27:28"
   requires="4.00"
   version="1.01"
   >

</plugin>


<!--  Timers  -->

<timers>
  <timer 
    enabled="y" 
    second="1.00" 
    send_to="10"
    active_closed="y"
    script="AutoSayVisualize"
  >
  </timer>
</timers>

<!--  Script  -->


<script>
<![CDATA[
bWasAutoSayActive = 0

function AutoSayVisualize()
  if GetOption("enable_auto_say") ~= bWasAutoSayActive then
    bWasAutoSayActive = GetOption("enable_auto_say")
    if bWasAutoSayActive == 1 then
      SetOption ("input_background_colour", ColourNameToRGB ("palegreen"))
    else
      SetOption ("input_background_colour", ColourNameToRGB ("white"))
    end -- if
  end -- if
end

function OnPluginClose()
  SetOption ("input_background_colour", ColourNameToRGB ("white"))
end

function OnPluginDisable()
  bWasAutoSayActive = 0
  SetOption ("input_background_colour", ColourNameToRGB ("white"))
end

]]>
</script>

</muclient>



I also added something to restore the input window color if the plugin is disabled or removed, it'll go back if reenabled/reinstalled.
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.


11,983 views.

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

Go to topic:           Search the forum


[Go to top] top

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