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, 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 ➜ MUDs ➜ General ➜ MUCK having a pet, new window for pet, but can't force window to send a prepend

MUCK having a pet, new window for pet, but can't force window to send a prepend

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


Posted by Wire Razor   USA  (4 posts)  Bio
Date Tue 17 Nov 2015 04:58 PM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,057 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 17 Nov 2015 07:45 PM (UTC)

Amended on Tue 17 Nov 2015 07:46 PM (UTC) by Nick Gammon

Message
Quote:

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


Can you show what you did to (attempt to) achieve this? It should be do-able.

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


You should be able to use a function like GetWorld to send things from one window to another.

Template:function=GetWorld GetWorld

The documentation for the GetWorld script function is available online. It is also in the MUSHclient help file.


- Nick Gammon

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

Posted by Wire Razor   USA  (4 posts)  Bio
Date Reply #2 on Wed 18 Nov 2015 02:00 PM (UTC)

Amended on Wed 18 Nov 2015 09:23 PM (UTC) by Nick Gammon

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

Posted by Nick Gammon   Australia  (23,057 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 18 Nov 2015 09:26 PM (UTC)
Message
Can you clarify what you mean by a "new window for pet"?

Do you mean a separate world file, or just a different window in the current connection, so you only connect to the MUCK once?

The "miniwindow chat plugin" windows might be what you need.

- Nick Gammon

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

Posted by Daniel P   USA  (97 posts)  Bio
Date Reply #4 on Wed 18 Nov 2015 10:02 PM (UTC)

Amended on Wed 18 Nov 2015 10:04 PM (UTC) by Daniel P

Message
In one MUD I played for a few months, I had actually used the Chat Redirector plugin.

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


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

Posted by Nick Gammon   Australia  (23,057 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 19 Nov 2015 04:10 AM (UTC)
Message
Yes, that technique has been superseded a bit by using the miniwindow chat.

Quote:

... my send prepend is, "pet " ...


This sort-of hints at having two connections to the MUCK open, but perhaps if the OP clarifies.

- Nick Gammon

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

Posted by Daniel P   USA  (97 posts)  Bio
Date Reply #6 on Thu 19 Nov 2015 04:25 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,057 posts)  Bio   Forum Administrator
Date Reply #7 on Thu 19 Nov 2015 04:53 AM (UTC)

Amended on Thu 19 Nov 2015 04:55 AM (UTC) by Nick Gammon

Message
That sounds OK to me, assuming that the OP wants two connections to the MUCK and not just one (or maybe not).

The initial post sounds a bit like one connection with some output being shoved into a different window.

If s/he doesn't mind typing "pet" in front of commands, then the miniwindow idea might be cleaner.

- Nick Gammon

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

Posted by Wire Razor   USA  (4 posts)  Bio
Date Reply #8 on Thu 19 Nov 2015 07:11 AM (UTC)
Message
Thanks Daniel... that is exactly what I was looking for... now to remove the "Beast> " from the window... not that it matters... but it would be nice.
Top

Posted by Daniel P   USA  (97 posts)  Bio
Date Reply #9 on Thu 19 Nov 2015 02:23 PM (UTC)

Amended on Thu 19 Nov 2015 02:42 PM (UTC) by Daniel P

Message
Woot! Awesome!!

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
Top

Posted by Wire Razor   USA  (4 posts)  Bio
Date Reply #10 on Fri 20 Nov 2015 07:44 AM (UTC)
Message
Thanks Daniel... That again, was exactly what I needed. Thanks.
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.


29,478 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.