• Welcome to Valhalla Legends Archive.
 

Standardized Plugin Structure

Started by Networks, February 16, 2005, 11:44 AM

Previous topic - Next topic

Networks



Public Host As Object

Private Sub Class_Initialize()
    'Do Stuff
End Sub

Private Sub Class_Terminate()
    'Do Stuff
End Sub

'Required:

Private Property Get Version() As String
    Version = "1.0.0"
End Property

Private Property Get Title() As String
    Title = "Blank Plugin"
End Property

Private Property Get Description() As String
    Description = "Standardized Plugin Structure Created by Networks"
End Property

Private Property Let SetHost(ByVal objHost As Object)
    Host = objHost
End Property

'EID Events:

    '#### Informational Events:

Private Sub On_Channel(ByVal Message As String)

End Sub

Private Sub On_Error(ByVal Message As String)

End Sub

Private Sub On_NotExist(ByVal Message As String)

End Sub

Private Sub On_Restricted(ByVal Message As String)

End Sub

Private Sub On_ChannelFull(ByVal Message As String)

End Sub

    '#### User Events:

Private Sub On_Join(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Client As String)

End Sub

Private Sub On_Leave(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Client As String)

End Sub

Private Sub On_User(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Client As String)

End Sub

Private Sub On_Flags(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Client As String)

End Sub

    '#### Message Events:

Private Sub On_Talk(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Message As String)

End Sub

Private Sub On_Emote(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Message As String)

End Sub

Private Sub On_WhisperFrom(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Message As String)

End Sub

Private Sub On_WhisperTo(ByVal Username As String, ByVal Flags As Long, ByVal Ping As Long, ByVal Message As String)

End Sub

'EID End

'Packet Parsing:

Private Sub Parse_Packet(ByVal PacketID As Long, ByVal Data As String, ByVal Connection As Byte)
    Select Case Connection
        Case 1 'BNCS
       
        Case 2 'MCP
       
        Case 3 'BNLS
       
        Case 4 'BotNet
       
        Case Else
    End Select
End Sub

'Host Functions:
'   Get_Access(ByVal Username as String) as String
'   AddChat(RTB, ParamArray saElements())
'   Get_Trigger()
'   Send(ByVal Message as String)
'   AddQueue(ByVal Message as String)



Warrior mentioned to me that we really need a general plugin structure for all the bots because it's kinda lame to have about 5-6 different so why not create something we can all use. I created something we may but I am assuming it will get heavy criticism which I hope it will get so we can all comprimise on something. Anyhow I'd like to know what can be improved, what we can add, what we remove, and we should modify. I know Skywing has created BCP plugins but IMO it makes the bot dependent on it instead of the other way around. This is a simple plugin structure that can easily be modified to our liking and if you feel like you don't want to host a function then don't, it's as simple as that. Anyhow I'd like to know what we can do to improve and create a Standardized Plugin Structure. I've dubbed it 'SPS'. :)

UserLoser.

You should explain to use how you use this.  I don't think just the code from that class will be enough for somebody to actually write plugins and a framework supporting your plugins

Eric

QuoteI know Skywing has created BCP plugins but IMO it makes the bot dependent on it instead of the other way around.
You face this delima with every type plugin: Should I only provide users with a means of connecting to Battle.net and then give them the ability to continue the project as they wish through the use of plugins, should I create all of the essential features of this bot as plugins and then leave the rest up to the users or should I just hardcode everything essential to my bot and give users the ability to add more as they see fit.  Each option has it's own advantages and disadvantages.

As for the standardization: BCP has grown from it's original intent, to be used with Binary Chat, to a standard for those wishing to impliment an extensive plugin interface that's both been implimented in plenty of other bots and already has a number of useful plugins.

Warrior

What about the option to ignore some packet functions :P
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

tA-Kane

Quote from: Warrior on February 16, 2005, 03:44 PM
What about the option to ignore some packet functions :P
What do you mean? You can disable some of the BinaryChat Plugin API callbacks by a simple change from TRUE to FALSE which will cause the compiler to simply not compile that callback. Later, when your plugin gets initialzed, the location of that callback is set to NULL, so the host bot knows that callback is not used.

Thus, you can ignore packet functions.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

CrAz3D

I think the biggest BCP draw back, for me, is that I couldn't write plugins for my bot, I'd have to rely on others to do this until/if I learn C++.  I think there are a few more people out there that are in the same bboat I am, I GUESS I could upgrade sometime though from my dingy to a yacht.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Arta

I hate to be so stereotypical, but there's already a 'de facto' standard. BC has more plugins than anything else I know of, and is flexible and effective.. Thus, BC's plugin architecture is a sufficiently useful standard.

Perhaps Skywing should consider making BC4's plugin architecture more generalised (eg, less organised around BC's architecture) so that it can serve as a standard, but either way, it's not that important. It's pretty good as is.

Warrior

Kane: I mean't for the plugin structure Networks is working on and how it can do that :P
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Networks

That is nothing official that just something I quickly whipped up in my programming class with a little though prior to it being whipped up. Why do you think of way! :).

MyndFyre

I have used the same general architecture for .NET plugins in pretty much any extensible project I've worked on in .NET, utilizing some type of reflection/interface/base class and then attributes.  That seems to work best and most efficiently for .NET.

I'm hoping to also implement a BCP layer in my next project.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.