Exemplo n.º 1
0
 /// <summary>
 /// Fired when an avatar enters the world.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 static void AvatarEventAdd(BotEngine sender, EventAvatarAddArgs e)
 {
     // Wait 5 seconds, before the greeting message is sent. The message will not be send if the avatar doesn't exist anymore at that time.
     // This is to prevent message flooding.
     sender.ConsoleMessage(5000, SessionArgumentType.AvatarSessionMustExist,
                           e.Avatar, System.Drawing.Color.DarkSlateGray, true, false, string.Format("{0} enters.", e.Avatar.Name));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Fired when an avatar leaves the world
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 static void AvatarEventRemove(BotEngine sender, EventAvatarRemoveArgs e)
 {
     // Wait 5 seconds, before the leave message is sent. The message will not be send if the avatar reenters the world within that time.
     // This is to prevent message flooding.
     sender.ConsoleMessage(5000, SessionArgumentType.AvatarSessionMustNotExist,
                           e.Avatar, System.Drawing.Color.DarkSlateGray, true, false, string.Format("{0} has left {1}.", e.Avatar.Name, sender.LoginConfiguration.Connection.World));
 }
Exemplo n.º 3
0
        void ChatEvent(BotEngine sender, EventChatArgs e)
        {
            var cmd = new CommandLine(e.Message); /* use a simple command line interpreter */

            if (string.IsNullOrEmpty(cmd.Command) || cmd.Command != "!awm" || cmd.Arguments.Count == 0)
            {
                return;
            }

            switch (cmd.Arguments[0].Value.Value)
            {
            case "version":
                sender.ConsoleMessage(Color.Black, true, false, string.Format("Managed Bot Engine Server {0}", sender.Version()));
                break;
            }
        }