Interface IHost
Namespace: Asgard3.Core.Plugin
Assembly: Asgard3.Core.dll
Syntax
public interface IHost
Properties
Client
The BattleNetClient which allows you to do just about everything connection wise.
Declaration
BattleNetClient Client { get; set; }
Property Value
Type | Description |
---|---|
BattleNetClient |
CommandDictionary
The bot profiles command dictionary, remember commands are stored in all upper case letters so it is impossible to add the same command twice.
Declaration
Dictionary<string, ParseCommand> CommandDictionary { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, ParseCommand> |
CommandFlags
The bot profiles command access dictionary, remember commands are stored in all upper case letters so it is impossible to add the same command twice.
Declaration
Dictionary<string, DbFlags> CommandFlags { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, DbFlags> |
UserDatabase
The access database list.
Declaration
UserDatabaseList UserDatabase { get; set; }
Property Value
Type | Description |
---|---|
UserDatabaseList |
Methods
AddChat(Color, String)
Adds the chat to the profile's richtextbox that the plugin is loaded on.
Declaration
void AddChat(Color chatColor, string msg)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | chatColor | The color you want the text to be. |
System.String | msg | The text you wish to add. |
AddCommand(String, DbFlags, ParseCommand)
Adds a command in the command dictionary.
Declaration
void AddCommand(string commandName, DbFlags flags, ParseCommand commandCallBack)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandName | The name of the command. |
DbFlags | flags | the flags required for the command |
ParseCommand | commandCallBack | The method that handles the command. |
AddListView(String, ucListView)
Declaration
TabPage AddListView(string name, ucListView lstView)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
ucListView | lstView |
Returns
Type | Description |
---|---|
System.Windows.Forms.TabPage |
CanDoCommand(String, DbFlags, CommandLocation)
Returns true if the user has the access to do the command.
Declaration
bool CanDoCommand(string username, DbFlags flags, CommandLocation commandLocation)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | The username can be formatted or unformatted. |
DbFlags | flags | The required flags. |
CommandLocation | commandLocation | Where the command is coming commandLocation. |
Returns
Type | Description |
---|---|
System.Boolean | true or false |
FormatUsername(String, FormatUserNameType)
Formats the username based off the settings of the current profile.
Declaration
string FormatUsername(string username, FormatUserNameType typ)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | The username to format. |
FormatUserNameType | typ | The way you would like it formatted. |
Returns
Type | Description |
---|---|
System.String | The formatted username. |
GetEntireProfile()
Gets the entire profile database which contains all settings for this profile.
Declaration
ProfileDatabase GetEntireProfile()
Returns
Type | Description |
---|---|
ProfileDatabase | ProfileDatabase |
GetProfileFilename()
Declaration
string GetProfileFilename()
Returns
Type | Description |
---|---|
System.String |
GetSetting(String)
Gets a setting commandLocation the profile's config.
Declaration
object GetSetting(string variablename)
Parameters
Type | Name | Description |
---|---|---|
System.String | variablename | The variable name. |
Returns
Type | Description |
---|---|
System.Object | The value of the variable. |
RemoveCommand(String)
Removes a command commandLocation the command dictionary.
Declaration
void RemoveCommand(string commandName)
Parameters
Type | Name | Description |
---|---|---|
System.String | commandName | The name of the command to remove. |
RemoveListView(TabPage)
Declaration
void RemoveListView(TabPage tp)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.TabPage | tp |
RemovePluginMenu(ToolStripMenuItem)
Removes the plugin menu.
Declaration
void RemovePluginMenu(ToolStripMenuItem menu)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ToolStripMenuItem | menu |
Respond(UserItem, CommandLocation, String, Object[])
(String.Format) Respond is used to pass responses to commands and such to the bot, if you want to whisper back commands and such should always whisper be set use this.
Declaration
void Respond(UserItem u, CommandLocation commandLocation, string format, params object[] objs)
Parameters
Type | Name | Description |
---|---|---|
UserItem | u | The UserItem of the user to respond too. |
CommandLocation | commandLocation | Where the command comes commandLocation. |
System.String | format | the format string.format will use |
System.Object[] | objs | the arguments passed to string.format |
Respond(UserItem, String, CommandLocation)
Respond is used to pass responses to commands and such to the bot, if you want to whisper back commands and such should always whisper be set use this.
Declaration
void Respond(UserItem u, string message, CommandLocation commandLocation)
Parameters
Type | Name | Description |
---|---|---|
UserItem | u | The UserItem of the user to respond too. |
System.String | message | The message. |
CommandLocation | commandLocation | Where the command comes commandLocation. |
SaveProfile(ProfileDatabase)
Saves changes to the profile database.
Declaration
void SaveProfile(ProfileDatabase pd)
Parameters
Type | Name | Description |
---|---|---|
ProfileDatabase | pd | The updates profile database. |
SaveSetting(String, Object)
Saves a setting in the profile's config.
Declaration
void SaveSetting(string variablename, object variable)
Parameters
Type | Name | Description |
---|---|---|
System.String | variablename | The name of the variable. |
System.Object | variable | The value of the variable. |
SetPluginMenu(ToolStripMenuItem)
Will add the plugins menu to the profile menu area for it.
Declaration
void SetPluginMenu(ToolStripMenuItem menu)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ToolStripMenuItem | menu | The menu structure to be added. |
ShowForm(Object)
Pass a form to the bot for the bot to display.
Declaration
void ShowForm(object frm)
Parameters
Type | Name | Description |
---|---|---|
System.Object | frm |
ShowProfileConfigWindow()
Opens the profile config window to the selected profile.
Declaration
void ShowProfileConfigWindow()
UnloadPlugin()
Allows the plugin to unload itself.
Declaration
void UnloadPlugin()
UnloadProfile()
Will unload the current profile the plugin is loaded on.
Declaration
void UnloadProfile()
Events
EventPluginAddChat
Declaration
event PluginAddChat EventPluginAddChat
Event Type
Type | Description |
---|---|
PluginAddChat |