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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Auto Say Function In Seperate Window

Auto Say Function In Seperate Window

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


Posted by Dretzile   USA  (5 posts)  Bio
Date Fri 11 Apr 2014 10:42 PM (UTC)
Message
So I have been able to successfully setup several windows that redirect different types of chat messages to different windows, and I've set it up so that each of the windows redirects and sends the command to the main world.

However, I have been trying to set up something along the lines of the "auto say" feature, which doesn't seem to work with my plugin to redirect to the main world.

Examble: If I type something into my OOC window, I want whatever I type to be automatically prefixed with "OOC" so that it gets sent as an OOC command, same for Radio, etc.

I have been scouring the web and the forums and through snippets and I haven't been able to find a way to get this to work...

Can anyone help with a solution?
Top

Posted by Fiendish   USA  (2,555 posts)  Bio   Global Moderator
Date Reply #1 on Sat 12 Apr 2014 04:51 PM (UTC)
Message
What code are you using to redirect what you say to the main world?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Dretzile   USA  (5 posts)  Bio
Date Reply #2 on Sat 12 Apr 2014 06:39 PM (UTC)
Message

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:14  -->
<!-- MuClient version 4.13 -->

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

<muclient>
<plugin
   name="Redirect_Input"
   author="Nick Gammon"
   id="fefa658aa8caca3cb5e2fa81"
   language="Lua"
   purpose="Redirects commands to another world"
   date_written="2007-06-30 10:08:32"
   requires="4.00"
   version="1.0"
   >

</plugin>


<!--  Script  -->


<script>
<![CDATA[
world_name = "AwakeMUD"

function OnPluginCommandEntered (command)

  local w = GetWorld (world_name)  -- find world

  -- not found? show error
  if not w then
    ColourNote ("white", "red", "World " .. world_name .. " is not open")
  else
    w:Execute (command)  -- execute command (handle aliases, etc.)
    PushCommand (command)  -- save in command history
  end -- if

  return ("\t")  -- clear command

end -- OnPluginCommandEntered 


]]>
</script>


</muclient>
Top

Posted by Fiendish   USA  (2,555 posts)  Bio   Global Moderator
Date Reply #3 on Sun 13 Apr 2014 06:16 PM (UTC)

Amended on Sun 13 Apr 2014 06:19 PM (UTC) by Fiendish

Message
See my very simple change below where I insert
command = "OOC "..command

That will inject "OOC " in front of anything entered before pushing it to the other world.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:14  -->
<!-- MuClient version 4.13 -->

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

<muclient>
<plugin
   name="Redirect_Input"
   author="Nick Gammon"
   id="fefa658aa8caca3cb5e2fa81"
   language="Lua"
   purpose="Redirects commands to another world"
   date_written="2007-06-30 10:08:32"
   requires="4.00"
   version="1.0"
   >

</plugin>


<!--  Script  -->


<script>
<![CDATA[
world_name = "AwakeMUD"

function OnPluginCommandEntered (command)
  local w = GetWorld (world_name)  -- find world

  -- not found? show error
  if not w then
    ColourNote ("white", "red", "World " .. world_name .. " is not open")
  else
    command = "OOC "..command
    w:Execute (command)  -- execute command (handle aliases, etc.)
    PushCommand (command)  -- save in command history
  end -- if

  return ("\t")  -- clear command

end -- OnPluginCommandEntered 


]]>
</script>


</muclient>


You can easily genericize this to happen differently based on the current world name, if you name the worlds different for OOC/Radio/etc.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Dretzile   USA  (5 posts)  Bio
Date Reply #4 on Mon 14 Apr 2014 04:16 AM (UTC)
Message
Thanks!
It worked perfectly. I appreciate the help very much.
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.


17,110 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.