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.
 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Plugin broadcast.

Plugin broadcast.

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


Pages: 1  2 

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #15 on Fri 17 Jun 2005 09:36 PM (UTC)
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.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #16 on Mon 22 Aug 2005 11:32 PM (UTC)
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!
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #17 on Thu 08 Sep 2005 11:32 PM (UTC)
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!
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #18 on Sat 15 Oct 2005 01:44 AM (UTC)
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
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #19 on Sat 15 Oct 2005 01:47 AM (UTC)
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!
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.


58,934 views.

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

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.