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 ➜ SendToAllWorlds on different MC instances

SendToAllWorlds on different MC instances

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


Posted by Rdiniz   Brazil  (21 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  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
Top

Posted by Fiendish   USA  (2,555 posts)  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
Top

Posted by Rdiniz   Brazil  (21 posts)  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.
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,607 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.