I am on a MUCK called FurryMuck. I like it a lot. The sad thing is, I used to use BimpMU it had a pet feature, that would allow it to open a new window, just for a pet, and it would cut off, the prepend to what is sent to you, like for me I have, "Beast> " as my received prepend, and my send prepend is, "pet " BimpMU let me put that into the window, so that I can use my pet as if she was a whole new player... I have spent about a week trying to get the new window, that I am receiving my pet's messages, but when I try to send a look, command, from said window, it only sends look, to the first window, and not, "pet look" like I'd like it to. I have everything down, except this one thing. I don't mind the window always sending "Beast> " to me, as I know she is a pet, not a real player, but if that could be ironed out too... that would be very nice.
Thanks for reading... I hope this get's solved quickly...
Actually... I haven't a clue how... I've tried editing what it sends to the main window... but it seems to only send, what I've typed every time... but here is what I do have.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wedsday, November 17, 2015, 7:14 -->
<!-- MuClient version 4.13 -->
<!-- Plugin "pet_Input" generated by Wire Razor -->
<muclient>
<plugin
name="pet_input"
author="Wire Razor"
id="fefa658aa8caca3cb5e2fa00"
language="Lua"
purpose="Works as a new window, for one's pet"
date_written="2015-11-17 7:14:42"
requires="4.00"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
world_name = "muck(wire)"
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>
The only bit I could see, that might work, was the "Return ("\t")" but... editing that, made no difference one way, or the other. I think I would need a new 'end -- OnPluginCommandEntered' but I don't know what I'd need to edit, to make that work like I would like. Again, thanks for looking at this.
I think that would do what you want, or at least could be a basis for what you're trying to accomplish. And I believe Nick even mentions an option for processing commands entered in the chat (in your case, pet-only communication) window and passing them back to the main one.
Ah right. I see that now. But what would be wrong with, say, making an assumption that every input in the Chat Redirect window should be therefore prefixed with "pet", and as such have something like:
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 ("pet " .. command) -- execute command (handle aliases, etc.)
PushCommand ("pet " .. command) -- save in command history
end -- if
return ("\t") -- clear command
end -- OnPluginCommandEntered
assuming that the triggers in the main world are redirecting only pet-related lines?
So as for removing "Beast> ", I imagine that in the plugin loaded into your main world, you have a script that catches any text passed to it and sends it on to the chat window:
if w then -- if present
for _, v in ipairs (styles) do
w:ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end -- for each style run
w:Note ("") -- wrap up line
end -- world found
What you could do is strip "Beast>" out of the v.text variable with string.find() and a bit of regex:
if w then -- if present
for _, v in ipairs (styles) do
str, en, cap = string.find(v.text, "^Beast\>%s+(.*)$")
if cap == nil then
cap = v.text
end -- if
w:ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
cap) -- cleaned version of v.text or original text.
end -- for each style run
w:Note ("") -- wrap up line
end -- world found