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 ➜ Plugins ➜ Plugin Request: Zombies

Plugin Request: Zombies

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


Pages: 1 2  

Posted by Fevix   (15 posts)  Bio
Date Tue 23 Jan 2018 11:05 PM (UTC)
Message
I'd like a plugin that watches for incoming lines with a certain prefix and moves that line to a miniwindow. Optimally, that miniwindow would have a textbox that would send text entered there back to the MUCK with a preprogrammed prefix as well (The 'send this to the zombie' prefix)

The plugin should be able to handle many miniwindows at the same time. I don't mind if I have to set things up for it to work, but I'll answer any questions people have.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 24 Jan 2018 12:37 AM (UTC)
Message
The stuff described in the post below covers most of that:

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

- Nick Gammon

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

Posted by Fevix   (15 posts)  Bio
Date Reply #2 on Wed 24 Jan 2018 11:30 AM (UTC)

Amended on Wed 24 Jan 2018 03:05 PM (UTC) by Fevix

Message
Okay, I installed all of that given the instructions in the second post, made a trigger in the .MCL file, but it's not moving the requested output to another window.

------

EDIT: Okay I got it to SOMEWHAT work, but now I've got "Trigger function "chattrigger" not found or had a previous error." whenever a message should be moved.

Also, from the looks of things there's only one communications box? I was hoping for several, as I have many puppets and would like one for each. There also doesn't appear to be a place for me to input a command in the communication box.

------

Edit2: Got it working fully, but is there a way to both hide the message in the main menu and hide the prefix used to 'capture' the message in the miniwindow?

While the issues in this edit are much easier to ignore, the lack of multiple boxes and lack of text entry are both critical 'flaws to the use case I'm trying to get out of it, and I lack the skills necessary to rectify ANY of these issues.

My use case in more detail: I control several zombies/puppets, each of which can be interacting with another player at any time. Currently, all puppets report everything they see to the main window, which can lead to actions getting buried quickly, especially if I'm using a puppet's menus to update/change settings on it. It gets even worse when multiple puppets are interacting with the same player(s) in the same room, as each puppet will report what it sees individually, so when something happens in that room, I get it once for each puppet even though the player only sent one message:

Puppet1> Player does something
Puppet2> Player does something
Puppet3> Player does something
Puppet1> You do something
Puppet2> Puppet1 does something
Puppet3> Puppet1 does something

In this case, I'd like to be able to have each puppet's 'reports' (Denoted by their name, then ">" then a space) sent to their own window, and each puppet's window should have a chatbox that takes what I type there and prefixes it with my preconfigured "send force to puppetX" command.
Top

Posted by Fiendish   USA  (2,541 posts)  Bio   Global Moderator
Date Reply #3 on Wed 24 Jan 2018 04:11 PM (UTC)

Amended on Wed 24 Jan 2018 04:12 PM (UTC) by Fiendish

Message
Quote:
There also doesn't appear to be a place for me to input a command in the communication box.


I think Nick was thrown off by you describing how you think something should work rather than what you actually want to accomplish. Miniwindows just aren't good for this. Next time post your use case scenario first and we'll understand better how to help.

You'll find that the many worlds interpretation of quantum MUCK theory more closely fits your scenario.

Read the first post in this thread:
https://www.mushclient.com/forum/bbshowpost.php?id=7991

You'll want an output world per zombie, and your main world redirect trigger should set the value of chat_world according to whichever zombie has been captured.

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

Posted by Fevix   (15 posts)  Bio
Date Reply #4 on Fri 26 Jan 2018 09:44 PM (UTC)
Message
So I would just put the "chat_world=whatever" on the trigger?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #5 on Fri 26 Jan 2018 10:20 PM (UTC)
Message
That would probably do it.

- Nick Gammon

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

Posted by Fevix   (15 posts)  Bio
Date Reply #6 on Fri 26 Jan 2018 10:26 PM (UTC)

Amended on Fri 26 Jan 2018 10:54 PM (UTC) by Fevix

Message
How do I add the plugin to just one world?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 26 Jan 2018 10:38 PM (UTC)
Message
File Menu -> Plugins -> Add.

- Nick Gammon

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

Posted by Fevix   (15 posts)  Bio
Date Reply #8 on Fri 26 Jan 2018 10:54 PM (UTC)

Amended on Fri 26 Jan 2018 11:12 PM (UTC) by Fevix

