diff --git a/BSBshared/BotTypes/BasicBot.cs b/BSBshared/BotTypes/BasicBot.cs index e28fdf3..34b6912 100644 --- a/BSBshared/BotTypes/BasicBot.cs +++ b/BSBshared/BotTypes/BasicBot.cs @@ -22,6 +22,7 @@ namespace BetterSecondBotShared.bottypes protected bool reconnect; public string MyVersion { get { return version; } } public string Name { get { return myconfig.userName; } } + public string OwnerName { get { return myconfig.master; } } public string LastStatusMessage { get; set; } public bool KillMe { get { return killMe; } } diff --git a/Core/Commands/Self/Help.cs b/Core/Commands/Self/Help.cs new file mode 100644 index 0000000..0935628 --- /dev/null +++ b/Core/Commands/Self/Help.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using OpenMetaverse; + + +namespace BSB.Commands.Self +{ + public class Help : CoreCommand + { + + public override string Helpfile { get { return "Makes the bot turn to face [ARG 1] and point at them (if found)"; } } + public override bool CallFunction(string[] args) + { + if (UUID.TryParse(bot.FindAvatarName2Key(bot.OwnerName), out UUID owner) == true) + { + string reply = ""; + int counter = 0; + string addon = ""; + foreach (string a in bot.GetCommandsInterface.GetCommandsList()) + { + reply += addon; + reply += a; + counter++; + if (counter == 5) + { + reply += "\n"; + addon = ""; + counter = 0; + } + else + { + addon = " , "; + } + } + + bot.sendIM(owner, reply); + + return true; + } + else + { + return Failed("UUID is not vaild"); + } + } + } +}