diff --git a/SecondBotEvents/Commands/Animation.cs b/SecondBotEvents/Commands/Animation.cs index 9b2c0bb..1a9a073 100644 --- a/SecondBotEvents/Commands/Animation.cs +++ b/SecondBotEvents/Commands/Animation.cs @@ -13,7 +13,7 @@ namespace SecondBotEvents.Commands [ReturnHints("Granted perm animation")] [ReturnHints("Removed perm animation")] [ReturnHintsFailure("avatar lookup")] - [ArgHints("avatar", "UUID (or Firstname Lastname)")] + [ArgHints("avatar", "Who to accept requests from", "AVATAR")] public object AddToAllowAnimations(string avatar) { ProcessAvatar(avatar); @@ -28,7 +28,7 @@ namespace SecondBotEvents.Commands [About("Attempts to play a gesture")] [ReturnHintsFailure("Error with gesture")] [ReturnHints("Accepted")] - [ArgHints("gesture", "Inventory UUID of the gesture")] + [ArgHints("gesture", "What gesture to trigger", "UUID")] public object PlayGesture(string gesture) { if (UUID.TryParse(gesture, out UUID gestureUUID) == false) diff --git a/SecondBotEvents/Commands/Avatars.cs b/SecondBotEvents/Commands/Avatars.cs index 1580add..3b2c0d5 100644 --- a/SecondBotEvents/Commands/Avatars.cs +++ b/SecondBotEvents/Commands/Avatars.cs @@ -15,9 +15,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Unknown store type")] [ReturnHintsFailure("Unable to process request store")] - [ArgHints("store", "What type of request to accept: \"FriendRequest\", \"InventoryOffer\", \"GroupInvite\", \"Teleport\"")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] - [ArgHints("remove", "set to \"true\" or \"True\" to remove that avatar from the accept next for that store type")] + [ArgHints("store", "What type of request to accept", "Text", "GroupInvite", new string[] { "FriendRequest", "InventoryOffer", "GroupInvite", "Teleport" })] + [ArgHints("avatar", "Who to accept the request from", "AVATAR")] + [ArgHints("remove", "Should this remove the entry", "BOOL")] public Object AcceptNext(string store, string avatar, string remove) { ProcessAvatar(avatar); @@ -45,8 +45,8 @@ namespace SecondBotEvents.Commands [ReturnHints("false")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Unknown store type")] - [ArgHints("store", "What type of request to check: \"FriendRequest\", \"InventoryOffer\", \"GroupInvite\", \"Teleport\"")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("store", "What type of request to accept", "Text", "GroupInvite", new string[] { "FriendRequest", "InventoryOffer", "GroupInvite", "Teleport" })] + [ArgHints("avatar", "Who to accept the request from", "AVATAR")] public Object IsOnAcceptNext(string store, string avatar) { ProcessAvatar(avatar); @@ -100,7 +100,7 @@ namespace SecondBotEvents.Commands [ReturnHints("profile UUID")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHints("Requesting avatar details [Retry later]")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("avatar", "Who are we getting the profile image of", "AVATAR")] public object GetProfileImage(string avatar) { ProcessAvatar(avatar); @@ -120,7 +120,7 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHints("Requesting avatar details [Retry later]")] [ReturnHintsFailure("Invaild texture uuid")] - [ArgHints("texture", "a UUID of a texture to use")] + [ArgHints("texture", "What texture to use", "UUID")] public object SetProfileImage(string texture) { if (UUID.TryParse(texture, out UUID textureUUID) == false) @@ -142,7 +142,7 @@ namespace SecondBotEvents.Commands [ReturnHints("profile UUID")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHints("Requesting avatar details [Retry later]")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("avatar", "Who are we getting the profile about of", "AVATAR")] public object GetProfileAbout(string avatar) { ProcessAvatar(avatar); @@ -163,7 +163,7 @@ namespace SecondBotEvents.Commands [ReturnHints("Requesting avatar details [Retry later]")] [ReturnHintsFailure("about text to short")] [ReturnHintsFailure("about text to long")] - [ArgHints("abouttext", "text to use in the about me area, length 10 to 300")] + [ArgHints("abouttext", "text to use in the about me area, length 10 to 300", "Text", "Hello world!")] public object SetProfileAbout(string abouttext) { if(abouttext.Length < 10) @@ -209,7 +209,7 @@ namespace SecondBotEvents.Commands } [About("searchs the AV database if not found triggers a lookup")] - [ArgHints("uuid", "the UUID to find the name for")] + [ArgHints("uuid", "What uuid are we getting the name for", "UUID")] [ReturnHints("the name of the avatar")] [ReturnHints("lookup")] [ReturnHintsFailure("Not a vaild UUID")] @@ -227,7 +227,7 @@ namespace SecondBotEvents.Commands [ReturnHints("the uuid of the avatar")] [ReturnHints("lookup")] [ReturnHintsFailure("Not a vaild name")] - [ArgHints("name", "the name to find the uuid for")] + [ArgHints("name", "the name to find the uuid for", "Text", "Madpeter Zond")] public object Name2Key(string name) { if(name == null) diff --git a/SecondBotEvents/Commands/Chat.cs b/SecondBotEvents/Commands/Chat.cs index a1e07c1..b0fec22 100644 --- a/SecondBotEvents/Commands/Chat.cs +++ b/SecondBotEvents/Commands/Chat.cs @@ -15,8 +15,8 @@ namespace SecondBotEvents.Commands } [About("sends a message to localchat (Normal chat)")] - [ArgHints("channel", "the channel to output on")] - [ArgHints("message", "the message to send")] + [ArgHints("channel", "the channel to output on", "Number", "123")] + [ArgHints("message", "the message to send", "Text", "Hi Mom im on TV")] [ReturnHints("array string")] [ReturnHintsFailure("Message empty")] public object Say(string channel, string message) @@ -35,8 +35,8 @@ namespace SecondBotEvents.Commands } [About("sends a message to localchat (as a Shout)")] - [ArgHints("channel", "the channel to output on")] - [ArgHints("message", "the message to send")] + [ArgHints("channel", "the channel to output on", "Number", "123")] + [ArgHints("message", "the message to send", "Text", "Hi Mom im on TV")] [ReturnHints("array string")] [ReturnHintsFailure("Message empty")] public object Shout(string channel, string message) @@ -55,8 +55,8 @@ namespace SecondBotEvents.Commands } [About("sends a message to localchat (as a Whisper)")] - [ArgHints("channel", "the channel to output on")] - [ArgHints("message", "the message to send")] + [ArgHints("channel", "the channel to output on", "Number", "123")] + [ArgHints("message", "the message to send", "Text", "Hi Mom im on TV")] [ReturnHints("array string")] [ReturnHintsFailure("Message empty")] public object Whisper(string channel, string message) @@ -77,8 +77,8 @@ namespace SecondBotEvents.Commands [About("sends a im to the selected avatar")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] - [ArgHints("message", "the message to send")] + [ArgHints("avatar", "Who to send the messsage to", "AVATAR")] + [ArgHints("message", "the message to send", "Text", "Hi there how are you today?")] [ReturnHints("ok")] [ReturnHintsFailure("Message empty")] [ReturnHintsFailure("avatar lookup")] @@ -120,7 +120,7 @@ namespace SecondBotEvents.Commands } [About("gets the chat from the selected window for avatar")] - [ArgHints("window", "the UUID of the avatar you wish to view the chat from")] + [ArgHints("window", "avatar UUID you wish to view the chat from", "UUID")] [ReturnHintsFailure("avatar UUID invaild")] [ReturnHints("Array of text")] public object getimchat(string avatarid) diff --git a/SecondBotEvents/Commands/Dialogs.cs b/SecondBotEvents/Commands/Dialogs.cs index e6d7f5e..e7a5200 100644 --- a/SecondBotEvents/Commands/Dialogs.cs +++ b/SecondBotEvents/Commands/Dialogs.cs @@ -12,7 +12,7 @@ namespace SecondBotEvents.Commands [ReturnHints("removed")] [ReturnHintsFailure("unable to find avatar")] [ReturnHintsFailure("looking up avatar please try again")] - [ArgHints("avatar", "the UUID or avatar name to add")] + [ArgHints("avatar", "Who to send the dialog relay to", "AVATAR")] public object DialogRelayAvatarTarget(string avatar) { if(UUID.TryParse(avatar, out UUID avUUID) == false) @@ -35,7 +35,7 @@ namespace SecondBotEvents.Commands [ReturnHints("removed")] [ReturnHintsFailure("channel must be zero or more")] [ReturnHintsFailure("channel is not vaild")] - [ArgHints("channel", "a number >= 0")] + [ArgHints("channel", "what channel number to send the reply to (must be zero or higher)","Number", "123")] public object DialogRelayChatTarget(string channel) { if (int.TryParse(channel, out int channelnum) == false) @@ -53,7 +53,7 @@ namespace SecondBotEvents.Commands [ReturnHints("added")] [ReturnHints("removed")] [ReturnHintsFailure("url must start with http")] - [ArgHints("url", "a vaild http url")] + [ArgHints("url", "the URL to send the replys to","URL","http://mycoolsite.com/botdialog.php")] public object DialogRelayHttpTarget(string url) { if(url.StartsWith("http") == false) @@ -69,8 +69,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild dialog window")] [ReturnHintsFailure("Invaild dialog button")] [ReturnHintsFailure("bad dialog id")] - [ArgHints("dialogid", "The ID for the dialog")] - [ArgHints("buttontext", "The button text to push")] + [ArgHints("dialogid", "The ID for the dialog","Number","442")] + [ArgHints("buttontext", "The button text to push","Text","Unlock")] public object DialogResponce(string dialogid, string buttontext) { if (int.TryParse(dialogid, out int dialogidnum) == false) diff --git a/SecondBotEvents/Commands/Discord.cs b/SecondBotEvents/Commands/Discord.cs index e4604bd..6e007ea 100644 --- a/SecondBotEvents/Commands/Discord.cs +++ b/SecondBotEvents/Commands/Discord.cs @@ -11,9 +11,9 @@ namespace SecondBotEvents.Commands [About("Adds a discord server role to the selected member")] [ReturnHintsFailure("Discord client not ready")] [ReturnHints("true|false")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("roleid", "the role id we are giving")] - [ArgHints("memberid", "who we are giving it to")] + [ArgHints("serverid", "the server id to apply this action to","Number","1234555123")] + [ArgHints("roleid", "the role id we are giving", "Number", "445442441")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] public object Discord_AddRole(string serverid,string roleid,string memberid) { if (master.DiscordService.DiscordReady() == false) @@ -27,9 +27,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Discord client not ready")] [ReturnHintsFailure("Why empty")] [ReturnHints("true|false")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("memberid", "who we are giving it to")] - [ArgHints("why", "why they are being banned")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] + [ArgHints("why", "why they are being banned", "Text", "Spammer")] public object Discord_BanMember(string serverid, string memberid, string why) { if (master.DiscordService.DiscordReady() == false) @@ -43,6 +43,12 @@ namespace SecondBotEvents.Commands return BasicReply(master.DiscordService.BanMember(serverid, memberid, why).Result.ToString(), [serverid, memberid, why]); } + [ReturnHintsFailure("Discord client not ready")] + [ReturnHintsFailure("Get roles failure message")] + [ReturnHints("json object of roles")] + [About("Gets the roles assigned to the selected member")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] public object Discord_GetMemberRoles(string serverid, string memberid) { if (master.DiscordService.DiscordReady() == false) @@ -60,8 +66,8 @@ namespace SecondBotEvents.Commands [About("Clears messages on the server sent by the member in the last 13 days, 22hours 59mins")] [ReturnHintsFailure("Discord client not ready")] [ReturnHints("true|false")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("memberid", "who we are giving it to")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] public object Discord_BulkClear_Messages(string serverid, string memberid) { if (master.DiscordService.DiscordReady() == false) @@ -74,9 +80,9 @@ namespace SecondBotEvents.Commands [About("Sends a message directly to the user [They must be in the server]\n This command requires the SERVER MEMBERS INTENT found in discord app dev")] [ReturnHintsFailure("Discord client not ready")] [ReturnHints("true|false")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("memberid", "who we are giving it to")] - [ArgHints("message", "what we are sending")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] + [ArgHints("message", "what we are sending", "Text", "Whats going on")] public object Discord_Dm_Member(string serverid, string memberid, string message) { if (master.DiscordService.DiscordReady() == false) @@ -91,7 +97,7 @@ namespace SecondBotEvents.Commands "SERVER MEMBERS INTENT set to true on the discord bot api area !!!")] [ReturnHintsFailure("Discord client not ready")] [ReturnHints("mixed array of userid: nickname|username or userid:username")] - [ArgHints("serverid", "the server id to apply this action to")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] public object Discord_MembersList(string serverid) { if (master.DiscordService.DiscordReady() == false) @@ -105,10 +111,10 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Discord client not ready")] [ReturnHintsFailure("message empty")] [ReturnHints("true|false")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("channelid", "the channel id to apply this action to")] - [ArgHints("tts", "shoud tts be enabled true or false")] - [ArgHints("message", "what we are sending")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("channelid", "the channel id to apply this action to", "Number", "552121543")] + [ArgHints("tts", "shoud tts be enabled","BOOL")] + [ArgHints("message", "what we are sending", "Text", "Hi everyone in channel")] public object Discord_MessageChannel(string serverid, string channelid, string tts, string message) { if (master.DiscordService.DiscordReady() == false) @@ -125,9 +131,9 @@ namespace SecondBotEvents.Commands [About("Sends a message to the selected channel - Optional TTS usage")] [ReturnHints("mixed array of userid: nickname|username or userid:username")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("memberid", "who we are giving it to")] - [ArgHints("mode", "should we mute them \"true\" or unmute \"false\"")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("memberid", "who we are giving it to", "Number", "66522144")] + [ArgHints("mode", "should we mute them", "BOOL")] public object Discord_MuteMember(string serverid, string memberid, string mode) { if (master.DiscordService.DiscordReady() == false) @@ -140,9 +146,8 @@ namespace SecondBotEvents.Commands [About("returns a collection of settings for the given role \n This command requires Discord full client mode enabled and connected")] [ReturnHints("KeyPair of status: KeyPair[] item = value")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("memberid", "who we are giving it to")] - [ArgHints("mode", "should we mute them \"true\" or unmute \"false\"")] + [ArgHints("serverid", "the server id", "Number", "1234555123")] + [ArgHints("roleid", "the role id", "Number", "66522144")] public object Discord_Role_GetSettings(string serverid, string roleid) { if (master.DiscordService.DiscordReady() == false) @@ -156,9 +161,9 @@ namespace SecondBotEvents.Commands " This command requires Discord full client mode enabled and connected")] [ReturnHints("true|false")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("roleid", "who we are giving it to")] - [ArgHints("flagscsv", "what we are setting")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("roleid", "the role id", "Number", "66522144")] + [ArgHints("flagscsv", "what we are setting", "Text", "Speak=True,SendMessages=False")] public object Discord_Role_UpdatePerms(string serverid, string roleid, string flagscsv) { if (master.DiscordService.DiscordReady() == false) @@ -172,8 +177,8 @@ namespace SecondBotEvents.Commands " This command requires Discord full client mode enabled and connected")] [ReturnHints("KeyPair of statusmessage=roleid or 0")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] - [ArgHints("role", "the name of the role we are creating")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] + [ArgHints("role", "the name of the role we are creating", "Text", "Buyersclub")] public object Discord_RoleCreate(string serverid, string role) { if (master.DiscordService.DiscordReady() == false) @@ -186,7 +191,7 @@ namespace SecondBotEvents.Commands [About("Returns a list of roles and their ids in collection \n This command requires Discord full client mode enabled and connected")] [ReturnHints("KeyPair of status: KeyPair of roleid: rolename")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] public object Discord_RoleList(string serverid) { if (master.DiscordService.DiscordReady() == false) @@ -199,7 +204,7 @@ namespace SecondBotEvents.Commands [About("Remove a role from a server \n This command requires Discord full client mode enabled and connected")] [ReturnHints("true|false")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] public object Discord_RoleRemove(string serverid, string roleid) { if (master.DiscordService.DiscordReady() == false) @@ -212,7 +217,7 @@ namespace SecondBotEvents.Commands [About("Returns a list of text channels in a server")] [ReturnHints("array of channelid: name")] [ReturnHintsFailure("Discord client not ready")] - [ArgHints("serverid", "the server id to apply this action to")] + [ArgHints("serverid", "the server id to apply this action to", "Number", "1234555123")] public object Discord_TextChannels_List(string serverid) { if (master.DiscordService.DiscordReady() == false) diff --git a/SecondBotEvents/Commands/Estate.cs b/SecondBotEvents/Commands/Estate.cs index 2a20c85..05d21d4 100644 --- a/SecondBotEvents/Commands/Estate.cs +++ b/SecondBotEvents/Commands/Estate.cs @@ -13,8 +13,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Not an estate manager here")] [ReturnHints("canceled")] [ArgHints("delay", "How long to delay the restart for (30 to 240 secs) - defaults to 240 if out of bounds \n" + - "set to 0 if your canceling!")] - [ArgHints("mode", "true to start a restart, false to cancel")] + "set to 0 if your canceling!", "Number", "60")] + [ArgHints("mode", "true to start a restart, false to cancel", "BOOL")] public object SimRestart(string delay, string mode) { if (GetClient().Network.CurrentSim.IsEstateManager == false) @@ -40,7 +40,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Not an estate manager here")] [ReturnHintsFailure("Message empty")] [ReturnHints("ok")] - [ArgHints("message", "What the message is")] + [ArgHints("message", "What the message is", "Text", "Hi everyone I need to restart this sim")] public object SimMessage(string message) { if (SecondbotHelpers.notempty(message) == false) @@ -58,7 +58,7 @@ namespace SecondBotEvents.Commands [About("Fetchs the regions map tile")] [ReturnHintsFailure("Unable to find region")] [ReturnHints("Texture UUID")] - [ArgHints("regionname", "the name of the region we are fetching")] + [ArgHints("regionname", "the name of the region we are fetching", "Text", "Lostworld")] public object GetSimTexture(string regionname) { if (GetClient().Grid.GetGridRegion(regionname, GridLayerType.Objects, out GridRegion region) == false) @@ -83,7 +83,7 @@ namespace SecondBotEvents.Commands } [About("Gets the global location of a sim [region]")] - [ArgHints("regionname", "the region we want")] + [ArgHints("regionname", "the region we want", "Text", "Lostworld")] [ReturnHintsFailure("Unable to find region")] [ReturnHints("a json object with the x,y and region name")] public object GetSimGlobalPos(string regionname) @@ -114,9 +114,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to find avatar UUID")] [ReturnHintsFailure("Unable to process global value please use true or false")] [ReturnHintsFailure("Not an estate manager on region {REGIONNAME}")] - [ArgHints("avatar", "the uuid avatar you wish to ban")] - [ArgHints("mode", "What action would you like to take
Defaults to remove if not given \"add\"")] - [ArgHints("global", "if true this the ban/unban will be applyed to all estates the bot has access to")] + [ArgHints("avatar", "avatar you wish to ban", "AVATAR")] + [ArgHints("mode", "What action would you like to take
Defaults to remove if not given \"add\"", "Text", "add", new string[] {"add","remove"})] + [ArgHints("global", "if true this the ban/unban will be applyed to all estates the bot has access to", "BOOL")] public object UpdateEstateBanlist(string avatar, string mode, string global) { diff --git a/SecondBotEvents/Commands/Friends.cs b/SecondBotEvents/Commands/Friends.cs index 6e0c139..1345244 100644 --- a/SecondBotEvents/Commands/Friends.cs +++ b/SecondBotEvents/Commands/Friends.cs @@ -13,7 +13,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("avatar lookup")] [ReturnHintsFailure("not in friends list")] [ReturnHintsFailure("no map access or updating")] - [ArgHints("avatar", "A avatar uuid or Firstname Lastname")] + [ArgHints("avatar", "Who to get the location of","AVATAR")] public object FriendsGetLocation(string avatar) { ProcessAvatar(avatar); @@ -57,8 +57,8 @@ namespace SecondBotEvents.Commands } [About("Updates the friend perms for avatar avatar to State \n if true grants (Online/Map/Modify) perms")] - [ArgHints("avatar", "A avatar uuid or Firstname Lastname")] - [ArgHints("state", "true: Grant perms, false: Remove perms")] + [ArgHints("avatar", "Who we are talking about","AVATAR")] + [ArgHints("state", "true: Grant perms, false: Remove perms","BOOL")] [ReturnHints("granted")] [ReturnHints("removed")] [ReturnHintsFailure("Not A friend")] @@ -95,8 +95,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Not in friendslist")] [ReturnHintsFailure("state invaild")] [ReturnHintsFailure("avatar lookup")] - [ArgHints("avatar", "A avatar uuid or Firstname Lastname")] - [ArgHints("state", "true: Send invite, false: Remove from friendslist")] + [ArgHints("avatar", "Who to request/remove from friends list","AVATAR")] + [ArgHints("state", "true: Send invite, false: Remove from friendslist","BOOL")] public object FriendRequest(string avatar, string state) { ProcessAvatar(avatar); diff --git a/SecondBotEvents/Commands/Funds.cs b/SecondBotEvents/Commands/Funds.cs index 400d399..022c3db 100644 --- a/SecondBotEvents/Commands/Funds.cs +++ b/SecondBotEvents/Commands/Funds.cs @@ -26,8 +26,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Amount out of range")] [ReturnHintsFailure("Invaild amount")] [ReturnHintsFailure("Transfer funds to avatars disabled")] - [ArgHints("avatar", "the avatars UUID or Firstname Lastname")] - [ArgHints("amount", "the amount to pay (from 1 to current balance)")] + [ArgHints("avatar", "Who to pay", "AVATAR")] + [ArgHints("amount", "the amount to pay (from 1 to current balance)", "Number", "442")] public object PayAvatar(string avatar, string amount) { if (master.CommandsService.myConfig.GetAllowFundsCommands() == false) @@ -59,9 +59,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild amount")] [ReturnHintsFailure("Amount out of range")] [ReturnHintsFailure("Funds commands are disabled")] - [ArgHints("object", "UUID of the object to pay")] - [ArgHints("primname", "The name of the prim on the object to pay")] - [ArgHints("amount", "the amount to pay (from 1 to current balance)")] + [ArgHints("object", "Object to pay","UUID")] + [ArgHints("primname", "The name of the prim on the object to pay","Text","MyBank")] + [ArgHints("amount", "the amount to pay (from 1 to current balance)","Number","312")] public object PayObject(string objectuuid,string primname,string amount) { if (master.CommandsService.myConfig.GetAllowFundsCommands() == false) diff --git a/SecondBotEvents/Commands/Group.cs b/SecondBotEvents/Commands/Group.cs index e2451f8..2b0ddf8 100644 --- a/SecondBotEvents/Commands/Group.cs +++ b/SecondBotEvents/Commands/Group.cs @@ -14,8 +14,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown group")] [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("avatar lookup")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("avatar", "the UUID of the avatar you wish to check with")] + [ArgHints("group", "What group to check","UUID")] + [ArgHints("avatar", "The avatar in check","AVATAR")] public object IsGroupMember(string group, string avatar) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -32,7 +32,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown group")] [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("avatar lookup")] - [ArgHints("group", "the UUID of the group")] + [ArgHints("group", "the group to get members list from","UUID")] public object GetGroupMembers(string group) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -49,9 +49,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("avatar lookup")] [ReturnHintsFailure("Missing group GroupBanAccess power")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("avatar", "the UUID of the avatar or Firstname Lastname")] - [ArgHints("state", "true to ban false to unban")] + [ArgHints("group", "the group to apply the ban in","UUID")] + [ArgHints("avatar", "the avatar to ban/unban","AVATAR")] + [ArgHints("state", "true to ban false to unban","BOOL")] public object GroupBan(string group, string avatar, string state) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -90,8 +90,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Not in group")] [ReturnHintsFailure("avatar lookup")] [ReturnHintsFailure("Missing group Eject power")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("avatar", "the UUID of the avatar you wish to check with")] + [ArgHints("group", "the group to eject from", "UUID")] + [ArgHints("avatar", "the avatar to remove from the group", "UUID")] public object GroupEject(string group, string avatar) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -119,8 +119,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("Invaild role UUID")] [ReturnHintsFailure("avatar lookup")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("avatar", "the UUID of the avatar you wish to check with")] + [ArgHints("group", "the group to give the avatar the new role for","UUID")] + [ArgHints("avatar", "the avatar to give the role to", "AVATAR")] + [ArgHints("role", "the role to give the avatar in the group", "UUID")] public object GroupAddRole(string group, string avatar, string role) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -153,9 +154,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("avatar lookup")] [ReturnHintsFailure("Missing group Invite power")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("avatar", "the UUID of the avatar you wish to check with")] - [ArgHints("role", "the UUID of the role to invite them at the word \"everyone\"")] + [ArgHints("group", "the group to invite to","UUID")] + [ArgHints("avatar", "the avatar you wish to invite","AVATAR")] + [ArgHints("role", "the role to invite them with or \"everyone\" to give the default role","UUID","everyone")] public object GroupInvite(string group, string avatar, string role) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -194,9 +195,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Title empty")] [ReturnHintsFailure("Message empty")] [ReturnHintsFailure("Missing group Notice power")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("title", "The title of the group notice")] - [ArgHints("message", "The body of the group notice")] + [ArgHints("group", "the group to send the notice to", "UUID")] + [ArgHints("title", "The title of the group notice", "Text", "New releases")] + [ArgHints("message", "The body of the group notice", "Text", "We have 4 new items in store with 5% off for the first hour!")] public object Groupnotice(string group, string title, string message) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -230,8 +231,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown group")] [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("Invaild role UUID")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("role", "the UUID of the role")] + [ArgHints("group", "the group to get the role from", "UUID")] + [ArgHints("role", "the role to fetch the title from", "UUID")] public object GroupActiveTitle(string group, string role) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -254,7 +255,7 @@ namespace SecondBotEvents.Commands [ReturnHints("Switching active group")] [ReturnHintsFailure("Unknown group")] [ReturnHintsFailure("Invaild group UUID")] - [ArgHints("group", "the UUID of the group")] + [ArgHints("group", "the group to set as active", "UUID")] public object GroupActiveGroup(string group) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -277,10 +278,10 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Title empty")] [ReturnHintsFailure("Message empty")] [ReturnHintsFailure("Missing group Notice power")] - [ArgHints("group", "the UUID of the group")] - [ArgHints("title", "The title of the group notice")] - [ArgHints("message", "The body of the group notice")] - [ArgHints("attachment", "the UUID of inventory you wish to attach")] + [ArgHints("group", "the group to send the notice to", "UUID")] + [ArgHints("title", "The title of the group notice","Text","Update to terms for rentals")] + [ArgHints("message", "The body of the group notice","Text", "Hi everyone there has been a TOS update please check and review")] + [ArgHints("attachment", "the inventory to send", "UUID")] public object GroupnoticeWithAttachment(string group, string title, string message, string attachment) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -335,7 +336,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Group is not currently known")] [ReturnHintsFailure("Invaild group UUID")] [ReturnHintsFailure("Updating")] - [ArgHints("group", "the UUID of the group")] + [ArgHints("group", "the group to get roles from", "UUID")] public object GetGroupRoles(string group) { if (UUID.TryParse(group, out UUID groupuuid) == false) @@ -360,7 +361,7 @@ namespace SecondBotEvents.Commands [ReturnHints("true|false")] [ReturnHintsFailure("Unknown group")] [ReturnHintsFailure("group value is invaild")] - [ArgHints("group", "the UUID of the group")] + [ArgHints("group", "the group to check if it has any unread messages", "UUID")] public object GroupchatGroupHasUnread(string group) { if(UUID.TryParse(group,out UUID groupUUID) == false) @@ -393,7 +394,7 @@ namespace SecondBotEvents.Commands [About("fetchs the groupchat history")] [ReturnHintsFailure("Group UUID invaild")] [ReturnHints("Group Chat")] - [ArgHints("group", "the UUID of the group")] + [ArgHints("group", "what group to get the chat history of","UUID")] public object GroupchatHistory(string group) { if (UUID.TryParse(group, out UUID groupUUID) == false) @@ -404,8 +405,8 @@ namespace SecondBotEvents.Commands } [About("sends a message to the groupchat")] - [ArgHints("group", "UUID of the group")] - [ArgHints("message", "the message to send")] + [ArgHints("group", "what group to send a message to","UUID")] + [ArgHints("message", "the message to send","Text","Hello everyone")] [ReturnHints("Sending")] [ReturnHintsFailure("Group UUID invaild")] [ReturnHintsFailure("Unknown group")] diff --git a/SecondBotEvents/Commands/Inventory.cs b/SecondBotEvents/Commands/Inventory.cs index 0da550b..ad8bb1c 100644 --- a/SecondBotEvents/Commands/Inventory.cs +++ b/SecondBotEvents/Commands/Inventory.cs @@ -20,8 +20,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("No action")] [ReturnHintsFailure("Events service is not running")] [ReturnHints("Event added")] - [ArgHints("inventoryType", "Types: texture,sound,callcard,landmark,clothing,object,notecard,lsltext,lslbyte,animatn,gesture,mesh")] - [ArgHints("outputTarget", "HTTP url, channel, avatar UUID or clear to remove all events for the selected type")] + [ArgHints("inventoryType", "What type to watch for", "Text", "texture", new string[] { "texture","sound","callcard","landmark","clothing", + "object","notecard","lsltext","lslbyte","animation","gesture","mesh" })] + [ArgHints("outputTarget", "Where to send the updates to", "SMART")] public object SetInventoryUpdate(string inventoryType, string outputTarget) { if (master.EventsService.isRunning() == true) @@ -34,8 +35,8 @@ namespace SecondBotEvents.Commands [About("Uploads a new sound file to inventory")] [ReturnHints("ok")] - [ArgHints("sourcePath", "accepts a file path to a wave PCM file @ 44100")] - [ArgHints("inventoryName", "the name in secondlife")] + [ArgHints("sourcePath", "accepts a file path to a wave PCM file @ 44100", "FILE")] + [ArgHints("inventoryName", "the name in secondlife", "Text", "mycoolsound")] public object UploadMediaWave(string sourcePath, string inventoryName) { byte[] audioData = File.ReadAllBytes(sourcePath); @@ -76,12 +77,12 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to find item")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] - [ArgHints("item", "UUID of item to rez")] + [ArgHints("item", "What to rez", "UUID")] public object RezObject(string item) { if (UUID.TryParse(item, out UUID targetitem) == false) { - return Failure("Invaild item UUID: "+ item, [item]); + return Failure("Invaild item UUID: " + item, [item]); } KeyValuePair tests = SetupCurrentParcel(); if (tests.Key == false) @@ -117,7 +118,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to find item")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] - [ArgHints("item", "UUID of item to rez")] + [ArgHints("item", "what to rez", "UUID")] public object RezObjectParcelCenter(string item) { if (UUID.TryParse(item, out UUID targetitem) == false) @@ -147,9 +148,9 @@ namespace SecondBotEvents.Commands { return Failure("Unable to find item: " + item, [item]); } - float x = targetparcel.AABBMin.X + ((targetparcel.AABBMax.X- targetparcel.AABBMin.X) / 2); + float x = targetparcel.AABBMin.X + ((targetparcel.AABBMax.X - targetparcel.AABBMin.X) / 2); float y = targetparcel.AABBMin.Y + ((targetparcel.AABBMax.Y - targetparcel.AABBMin.Y) / 2); - Vector3 resat = new Vector3(x,y, GetClient().Self.RelativePosition.Z); + Vector3 resat = new Vector3(x, y, GetClient().Self.RelativePosition.Z); UUID rezedobject = GetClient().Inventory.RequestRezFromInventory(GetClient().Network.CurrentSim, GetClient().Self.SimRotation, resat, itm); return BasicReply(rezedobject.ToString(), [item]); } @@ -160,11 +161,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Unable to unpack [X,y,z] cord")] - [ArgHints("item", "UUID of item to rez")] - [ArgHints("x", "X cord to rez at")] - [ArgHints("y", "Y cord to rez at")] - [ArgHints("z", "Z cord to rez at")] - public object RezObjectOnPos(string item,string x,string y,string z) + [ArgHints("item", "what to rez", "UUID")] + [ArgHints("x", "X cord to rez at", "Number", "123")] + [ArgHints("y", "Y cord to rez at", "Number", "45")] + [ArgHints("z", "Z cord to rez at", "Number", "26")] + public object RezObjectOnPos(string item, string x, string y, string z) { if (UUID.TryParse(item, out UUID targetitem) == false) { @@ -216,8 +217,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("invaild item uuid")] [ReturnHintsFailure("Item name is to short")] [ReturnHintsFailure("Unable to find inventory item")] - [ArgHints("item", "UUID of item/folder to name")] - [ArgHints("newname", "What we are changing it to")] + [ArgHints("item", "item/folder to name", "UUID")] + [ArgHints("newname", "What we are changing it to", "Text", "Better name")] public object RenameInventory(string item, string newname) { if (UUID.TryParse(item, out UUID target) == false) @@ -241,7 +242,7 @@ namespace SecondBotEvents.Commands [About("Attempts to Remove the given inventory item")] [ReturnHints("ok")] [ReturnHintsFailure("invaild item uuid")] - [ArgHints("item", "UUID of item")] + [ArgHints("item", "what item are we Deleting", "UUID")] public object DeleteInventoryItem(string item) { if (UUID.TryParse(item, out UUID target) == false) @@ -255,7 +256,7 @@ namespace SecondBotEvents.Commands [About("Attempts to Remove the given inventory folder")] [ReturnHints("ok")] [ReturnHintsFailure("invaild folder uuid")] - [ArgHints("folder", "UUID of folder")] + [ArgHints("folder", "what folder are we removing", "UUID")] public object DeleteInventoryFolder(string folder) { if (UUID.TryParse(folder, out UUID target) == false) @@ -268,11 +269,11 @@ namespace SecondBotEvents.Commands [About("Attempts to attach the given inventory item")] [ReturnHints("ok")] - [ReturnHintsFailure("invaild item uuid")] - [ArgHints("item", "UUID of item")] + [ReturnHintsFailure("invaild item uuid")] + [ArgHints("item", "what item are we attaching", "UUID")] public object Attach(string item) { - if (UUID.TryParse(item,out UUID itemuuid) == false) + if (UUID.TryParse(item, out UUID itemuuid) == false) { return Failure("invaild item uuid", [item]); } @@ -285,7 +286,7 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHints("okMulti")] [ReturnHintsFailure("invaild item uuid pr invaild attach point")] - [ArgHints("item", "UUID of item, or the attach point, or * to remove everything")] + [ArgHints("item", "UUID of item, or the attach point, or * to remove everything", "Text", "Left Hand")] public object Detach(string item) { if (UUID.TryParse(item, out UUID itemuuid) == false) @@ -293,23 +294,23 @@ namespace SecondBotEvents.Commands List toBeRemoved = []; foreach (KeyValuePair pair in GetClient().Appearance.GetAttachmentsByItemId()) { - if((pair.Value.ToString() != item) || (item == "*")) + if ((pair.Value.ToString() != item) || (item == "*")) { continue; } toBeRemoved.Add(HelperInventory.getItemByInventoryUUID(GetClient(), pair.Key)); } - if(toBeRemoved.Count == 0) + if (toBeRemoved.Count == 0) { return Failure("invaild item uuid pr invaild attach point", [item]); } - foreach(InventoryItem A in toBeRemoved) + foreach (InventoryItem A in toBeRemoved) { GetClient().Appearance.RemoveFromOutfit(A); } return BasicReply("ok", [item]); } - + InventoryItem realitem = HelperInventory.getItemByInventoryUUID(GetClient(), itemuuid); GetClient().Appearance.RemoveFromOutfit(realitem); return BasicReply("Ok", [item]); @@ -322,11 +323,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Cant find target folder")] [ReturnHintsFailure("invaild folder uuid")] [ReturnHintsFailure("target folder is empty or so full I cant get it in 5 secs...")] - [ArgHints("folder", "UUID of the folder")] + [ArgHints("folder", "what folder are we swapping to", "UUID")] public object SwapOutfit(string folder) { UUID folderUUID = UUID.Zero; - if(UUID.TryParse(folder, out folderUUID) == false) + if (UUID.TryParse(folder, out folderUUID) == false) { return Failure("invaild folder uuid", [folder]); } @@ -353,7 +354,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Cant find Clothing folder")] [ReturnHintsFailure("Cant find target folder")] [ReturnHintsFailure("target folder is empty or so full I cant get it in 5 secs...")] - [ArgHints("name", "Name of the folder")] + [ArgHints("name", "Name of the folder", "Text", "My other outfit")] public object Outfit(string name) { if (SecondbotHelpers.notempty(name) == false) @@ -453,7 +454,7 @@ namespace SecondBotEvents.Commands [About("converts a inventory uuid to a realworld uuid
Needed for texture preview")] [ReturnHints("Asset UUID or UUID zero")] [ReturnHintsFailure("Invaild item uuid")] - [ArgHints("item", "inventory level UUID of item")] + [ArgHints("item", "inventory level item", "UUID")] public object GetRealUUID(string item) { if (UUID.TryParse(item, out UUID itemUUID) == false) @@ -469,8 +470,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Failed")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Unable to find item")] - [ArgHints("path", "item name and path example: Notecard/sendme or Objects/DemoItem")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("path", "item path and name", "Text", "Objects/DemoItem")] + [ArgHints("avatar", "Who we are sending it to", "AVATAR")] public object SendItemByPath(string path, string avatar) { ProcessAvatar(avatar); @@ -479,7 +480,7 @@ namespace SecondBotEvents.Commands return Failure("Invaild avatar uuid", [path, avatar]); } UUID targetitem = GetClient().Inventory.FindObjectByPath(GetClient().Inventory.Store.RootFolder.UUID, GetClient().Self.AgentID, path, TimeSpan.FromSeconds(15)); - if(targetitem == UUID.Zero) + if (targetitem == UUID.Zero) { return Failure("Unable to find item via path", [path, avatar]); } @@ -498,12 +499,12 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Invaild item uuid")] [ReturnHintsFailure("Unable to find item")] - [ArgHints("item", "UUID of item")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("item", "what are we sending", "UUID")] + [ArgHints("avatar", "Who are we sending it to", "AVATAR")] public object SendItem(string item, string avatar) { ProcessAvatar(avatar); - if(avataruuid == UUID.Zero) + if (avataruuid == UUID.Zero) { return Failure("Invaild avatar uuid", [item, avatar]); } @@ -525,10 +526,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Invaild item uuid")] [ReturnHintsFailure("Invaild item name")] - [ArgHints("itemuuid", "UUID of item in inventory")] - [ArgHints("itemname", "the name of the item in inventory")] - [ArgHints("itemtype", "texture, sound, callcard, landmark, lsltext, clothing, object, notecard, animatn, gesture, mesh, material")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("itemuuid", "What are we sending", "UUID")] + [ArgHints("itemname", "what name should it have", "Text", "My cool item", + new string[] { "texture", "sound", "callcard", "landmark", "lsltext", "clothing", "object", + "notecard", "animatn", "gesture", "mesh", "material" })] + [ArgHints("avatar", "Who are we sending it to","AVATAR")] public object SendItemDirect(string itemuuid, string itemname, string itemtype, string avatar) { if (UUID.TryParse(itemuuid, out UUID targetitem) == false) @@ -570,8 +572,8 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Unable to find folder")] - [ArgHints("path", "path to the folder from root")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("path", "path to the folder from root","Text","Objects/MyFolderToSend")] + [ArgHints("avatar", "Who are we sending it to","AVATAR")] public object SendFolderByPath(string path, string avatar) { ProcessAvatar(avatar); @@ -595,8 +597,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("Invaild folter uuid")] [ReturnHintsFailure("Unable to find folder")] - [ArgHints("item", "UUID of item")] - [ArgHints("avatar", "a UUID or Firstname Lastname")] + [ArgHints("item", "what folder are we sending","UUID")] + [ArgHints("avatar", "Who are we sending it to", "AVATAR")] public object SendFolder(string folder, string avatar) { ProcessAvatar(avatar); @@ -625,9 +627,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to find inventory")] [ReturnHintsFailure("Unable to find object")] [ReturnHintsFailure("Invaild running")] - [ArgHints("item", "UUID of item")] - [ArgHints("object", "the uuid of the object")] - [ArgHints("running", "true if you wish the transfered script to be running otherwise false")] + [ArgHints("item", "what are we sending","UUID")] + [ArgHints("object", "were are we sending it","UUID")] + [ArgHints("running", "should it be running","BOOL")] public object TransferInventoryToObject(string item, string objectuuid, string running) { if (UUID.TryParse(item, out UUID itemuuid) == false) @@ -696,7 +698,7 @@ namespace SecondBotEvents.Commands } [About("Requests folders limited to selected folder")] - [ArgHints("targetfolder", "the UUID of the folder or root")] + [ArgHints("targetfolder", "the folder to look up","UUID")] [ReturnHints("single InventoryMapFolder")] [ReturnHintsFailure("Error")] public object InventoryFoldersLimited(string targetfolder) @@ -709,7 +711,7 @@ namespace SecondBotEvents.Commands [About("Requests the contents of a folder as an array of InventoryMapItem
Formated as follows
InventoryMapItem
  • id: UUID
  • name: String
  • typename: String
")] [ReturnHints("array of InventoryMapItem")] [ReturnHintsFailure("Invaild folder UUID")] - [ArgHints("folderUUID", "the folder to fetch (Found via: inventory/folders)")] + [ArgHints("folderUUID", "the folder to fetch (Found via: inventory/folders)","UUID")] public object InventoryContents(string folderUUID) { if (UUID.TryParse(folderUUID, out UUID folder) == false) @@ -723,8 +725,8 @@ namespace SecondBotEvents.Commands [ReturnHints("Ok")] [ReturnHintsFailure("invaild parent folder UUID")] [ReturnHintsFailure("new folder name is too short, must be longer than 3 characters.")] - [ArgHints("parentFolder", "UUID of folder to create a subfolder in")] - [ArgHints("folderName", "name of the new folder")] + [ArgHints("parentFolder", "folder to create a subfolder in","UUID")] + [ArgHints("folderName", "name of the new folder","Text","MyNewFolder")] public object CreateInventoryFolder(string parentFolder, string folderName) { if (UUID.TryParse(parentFolder, out UUID parentFolderUUID) == false) @@ -745,8 +747,8 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("invaild item uuid")] [ReturnHintsFailure("invaild folder uuid")] - [ArgHints("item", "UUID of item to move")] - [ArgHints("folder", "UUID of destination folder")] + [ArgHints("item", " item to move", "UUID")] + [ArgHints("folder", "destination folder", "UUID")] public object MoveInventoryItem(string item, string folder) { if (UUID.TryParse(item, out UUID itemUUID) == false) @@ -765,8 +767,8 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("invaild source folder uuid")] [ReturnHintsFailure("invaild dest folder uuid")] - [ArgHints("sourceFolder", "UUID of folder to move")] - [ArgHints("destFolder", "UUID of destination folder")] + [ArgHints("sourceFolder", "folder to move", "UUID")] + [ArgHints("destFolder", "destination folder", "UUID")] public object MoveInventoryFolder(string sourceFolder, string destFolder) { if (UUID.TryParse(sourceFolder, out UUID sourceFolderUUID) == false) diff --git a/SecondBotEvents/Commands/Movement.cs b/SecondBotEvents/Commands/Movement.cs index 80f6ff0..d1b5e94 100644 --- a/SecondBotEvents/Commands/Movement.cs +++ b/SecondBotEvents/Commands/Movement.cs @@ -14,7 +14,7 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Convert to float has failed")] [ReturnHintsFailure("value out of range (-2.0, 2.0)")] - [ArgHints("height", "what height to hover at from (-2.0, 2.0)")] + [ArgHints("height", "what height to hover at from (-2.0, 2.0)","Number","0.5")] public object HoverHeight(string height) { if (double.TryParse(height, out double level) == false) @@ -34,9 +34,9 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Convert to vector has failed")] [ReturnHintsFailure("? value out of range 0-?")] - [ArgHints("x", "X location to AutoPilot to")] - [ArgHints("y", "Y location to AutoPilot to")] - [ArgHints("z", "Z location to AutoPilot to")] + [ArgHints("x", "X location to AutoPilot to","Number","44")] + [ArgHints("y", "Y location to AutoPilot to","Number","78")] + [ArgHints("z", "Z location to AutoPilot to","Number","26")] public object AutoPilot(string x, string y, string z) { if (Vector3.TryParse("<" + x + "," + y + "," + z + ">", out Vector3 pos) == false) @@ -74,7 +74,7 @@ namespace SecondBotEvents.Commands [About("Make the bot request the target avatar teleport to the bot")] [ReturnHints("ok")] [ReturnHintsFailure("Invaild avatar UUID")] - [ArgHints("avatar", "Avatar UUID or Firstname Lastname")] + [ArgHints("avatar", "Who to send the join me via teleport to","AVATAR")] public object SendTeleportLure(string avatar) { ProcessAvatar(avatar); @@ -89,7 +89,7 @@ namespace SecondBotEvents.Commands [About("Sends a teleport request (Move the bot to the avatar)")] [ReturnHints("ok")] [ReturnHintsFailure("Invaild avatar UUID")] - [ArgHints("avatar", "Avatar UUID or Firstname Lastname")] + [ArgHints("avatar", "Who to request a teleport from","AVATAR")] public object RequestTeleport(string avatar) { ProcessAvatar(avatar); @@ -105,7 +105,7 @@ namespace SecondBotEvents.Commands [About("Makes the bot fly (or not)")] [ReturnHints("ok")] [ReturnHintsFailure("Invaild mode")] - [ArgHints("mode", "true: Start flying, false: stop flying (super fun at height)")] + [ArgHints("mode", "true: Start flying, false: stop flying (super fun at height)","BOOL")] public object Fly(string mode) { if (bool.TryParse(mode, out bool flymode) == false) @@ -121,7 +121,7 @@ namespace SecondBotEvents.Commands [ReturnHints("true|false")] [ReturnHintsFailure("Invaild vector")] [ReturnHintsFailure("Vector ? value is out of range 0-?")] - [ArgHints("vector", "a vector to face eg <123,45,44>")] + [ArgHints("vector", "What direction to face","Vector", "<123,45,44>")] public object RotateToFaceVector(string vector) { if (Vector3.TryParse(vector, out Vector3 pos) == false) @@ -147,7 +147,7 @@ namespace SecondBotEvents.Commands [ReturnHints("true|false")] [ReturnHintsFailure("Invaild avatar UUID")] [ReturnHintsFailure("Unable to see avatar")] - [ArgHints("avatar", "An avatar UUID or Firstname Lastname")] + [ArgHints("avatar", "Who to turn to look at","AVATAR")] public object RotateToFace(string avatar) { ProcessAvatar(avatar); @@ -165,7 +165,7 @@ namespace SecondBotEvents.Commands [About("Rotates the avatar to face a rotation from north in Degrees")] [ReturnHints("ok")] [ReturnHintsFailure("Unable to process rotation")] - [ArgHints("deg", "0 to 360")] + [ArgHints("deg", "0 to 360","Number","180")] public object RotateTo(string deg) { if (float.TryParse(deg, out float target_yaw) == true) @@ -202,9 +202,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Error Unable to Teleport to location")] [ReturnHints("Accepted")] [ArgHints("region", "the name of the region we are going to")] - [ArgHints("x", "X location to teleport to")] - [ArgHints("y", "y location to teleport to")] - [ArgHints("z", "z location to teleport to")] + [ArgHints("x", "X location to teleport to","Number","55")] + [ArgHints("y", "y location to teleport to","Number","78")] + [ArgHints("z", "z location to teleport to","Number","244")] public object Teleport(string region, string x, string y, string z) { bool status = TeleportRequest(region+"/"+x+"/"+y+"/"+z); @@ -219,7 +219,7 @@ namespace SecondBotEvents.Commands [About("Attempt to teleport to a new region via a SL url")] [ReturnHintsFailure("slurl is empty")] [ReturnHints("True|False")] - [ArgHints("slurl", "a full SLurl")] + [ArgHints("slurl", "a full SLurl","Text", "secondlife://Example%20Land/115/130/24")] public object TeleportSLURL(string slurl) { if (SecondbotHelpers.notempty(slurl) == false) diff --git a/SecondBotEvents/Commands/Notecard.cs b/SecondBotEvents/Commands/Notecard.cs index 0809531..44c8640 100644 --- a/SecondBotEvents/Commands/Notecard.cs +++ b/SecondBotEvents/Commands/Notecard.cs @@ -15,8 +15,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Inventory item is not a notecard")] [ReturnHintsFailure("replytarget not set")] [ReturnHints("Making request to get data from notecard")] - [ArgHints("notecardInventoryUUID", "The inventory UUID of the notecard to read")] - [ArgHints("replytarget", "where to send the results to (smartreply target Avatar UUID, HTTP url, chat channel")] + [ArgHints("notecardInventoryUUID", "What notecard to read","UUID")] + [ArgHints("replytarget", "Were to send the reply","SMART")] public object NotecardRead(string notecardInventoryUUID, string replytarget) { if(SecondbotHelpers.isempty(replytarget) == true) @@ -87,8 +87,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Collection value is empty")] [ReturnHintsFailure("Content value is empty")] [ReturnHints("ok")] - [ArgHints("collection", "The name of the collection")] - [ArgHints("content", "The text to add to the collection")] + [ArgHints("collection", "The name of the collection","Text","StorageMeme")] + [ArgHints("content", "The text to add to the collection","Text","Add this line \n Please and thanks")] public object NotecardAdd(string collection, string content) { if (SecondbotHelpers.notempty(collection) == false) @@ -106,7 +106,7 @@ namespace SecondBotEvents.Commands [About("Clears the contents of a collection")] [ReturnHintsFailure("Collection value is empty")] [ReturnHints("ok")] - [ArgHints("collection", "The name of the collection")] + [ArgHints("collection", "The name of the collection", "Text", "StorageMeme")] public object NotecardClear(string collection) { if (SecondbotHelpers.notempty(collection) == false) @@ -123,9 +123,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHintsFailure("No content in notecard storage ?")] [ReturnHints("ok")] - [ArgHints("avatar", "The UUID or Name of an avatar")] - [ArgHints("collection", "The name of the collection")] - [ArgHints("notecardname", "What to call the created notecard")] + [ArgHints("avatar", "Who to send it to","AVATAR")] + [ArgHints("collection", "The name of the collection", "Text", "StorageMeme")] + [ArgHints("notecardname", "What to call the created notecard","Text", "My custom notecard")] public object NotecardSend(string avatar, string collection, string notecardname) { if (SecondbotHelpers.notempty(collection) == false) @@ -160,9 +160,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Content value is empty")] [ReturnHintsFailure("Invaild avatar uuid")] [ReturnHints("ok")] - [ArgHints("avatar", "The UUID or Name of an avatar")] - [ArgHints("content", "The text to add to the collection")] - [ArgHints("notecardname", "What to call the created notecard")] + [ArgHints("avatar", "Who to send the notecard to","AVATAR")] + [ArgHints("content", "What to put in the notecard","Text","I am in a notecard")] + [ArgHints("notecardname", "Whats the name of the notecard","Text","Custom notecard")] public object NotecardDirectSend(string avatar, string content, string notecardname) { if (SecondbotHelpers.notempty(notecardname) == false) diff --git a/SecondBotEvents/Commands/ParcelCommands.cs b/SecondBotEvents/Commands/ParcelCommands.cs index 3f244f8..ae93a84 100644 --- a/SecondBotEvents/Commands/ParcelCommands.cs +++ b/SecondBotEvents/Commands/ParcelCommands.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using static OpenMetaverse.DirectoryManager; using static OpenMetaverse.ParcelManager; using static OpenMetaverse.Stats.UtilizationStatistics; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace SecondBotEvents.Commands { @@ -93,7 +94,7 @@ namespace SecondBotEvents.Commands Dictionary parcelbox = []; uint SimWidth = GetClient().Network.CurrentSim.SizeX; uint SimHeight = GetClient().Network.CurrentSim.SizeY; - Dictionary maps = []; + Dictionary maps = []; int lastparcelid = 0; @@ -225,16 +226,16 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Invaild amount")] - [ArgHints("amount", "The amount to sell the parcel for from 1 to 9999999, can be zero if avatar is assigned.")] - [ArgHints("avatar", "Avatar uuid or Firstname Lastname or \"none\" who we are locking the sale to")] - public object SetParcelSale(string amount,string avatar) + [ArgHints("amount", "The amount to sell the parcel for from 1 to 9999999, can be zero if avatar is assigned.", "Number", "4323")] + [ArgHints("avatar", "Who to sell the parcel to or \"none\" to allow anyone", "AVATAR")] + public object SetParcelSale(string amount, string avatar) { KeyValuePair tests = SetupCurrentParcel(); - if(tests.Key == false) + if (tests.Key == false) { return Failure(tests.Value, [amount, avatar]); } - if (int.TryParse(amount,out int amountvalue) == false) + if (int.TryParse(amount, out int amountvalue) == false) { return Failure("Invaild amount", [amount, avatar]); } @@ -244,7 +245,7 @@ namespace SecondBotEvents.Commands if (avatar != "none") { ProcessAvatar(avatar); - if(avataruuid != UUID.Zero) + if (avataruuid != UUID.Zero) { minAmount = 0; } @@ -307,11 +308,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild timeout")] [ReturnHintsFailure("timeout must be >= 2000 and <= 7000")] [ReturnHintsFailure("Timed out while doing land search")] - [ArgHints("filterRegion", "Any,Auction,Mainland,Estate")] - [ArgHints("filterPrice", "the max price to get results for: a number greater than or equal to zero")] - [ArgHints("filterArea", "the max area to get results for: a number greater than or equal to zero")] - [ArgHints("pageNum", "the page to load from (starting at zero): a number greater than or equal to zero")] - [ArgHints("timeout", "how long to wait for results: a number greater in the range 2000 to 7000")] + [ArgHints("filterRegion", "What are we looking for", "Text", "Auction", new string[] { "Any", "Auction", "Mainland", "Estate" })] + [ArgHints("filterPrice", "the max price to get results for: a number greater than or equal to zero","Number","432")] + [ArgHints("filterArea", "the max area to get results for: a number greater than or equal to zero","Number","65")] + [ArgHints("pageNum", "the page to load from (starting at zero): a number greater than or equal to zero","Number","0")] + [ArgHints("timeout", "how long to wait for results: a number greater in the range 2000 to 7000","Number","2000")] public object QueryLandSaleData(string filterRegion,string filterPrice, string filterArea, string pageNum, string timeout) { @@ -384,9 +385,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Invaild amount")] - [ArgHints("x", "X point for landing")] - [ArgHints("y", "Y point for landing")] - [ArgHints("z", "Z point for landing")] + [ArgHints("x", "X point for landing","Number","129")] + [ArgHints("y", "Y point for landing","Number","32")] + [ArgHints("z", "Z point for landing","Number","11")] public object SetParcelLandingZone(string x, string y, string z) { KeyValuePair tests = SetupCurrentParcel(); @@ -418,7 +419,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Parcel name is empty")] - [ArgHints("name", "The new name of the parcel")] + [ArgHints("name", "The new name of the parcel","Text","My Home")] public object SetParcelName(string name) { KeyValuePair tests = SetupCurrentParcel(); @@ -439,7 +440,7 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] - [ArgHints("desc", "The new desc of the parcel")] + [ArgHints("desc", "The new desc of the parcel","Text","All are invited")] public object SetParcelDesc(string desc) { KeyValuePair tests = SetupCurrentParcel(); @@ -489,7 +490,7 @@ namespace SecondBotEvents.Commands [About("Ejects an avatar")] [ReturnHints("ok")] [ReturnHintsFailure("Invaild avatar")] - [ArgHints("avatar", "uuid of the avatar or Firstname Lastname")] + [ArgHints("avatar", "Who to eject from the parcel","AVATAR")] public object ParcelEject(string avatar) { ProcessAvatar(avatar); @@ -521,7 +522,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Invaild avatar")] [ReturnHintsFailure("Avatar is in the blacklist")] - [ArgHints("avatar", "uuid of the avatar or Firstname Lastname")] + [ArgHints("avatar", "Who to ban from the parcel","AVATAR")] public object ParcelBan(string avatar) { KeyValuePair tests = SetupCurrentParcel(); @@ -564,7 +565,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Invaild avatar")] [ReturnHintsFailure("Avatar is already unbanned")] - [ArgHints("avatar", "uuid of the avatar or Firstname Lastname")] + [ArgHints("avatar", "Who to unban from the parcel","AVATAR")] public object ParcelUnBan(string avatar) { KeyValuePair tests = SetupCurrentParcel(); @@ -607,7 +608,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Timeout waiting for object owners reply")] [ReturnHintsFailure("Invaild avatar")] [ReturnHints("ok")] - [ArgHints("avatar", "uuid of the avatar or Firstname Lastname")] + [ArgHints("avatar", "who to return all objects on parcel", "AVATAR")] public object ReturnAllObjectsOnParcelByOwner(string avatar) { KeyValuePair tests = SetupCurrentParcel(); @@ -724,7 +725,7 @@ namespace SecondBotEvents.Commands [ReturnHints("true|false")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] - [ArgHints("musicurl", "The new name of the parcel")] + [ArgHints("musicurl", "the URL to set for streaming audio", "URL","http://podcast.mysite.com")] public object SetParcelMusic(string musicurl) { KeyValuePair tests = SetupCurrentParcel(); @@ -745,7 +746,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unable to set flag ...")] [ReturnHintsFailure("Flag: ? is unknown")] [ReturnHintsFailure("Flag: ? missing \"=\"")] - [ArgHints("escapedflagdata", "repeatable flag data split by ::: formated Flag=True|False")] + [ArgHints("escapedflagdata", "repeatable flag data split by ::: formated Flag=True|False","Text","")] public object SetParcelFlag(string escapedflagdata) { KeyValuePair tests = SetupCurrentParcel(); @@ -799,7 +800,7 @@ namespace SecondBotEvents.Commands [About("transfers the current parcel ownership to the assigned group")] [ReturnHints("ok")] - [ArgHints("group", "The group uuid to assign")] + [ArgHints("group", "The group to deed the land to","UUID")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] [ReturnHintsFailure("Invaild group uuid")] @@ -836,7 +837,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Parcel sale locked to other avatars")] [ReturnHintsFailure("Parcel sale price and amount do not match")] [ReturnHintsFailure("Invaild amount")] - [ArgHints("amount", "amount to pay for the parcel (min 1, unless the land is set to the bot as the locked buyer then its 0)")] + [ArgHints("amount", "amount to pay for the parcel (min 1, unless the land is set to the bot as the locked buyer then its 0)", + "Number","1234")] public object ParcelBuy(string amount) { KeyValuePair tests = SetupCurrentParcel(); @@ -877,8 +879,8 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Invaild avatar UUID")] [ReturnHintsFailure("Invaild state")] - [ArgHints("avatar", "avatar uuid or Firstname Lastname")] - [ArgHints("state", "setting state to false will unfreeze or true to freeze")] + [ArgHints("avatar", "Who to freeze","AVATAR")] + [ArgHints("state", "setting state to false will unfreeze or true to freeze","BOOL")] public object ParcelFreeze(string avatar, string state) { if (bool.TryParse(state, out bool freezestate) == false) @@ -978,7 +980,7 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Error not in a sim")] [ReturnHintsFailure("Parcel data not ready")] - [ArgHints("escapedflagdata", "repeatable flag data split by ::: formated Flag=True|False")] + [ArgHints("escapedflagdata", "repeatable flag data split by ::: formated Flag=Value","TEXT", "MediaDesc=lol what:::MediaAutoScale=True:::MediaLoop=False")] public object ParcelSetMedia(string escapedflagdata) { KeyValuePair tests = SetupCurrentParcel(); diff --git a/SecondBotEvents/Commands/Self.cs b/SecondBotEvents/Commands/Self.cs index a747ba2..6216a57 100644 --- a/SecondBotEvents/Commands/Self.cs +++ b/SecondBotEvents/Commands/Self.cs @@ -1,8 +1,10 @@ using Newtonsoft.Json; using OpenMetaverse; +using OpenMetaverse.ImportExport.Collada14; using SecondBotEvents.Services; using System.Collections.Generic; using System.Linq; +using static NRedisStack.Search.Schema; namespace SecondBotEvents.Commands { @@ -13,9 +15,9 @@ namespace SecondBotEvents.Commands [ReturnHints("sending")] [ReturnHintsFailure("Send was rejected because: X")] [ReturnHintsFailure("ARG is empty")] - [ArgHints("to", "the email addres to send to")] - [ArgHints("subject", "the subject of the email")] - [ArgHints("body", "the contents of the email")] + [ArgHints("to", "the email addres to send to", "Text", "me@email.com")] + [ArgHints("subject", "the subject of the email", "Text", "This is the subject")] + [ArgHints("body", "the contents of the email", "Text", "Email is fun")] public object SendEmail(string to, string subject, string body) { if (SecondbotHelpers.isempty(to) == true) { @@ -23,18 +25,18 @@ namespace SecondBotEvents.Commands } else if (SecondbotHelpers.isempty(subject) == true) { - return Failure("subject is empty", [ to ]); + return Failure("subject is empty", [to]); } else if (SecondbotHelpers.isempty(body) == true) { return Failure("body is empty", [to, subject]); } KeyValuePair reply = master.SmtpService.commandEmail(to, subject, body); - if(reply.Key == false) + if (reply.Key == false) { - return Failure("Send was rejected because: "+reply.Value, [ to, subject, body ]); + return Failure("Send was rejected because: " + reply.Value, [to, subject, body]); } - return BasicReply("sending",[to,subject,body]); + return BasicReply("sending", [to, subject, body]); } [About("Makes the bot teleport to its home region")] @@ -47,7 +49,7 @@ namespace SecondBotEvents.Commands [About("Makes the bot turn to face a avatar and point at it (if found)")] [ReturnHints("ok")] - [ArgHints("targetUUID", "UUID of a avatar to point at")] + [ArgHints("targetUUID", "The avatar to point at", "AVATAR")] [ReturnHintsFailure("Cant find UUID in sim")] public object PointAt(string targetUUID) { @@ -68,7 +70,7 @@ namespace SecondBotEvents.Commands [About("Reads a value from the KeyValue storage (temp unless SQL is enabled)")] [ReturnHints("value")] [ReturnHintsFailure("Unknown Key: KeyName")] - [ArgHints("Key", "the key we are trying to read from")] + [ArgHints("Key", "the key we are trying to read from", "Text", "ExampleKey")] public object ReadKeyValue(string Key) { return BasicReply(master.DataStoreService.GetKeyValue(Key)); @@ -78,8 +80,8 @@ namespace SecondBotEvents.Commands [ReturnHints("ok")] [ReturnHintsFailure("Key is empty")] [ReturnHintsFailure("Value is empty")] - [ArgHints("Key", "the key we are trying to set")] - [ArgHints("Value", "the value we are tring to put on the key")] + [ArgHints("Key", "the key we are trying to set", "Text", "ExampleKey")] + [ArgHints("Value", "the value we are tring to put on the key", "Text", "ExampleValue")] public object SetKeyValue(string Key, string Value) { if (SecondbotHelpers.isempty(Key) == false) @@ -97,7 +99,7 @@ namespace SecondBotEvents.Commands [About("Reads a value from the KeyValue storage (temp unless SQL is enabled)")] [ReturnHints("ok")] [ReturnHintsFailure("Key is empty")] - [ArgHints("Key", "the key we are trying to clear")] + [ArgHints("Key", "the key we are trying to clear", "Text", "ExampleKey")] public object ClearKeyValue(string Key) { if (SecondbotHelpers.isempty(Key) == false) @@ -111,7 +113,7 @@ namespace SecondBotEvents.Commands [About("Makes the bot sit on the ground or on a object if it can see it")] [ReturnHints("ok")] [ReturnHintsFailure("Invaild object UUID")] - [ArgHints("target", "a object UUID anything or nothing will also work")] + [ArgHints("target", "a object UUID or the word ground", "Text", "ground")] public object Sit(string target) { if ((target == "ground") || (target == UUID.Zero.ToString())) @@ -119,7 +121,7 @@ namespace SecondBotEvents.Commands GetClient().Self.SitOnGround(); return BasicReply("ok", [target]); } - if(UUID.TryParse(target,out UUID objectuuid) == false) + if (UUID.TryParse(target, out UUID objectuuid) == false) { return Failure("Invaild object uuid and not ground"); } @@ -141,7 +143,7 @@ namespace SecondBotEvents.Commands [ReturnHints("true|false")] [ReturnHintsFailure("Invaild object UUID")] [ReturnHintsFailure("Unable to see object")] - [ArgHints("target", "object UUID")] + [ArgHints("target", "the object to click on", "UUID")] public object ClickObject(string target) { if (UUID.TryParse(target, out UUID objectuuid) == false) @@ -180,10 +182,10 @@ namespace SecondBotEvents.Commands public object GetLastCommands() { List reply = []; - foreach(CommandHistory A in master.DataStoreService.GetCommandHistory()) + foreach (CommandHistory A in master.DataStoreService.GetCommandHistory()) { reply.Add(JsonConvert.SerializeObject(A)); - if(reply.Count >= 5) + if (reply.Count >= 5) { break; } @@ -202,10 +204,11 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Invaild state")] [ReturnHintsFailure("Invaild sticky")] [ReturnHintsFailure("Invaild flag")] - [ArgHints("avatar", "avatar uuid or Firstname Lastname")] - [ArgHints("flag", "friend, group, animation, teleport, inventory or command")] - [ArgHints("state", "State to set the flag to true or false")] - [ArgHints("sticky", "if true the permissing will not expire after the first use otherwise false")] + [ArgHints("avatar", "Who to asign the flag to", "AVATAR")] + [ArgHints("flag", "What flag to assign", "Text", "group", + new string[] { "friend", "group", "animation", "teleport", "inventory","command" })] + [ArgHints("state", "What state to put the flag into","BOOL")] + [ArgHints("sticky", "Should this be repeatable","BOOL")] public object SetPermFlag(string avatar, string flag, string state, string sticky) { ProcessAvatar(avatar); diff --git a/SecondBotEvents/Commands/Services.cs b/SecondBotEvents/Commands/Services.cs index 69456e6..3786300 100644 --- a/SecondBotEvents/Commands/Services.cs +++ b/SecondBotEvents/Commands/Services.cs @@ -21,7 +21,7 @@ namespace SecondBotEvents.Commands "ChatGptService")] public class Services(EventsSecondBot setmaster) : CommandsAPI(setmaster) { - protected List controlable = [ + public static readonly string[] controlable = { "BotClientService", "RLVService", "HttpService", @@ -33,13 +33,14 @@ namespace SecondBotEvents.Commands "TriggerOnEventService", "RelayService", "ChatGptService" - ]; + }; [About("Marks a service as enabled and starts it")] [ReturnHints("ok")] [ReturnHintsFailure("Unknown service")] [ReturnHintsFailure("Unable to manage selected service")] [ReturnHintsFailure("Service control is not enabled by config")] + [ArgHints("servicename","What service to enable","SERVICES","HttpService")] public object EnableAndStartService(string servicename) { if(master.CommandsService.GetAllowServiceCommands() == false) @@ -64,6 +65,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown service")] [ReturnHintsFailure("Unable to manage selected service")] [ReturnHintsFailure("Service control is not enabled by config")] + [ArgHints("servicename", "What service to stop", "SERVICES", "HttpService")] public object StopService(string servicename) { if (master.CommandsService.GetAllowServiceCommands() == false) @@ -88,6 +90,7 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown service")] [ReturnHintsFailure("Unable to manage selected service")] [ReturnHintsFailure("Service control is not enabled by config")] + [ArgHints("servicename", "What service to Restart", "SERVICES", "HttpService")] public object RestartService(string servicename) { if (master.CommandsService.GetAllowServiceCommands() == false) @@ -112,6 +115,9 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("Unknown service")] [ReturnHintsFailure("Unable to manage selected service")] [ReturnHintsFailure("Service control is not enabled by config")] + [ArgHints("servicename", "What service to adjust the config for", "SERVICES", "HttpService")] + [ArgHints("configname", "What config value are we updating", "Text", "example")] + [ArgHints("configvalue", "What is the new value", "Text", "changedvalue")] public object ChangeConfigValue(string servicename,string configname,string configvalue) { if (master.CommandsService.GetAllowServiceCommands() == false) diff --git a/SecondBotEvents/Commands/StreamAdmin.cs b/SecondBotEvents/Commands/StreamAdmin.cs index 4937a61..67c80d0 100644 --- a/SecondBotEvents/Commands/StreamAdmin.cs +++ b/SecondBotEvents/Commands/StreamAdmin.cs @@ -17,8 +17,8 @@ namespace SecondBotEvents.Commands [ReturnHintsFailure("HTTP status code: ...")] [ReturnHintsFailure("Error: ...")] [ReturnHintsFailure("Notecard title is to short")] - [ArgHints("endpoint", "The end point")] - [ArgHints("endpointcode", "The end point code")] + [ArgHints("endpoint", "The end point","Text","No help given")] + [ArgHints("endpointcode", "The end point code", "Text", "No help given")] public object FetchNextNotecard(string endpoint, string endpointcode) { if (SecondbotHelpers.notempty(endpoint) == false) diff --git a/SecondBotEvents/Services/HttpService.cs b/SecondBotEvents/Services/HttpService.cs index 5769dfa..0f4e319 100644 --- a/SecondBotEvents/Services/HttpService.cs +++ b/SecondBotEvents/Services/HttpService.cs @@ -261,10 +261,13 @@ namespace SecondBotEvents.Services } [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - public class ArgHints(string name, string about) : Attribute + public class ArgHints(string name, string about, string defaultValueType=null, string exampleValue=null, string[] acceptedValues=null) : Attribute { public string name = name; public string about = about; + public string defaultValueType = defaultValueType ?? string.Empty; // Default to empty string if not provided + public string exampleValue = exampleValue ?? string.Empty; // Default to empty string if not provided + public string[] acceptedValues = acceptedValues ?? Array.Empty(); // Default to empty array if not provided } public class SecondbotWebApi(EventsSecondBot setmaster) : WebApiController diff --git a/SecondBotEvents/WikiService.cs b/SecondBotEvents/WikiService.cs index cec2101..a3848ac 100644 --- a/SecondBotEvents/WikiService.cs +++ b/SecondBotEvents/WikiService.cs @@ -1,4 +1,5 @@ -using OpenMetaverse.ImportExport.Collada14; +using OpenMetaverse; +using OpenMetaverse.ImportExport.Collada14; using RestSharp.Extensions; using SecondBotEvents.Services; using System; @@ -107,26 +108,78 @@ namespace SecondBotEvents Dictionary hints = []; + Dictionary hinttypes = []; + Dictionary hintexamplevalue = []; + + string examplecall = method.Name; foreach (ArgHints At in method.GetCustomAttributes()) { hints.Add(At.name, At.about); + hinttypes.Add(At.name, At.defaultValueType); + hintexamplevalue.Add(At.name, At.exampleValue); } if (method.GetParameters().Length > 0) { content = content + "
Args
"; content = content + ""; - content = content + ""; + content = content + ""; + bool hadStartSplit = false; + string addon = ""; foreach (ParameterInfo pram in method.GetParameters()) { + if(hadStartSplit == false) + { + hadStartSplit = true; + examplecall = examplecall + "###"; + } content = content + ""; content = content + ""; string hinttext = ""; + string hinttype = ""; + string hintexample = ""; + string hintexamplecmd = ""; + if (hintexamplevalue.ContainsKey(pram.Name) == true) + { + if (hintexamplevalue[pram.Name] != null) + { + hintexample = hintexamplevalue[pram.Name]; + hintexamplecmd = hintexamplevalue[pram.Name]; + } + } + if (hinttypes.ContainsKey(pram.Name) == true) + { + hinttype = hinttypes[pram.Name]; + if (hinttype == "UUID") + { + hintexample = UUID.Random().ToString(); + hintexamplecmd = hintexample; + } + else if (hinttype == "AVATAR") + { + hintexample = "Firstname Lastname or UUID"; + hintexamplecmd = "Madpeter Zond"; + } + else if(hinttype == "BOOL") + { + hintexample = "false"; + hintexamplecmd = "true"; + } + } if (hints.ContainsKey(pram.Name) == true) { - hinttext = hints[pram.Name]; + if (hints[pram.Name] != null) + { + hinttext = hints[pram.Name]; + } } - content = content + ""; + examplecall = examplecall + addon + "" + hintexamplecmd; + addon = "~#~"; + content = content + "" + + "" + + "" + + "" + + ""; } content = content + "
NameHint
HintTypeExample
" + pram.Name + "" + hinttext + "
" + hinttext + ""+ hinttype+""+ hintexample +"
"; } @@ -140,7 +193,7 @@ namespace SecondBotEvents { content = content + "
  • ❌ "+ At.hint+"
  • "; } - content = content + ""; + content = content + "
    Example call

    "+examplecall+""; makefile("command"+method.Name.ToLower(), content, "Command info for " + method.Name); }