Message
I've been sitting here waiting for 15 minutes because I hit some sort of timer that prevented me from posting.... (Edit: I post this and get a 27 minute mute? Come on, how is anyone supposed to have a conversation)
Anyways, now that I can finally say something:

What do I change this line to if I want to, say, prefix all commands sent back to the main world with "Pup1 " to control Puppet1?
"w:Execute (command)"

Additionally, when I added the plugin, I got a warning for each of the triggers. Here's one:
[WARNING] C:\Program Files (x86)\MUSHclient\worlds\plugins\Chat Redirector.xml
Line 44: Attribute not used: chat_world="Keith" (trigger)
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #9 on Sat 27 Jan 2018 12:07 AM (UTC)
Message
I've marked you as a trusted user so you shouldn't get the timeout again.

Quote:

What do I change this line to if I want to, say, prefix all commands sent back to the main world with "Pup1 " to control Puppet1?
"w:Execute (command)"


Well:


w:Execute ("Pup1 " .. command)





Quote:

So I would just put the "chat_world=whatever" on the trigger?
...
Additionally, when I added the plugin, I got a warning for each of the triggers. Here's one:


When you said "on the trigger" I thought you were going to do that in the script section.

So for example, if your trigger is:

*> *

Then the first wildcard is the puppet name. You would then put that into the variable (in the function 'redirect') like this:


function redirect (name, line, wildcards, styles)

  chat_world = wildcards [1]  -- change which world to send to

...

- Nick Gammon

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

Posted by Fevix   (15 posts)  Bio
Date Reply #10 on Sat 27 Jan 2018 04:02 AM (UTC)

Amended on Sat 27 Jan 2018 04:55 AM (UTC) by Fevix

Message
The wildcard version won't work. The > symbol appears in many places (primarily in exit names, to denote a shortcut, eg "Go <deeper> into the dark cave"(And making sure there's no space won't work either, because "Go" is sometimes omitted, eg "<Deeper> into the dark cave")).

There, the wildcard would attempt to match something that isn't a puppet name.

Currently I just have each puppet report prefix in it's own trigger. Is there a way to figure out which trigger (index?) called the function? I'm not really a programmer but I tend to come up with multiple solutions.

One such solution could be to parse the string after it's been called to the function, get the first word, knock off the greater than symbol, and set chat_world to the word. This could allow me to trim the triggers down to just one of the same trigger can have multiple strings to match

-----

Edit: I've implemented the solution mentioned above (Added a line before your original first line in the redirect function to call a parsing script that returns everything before the first ">") so now all of the triggers can just call the same function.

Now I just need to figure out if I can combine the triggers all into one (Cause the only difference is the search string)

-----

Edit2: Okay, it's... "working". The plugin will open the correct world, but immediately it tells me "can't open chat world file ___________" for each line despite the fact that the chat world is open and properly named.

Here's a screenshot (I disabled the bit that only showed the error the first time around because I have so many bots and don't want the error to hide if I have more than one puppet messed up)

https://gyazo.com/f5c8dcfa823a906a7848bbc6081a63b2
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #11 on Sat 27 Jan 2018 05:07 AM (UTC)
Message
That link served up a blank page for me. Looks like an authentication issue. Can't you use imgur or something like that? Check that the resulting image works even if you aren't logged in (make a private Firefox/etc. window to do that).

- Nick Gammon

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

Posted by Fevix   (15 posts)  Bio
Date Reply #12 on Sat 27 Jan 2018 05:11 AM (UTC)

Amended on Sat 27 Jan 2018 05:17 AM (UTC) by Fevix

Message
Gyazo has never done that to anyone else I've sent the links to but okay.

https://imgur.com/a/ovG9K
I have an idea as to what it might be...

Does MUSHclient look at that name field in the properties or does it look at the window titles?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #13 on Sat 27 Jan 2018 05:25 AM (UTC)
Message
That's odd. The world seems to be there. Can you find the world list? Open an Immediate scripting window (Ctrl+I) and paste this:


for k, v in pairs (GetWorldList()) do 
  print (k, v) 
end


And maybe this as well:


for k, v in pairs (GetWorldIdList()) do 
  print (k, v) 
end


Paste the results you get here.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #14 on Sat 27 Jan 2018 05:27 AM (UTC)
Message
Fevix said:

Does MUSHclient look at that name field in the properties or does it look at the window titles?


It's the world name in the configuration (that you showed). So "Keith" would be OK. Maybe it is capitalization.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


78,574 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.