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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Plugin broadcast.

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Plugin broadcast.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #15 on Fri 17 Jun 2005 09:36 PM (UTC)  quote  ]
Message
He posted two days ago (on the 15th), in the programming forum. For the past month now, he's posted a total of thrice; each about two weeks apart.

I agree, it isn't normal of him, but I'm sure he's just busy or something.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #16 on Mon 22 Aug 2005 11:32 PM (UTC)  quote  ]
Message
God, I hope I don't have to bump this again. It's been a few months since I posted initially.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #17 on Thu 08 Sep 2005 11:32 PM (UTC)  quote  ]
Message
Here's the broadcast plugin:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, June 05, 2003, 9:00 PM -->
<!-- MuClient version 3.42 -->

<muclient>
<plugin
   name="Broadcast"
   author="Poromenos"
   id="e58a316339d27af6ddc6bd3c"
   language="VBscript"
   purpose="Broadcasts data."
   save_state="y"
   date_written="2003-06-05 21:00:18"
   requires="3.42"
   version="1.0"
   >

</plugin>


<!--  Script  -->


<script>
<![CDATA[
Sub sbBroadcast(strData)
    Dim lstPlugins
    lstPlugins = GetPluginList
    If Not IsEmpty (lstPlugins) Then
        For Each plPlugin In lstPlugins
            strPluginID = GetPluginInfo (plPlugin, 7)
            If World.PluginSupports (strPluginID, "OnPluginBroadcast") = eOK then
                CallPlugin GetPluginInfo (plPlugin, 7), "OnPluginBroadcast", strData
            End If
        Next
    End If
End Sub]]>
</script>

</muclient>


And here's how to use it:


def fnBroadcast(strData):
    if (world.PluginSupports("e58a316339d27af6ddc6bd3c", "sbBroadcast") == eOK):
        world.CallPlugin("e58a316339d27af6ddc6bd3c", "sbBroadcast", "%s|%s" % (world.GetPluginName, strData))

def OnPluginBroadcast(strData):
    # Do something with the data.
    pass

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #18 on Sat 15 Oct 2005 01:44 AM (UTC)  quote  ]
Message
This idea is now incorporated into version 3.67. Any plugin (or main script file) can do a BroadcastPlugin script call.

This will attempt to find an OnPluginBroadcast handler in all installed plugins.

If found, the handler is called with 4 arguments, two that you supply (a number and a string), and 2 automatically generated, which identify the calling plugin ID and name.

The intention of those arguments is to make sure that the plugin broadcast comes from the plugin that you are expecting.

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #19 on Sat 15 Oct 2005 01:47 AM (UTC)  quote  ]
Message
Ah, that is great. I think it will make the plugin system much more flexible and useful.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[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.


6,813 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]