[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  SendToAllWorlds on different MC instances
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

SendToAllWorlds on different MC instances

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


Posted by Rdiniz   Brazil  (5 posts)  [Biography] bio
Date Sun 19 Mar 2017 09:20 PM (UTC)
Message
Hi,
is it possible to use send a command to all worlds, being n of those worlds in another instance on MushClient?
Reason I want this is to try to redude some slowness on the main game window since to too many worlds opened (20+).

Thank you.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 20 Mar 2017 06:36 AM (UTC)
Message
You can use:

Template:function=GetWorldIdList GetWorldIdList

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



That gets you a list of all the world IDs.

Then you can use:

Template:function=GetWorldById GetWorldById

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



That gets you an object reference (or Lua userdata) which points to one of the worlds.

Then you can send to that world.

Example in Lua:


-- --------------------------------------------------
-- Example showing sending a message all worlds
-- --------------------------------------------------

function SendToAllWorlds (message)

  for k, v in pairs (GetWorldIdList ()) do 
    GetWorldById (v):Send (message)
  end
end

SendToAllWorlds ("say Hi there")

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Mon 20 Mar 2017 11:45 AM (UTC)

Amended on Mon 20 Mar 2017 03:19 PM (UTC) by Fiendish

Message
No, Nick, Rdiniz wants to command and control a remote botnet across multiple MUSHclients.


Quote:
too many worlds opened (20+)

I agree. That's too many. Problem identified. Solution obvious.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Rdiniz   Brazil  (5 posts)  [Biography] bio
Date Reply #3 on Tue 21 Mar 2017 12:03 AM (UTC)
Message
It's not a problem, it's a requirement for what I want and do use. It's working well, I do use Nick's code to send to all worlds. I just wanted to get it running faster if possible, but if not, I'll live!

Thank you.
[Go to top] 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.


1,310 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]