Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Networks on September 25, 2004, 02:55 PM

Title: Plugins (Specialized for bots)
Post by: Networks on September 25, 2004, 02:55 PM
I understand how to load plugins mostly because I was given an example but I don't understand how to associate the plugin with things like a bots events such as when a user joins. I understand the use of host but how can specialize the plugin so that it can load a new whisper window or even associate it with your commands sub so that the user can create their own commands. Any information is appreciated. Thank you in advance. (Please correct me if I am wrong about anything.)
Title: Re:Plugins (Specialized for bots)
Post by: LivedKrad on September 25, 2004, 04:08 PM
Wouldn't a plugin be considered, (in specialized for bots as you say), a custom design AND implementation? How can one help you?
Title: Re:Plugins (Specialized for bots)
Post by: CrAz3D on September 25, 2004, 05:36 PM
You have a function in the bot tell a function in the plugin what is going down.  Then the plugin tells the bot back what the plugin thinks about w/e the bot just said.
Title: Re:Plugins (Specialized for bots)
Post by: Banana fanna fo fanna on September 26, 2004, 09:01 AM
I'd say LoadLibrary or CreateObject would be helpful.
Title: Re:Plugins (Specialized for bots)
Post by: CrAz3D on September 26, 2004, 09:37 AM
After the plugin is already loaded, I know you know how to do this cuz I helped you before...try something similar to this:

In the Bot

Public Function PluginEvent(ByVal Info as string)
    PluginObject.Run Info
end function

Sub EventUserJoinned(Username, Message)
    PluginEvent Username & Message 'this would send the username & the message to the PluginEvent function which would then send the info to the plugin.
end sub


Plugin Code
Public Function Run(ByVal Info as String)
    MsgBox Info
end function



You can add more & you can also use your form as a host so you can send message to battlenet or reconnect or mess with your userlist or w/e else you might want to do.  It's all up to your wonderful imagination.  I suggest using an object array so you can use more than 1 plugin at a time.
Title: Re: Plugins (Specialized for bots)
Post by: Warrior on September 27, 2004, 08:17 PM
So Basicly you have to pre-configure your bot to accept all the Events and Functions it has? So for example BCP Plugins I see can basicly do anything to the bot is all that precoded into a class or something. More information would be appreciated just simply for my knowledge and maybe if I plan to implement plugins in the near future.
Title: Re: Plugins (Specialized for bots)
Post by: Networks on September 28, 2004, 05:45 PM
How would you access functions or sub in a class that's in the host? Such as if I wanted to add user to the databse or check their flags but all that is in a  class? How do I allow a user to create a command function to check these flags and then add them accordingly?
Title: Re: Plugins (Specialized for bots)
Post by: Michael on September 28, 2004, 06:07 PM
How would i go about making a plugin for spth bot v3?
Title: Re: Plugins (Specialized for bots)
Post by: TheMinistered on September 28, 2004, 06:27 PM
If you have a pointer/reference to the object in the plugin (usually all object references are passed upon initialization of the plugin) then you can call any method you want!
Title: Re: Plugins (Specialized for bots)
Post by: UserLoser. on September 28, 2004, 07:07 PM
Quote from: -MichaeL- on September 28, 2004, 06:07 PM
How would i go about making a plugin for spth bot v3?

http://www.valhallalegends.com/pub/bcp/SDK/EmptyPlugin/EmptyPlugin.zip

That's basically what to build off of
Title: Re: Plugins (Specialized for bots)
Post by: TheMinistered on September 28, 2004, 10:29 PM
Userloser, is that a visual basic plugin or a c++ plugin?  If it's C++ then you need ignore that, because it's a totally different schema for visual basic plugins.
Title: Re: Plugins (Specialized for bots)
Post by: Michael on September 29, 2004, 04:00 PM
Well, thank userloser it would be helpful if i knew c++ but if you have a vb one that would be great i am not a very advanced person.
Title: Re: Plugins (Specialized for bots)
Post by: CrAz3D on September 29, 2004, 05:28 PM
Port it to VB?...I don't even know what that means.  Maybe ask someone that does to do it for you, if it is even possible because the difference in the languages may be the difference in it working or not.
Title: Re: Plugins (Specialized for bots)
Post by: UserLoser. on September 29, 2004, 06:43 PM
Quote from: TheMinistered on September 28, 2004, 10:29 PM
Userloser, is that a visual basic plugin or a c++ plugin?  If it's C++ then you need ignore that, because it's a totally different schema for visual basic plugins.

Let me know when you see a BCP that would load with a bot such as SphtBotv3, written in Visual Basic
Title: Re: Plugins (Specialized for bots)
Post by: Networks on October 01, 2004, 12:30 AM
Quote from: TheMinistered on September 28, 2004, 06:27 PM
If you have a pointer/reference to the object in the plugin (usually all object references are passed upon initialization of the plugin) then you can call any method you want!


Example?