From 813aa5a330cf265847f6a5d696d5b325239177b1 Mon Sep 17 00:00:00 2001 From: Tikuf Date: Sat, 25 Apr 2020 19:24:03 -0600 Subject: [PATCH 1/2] Great new help --- Core/Commands/Self/Help.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Core/Commands/Self/Help.cs diff --git a/Core/Commands/Self/Help.cs b/Core/Commands/Self/Help.cs new file mode 100644 index 0000000..2db44c7 --- /dev/null +++ b/Core/Commands/Self/Help.cs @@ -0,0 +1,26 @@ +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, out UUID testavatar) == true) + { + + } + else + { + return Failed("UUID is not vaild"); + } + } + } +} From 47c1fe272fb448d8fc1b38b0b09d0568e8530988 Mon Sep 17 00:00:00 2001 From: Tikuf Date: Sat, 25 Apr 2020 19:46:49 -0600 Subject: [PATCH 2/2] Owner Name owner name var added --- BSBshared/BotTypes/BasicBot.cs | 1 + Core/Commands/Self/Help.cs | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) 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 index 2db44c7..0935628 100644 --- a/Core/Commands/Self/Help.cs +++ b/Core/Commands/Self/Help.cs @@ -13,9 +13,31 @@ namespace BSB.Commands.Self 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, out UUID testavatar) == true) + 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 {