Plugin category: Administrative Minecraft version: Spigot 1.9.4 Suggested name: SkylaskSpy What I want: I need a plugin much like Essential's social spy feature but it has to have support for certain players. Meaning that if someone were to type /spy <player name> it'll show them all the commands that the player executes - Until the command "/spy <player name>" is typed again. Multiple players can be spied on by adding commas: Code: /spy BillyBob321, BobbyEatsTacos, FrankThe10YearOld Or they can be added to an already existing spy-list: Code: /spy BillyBob321 /spy BobbyEatsTacos /spy FrankThe10YearOld A list of players you are currently spying on will be displayed when the player types /spylist: Code: &aYou are currently spying on: &7- BillyBob321 &7- BobbyEatsTacos &7- FrankThe10YearOld Only 5 players are shown in each spy list. If you are spying on more than 5 players, you'll have to type /spylist <number> to view them. You can toggle spying on the player by clicking on their name in the spy list. If no player is defined when typing /spy, it'll default to every player on the server. In config.yml There should be 2 lists of commands to spy on. One list for the whole server, and another list for just the defined players. Code: Single: - /fly - /warp - /home - /spawn - /msg - /reply Whole: - /msg - /reply If you are spying on a certain player and you log out, you will automatically "unspy" from that player's commands. (This does not apply if you are spying on the whole server's commands) If a player types "/r" (Or any other message-reply command) It'll show the player they are talking to when you hover over the "/r" part of the message. If you click it, you'll start spying on that player too. All chat messages should be configurable in the config.yml (Or an english.yml file) Code: New-Spy: &cSpy: You are now spying on %player%. UnSpy: &cSpy: You are no longer spying on %player%. SpyServer: &cSpy: You are now spying on the whole server. (Plus a lot more, this is just an example) Ideas for commands: /spy help - Displays the help menu for this plugin (Configurable in the english.yml file) /spy - Toggles spying on the whole server /spy <player> - Toggles spying on the defined player /spylist - Shows a list of players you are currently spying on // If you're not spying on a certain player, it'll just say: Code: &aYou are currently spying on: &7- No One But if you are spying on the whole server, it'll say: Code: &aYou are currently spying on: &7- The Whole Server Aliases: /spy | /socialspy | /social /spylist | /spied | /spyed | /spying Ideas for permissions: skylaskspy.spyserver - Allows the player to spy on the whole server skylaskspy.spyplayer - Allows the player to spy on a certain player skylaskspy.spylist - Allows the player to view the spylist skylaskspy.help - Allows the player to view the help menu When I'd like it by: ASAP
It won't take that long to finish the plugin, I just need to setup the config and language.yml (or english.yml). @Skrubzy Alright, here's version 1. Try it out, and tell me what you think. Download: https://www.dropbox.com/s/eg5h6ygcpmar8jk/SkylaskSpy.jar?dl=1 Edit: There is no way to get which player someone is replying to with /r, so I couldn't add that feature. And I forgot to limit /spylist to 5 names per list. (Ill fix this tomorrow). Edit 2: I will also add clickable text related stuff tomorrow. Edit 3: @Skrubzy Here's version 2.0. /spylist is done, and you can click names in the list to toggle Spying on them. Download: https://www.dropbox.com/s/ematd6u8m5ci2ig/SkylaskSpy2.0.jar?dl=1 Note: This will only work on Spigot/PaperSpigot.
I was just able to test it with another player and I have a few issues: When the player types "/r" (Or any other message-reply command) You can't hover over & click the "/r" part of the message as requested Also, could you please make it so the spy-message format is configurable? Like the color and stuff - Right now it's really plain and non-appealing. I have only been able to test with 1 other person so far, so there might be some more issues I haven't discovered yet.
@Skrubzy Like I said before, there is no way to get which player someone is replying to (unless I know the plugin that handles the messages). As for making the message configurable, I can do that.
I'm using Essentials for the messages EDIT: For the configurable messages, I was thinking something like this: Code: Spy-Message: '&c&l(!) &r&c%player% &c- &c%command% &c- &c%message%' The message is whatever is written after the command - So a message to "Player2" would look like this: Code: (!) Skrubzy - /msg Player2 - I'm hacking bud And if they type a reply command (/r) The %command% section will automatically add the other player's username: Code: (!) Player2 - /r Skrubzy - I'm reporting you It will add Skrubzy's name even if Player2 didn't type it: Code: Skrubzy: /msg Player2 I'm hacking bud Player2: /r I'm reporting you For staff, they see this if they're spying on the players: (!) Skrubzy - /msg Player2 - I'm hacking bud (!) Player2 - /r Skrubzy - I'm reporting you Then if the staff member opens chat and clicks on the "/r Skrubzy" part of the message, they'll start spying on Skrubzy too (Needs to work in public chat; if they click on a player talking in chat, they'll start spying on them) If they don't click but hover over that part, a "dialogue box" (I don't know what it's called) will appear saying a configurable message: Code: Click-Box-Start: &cClick this message to start spying on %player%&c! Click-Box-Stop: &cClick this message to stop spying on %player%&c!
@Skrubzy Unfortunately, it's not exactly possible to create clickable/hoverable text and also allow it to be configurable. Also you cannot change a message once it's been sent, so if the Click-Box-Start message is set to the text, it won't change to the Click-Box-Stop once the text has been clicked.
@TheMrJezza Why? Just add a tooltip AND a click event. You can use Fanciful, Rayzr JsonMessage or spigot's TextComponent for generating the custom message. If you feel really brave and do not want to limit yourself to essentials, you could let the user define a regex which extracts the name of the user you are replying to.
I still don't really understand what a regex is... Would this solve both of the issues/limitations he said here, or just the first/second one?
@I Al Istannen I had edited my post to remove all suggestions about using raw JSON as the plugin would require updating every time the server protocol changed. I understand @Skrubzy probably isn't going to update their server version in a while but if they ever do, I won't be around to edit the plugin for a newer/older version. I already am using the TextComponent API, but if you can please find any way at all that allows me to replace a String with a TextComponent, I'd love to hear it... The point of a config isn't to make things unnecessary complicated for the user..
@TheMrJezza player.spigot().sendMessage or something send a TextComponent. You do not need to replace a String, as you have full control over any message that needs to be send. That depends on the config. This kind of config is harder on the user but allows for a far more flexible plugin. You need to choose what you want.
@I Al Istannen I mean user defined varibles. @Skrubzy wants %COMMAND% to be replaced with a TextComponent. The rest of the message is to stay as a normal String. Edit: Actually, it might be possible to split the string at %COMMAND% and make up a text component like that.
I have no idea what you guys are talking about lol I just know how to setup config.yml...I know nothing about coding EDIT: @TheMrJezza If it's not possible to change it in the config.yml (I think that's what you're talking about) Do you think you could send me the source code so I can edit the message straight from the code? Would that solve this issue?
@Skrubzy I might have found a way to make everything work, so theres no need to worry about me leaving you with a half finished job. Im also going to give you the code anyway when its done.
@TheMrJezza A simple way for a semi-nice parser: Code:java val input = "&c&lThis is a message</me is cool!>&c.&r Normal text.<> &6A command</me is very cool>" val message = JSONMessage.create() var lastPart = StringBuilder() for(pos in 0..input.lastIndex) { val character = input.codePointAt(pos).toChar() if (character == '<') { message.then(TextUtils.colorize(lastPart.toString())) lastPart = StringBuilder() } else if (character == '>') { if (!lastPart.isBlank()) { message.runCommand(lastPart.toString()) message.tooltip(TextUtils.colorize("&6Runs: '&a$lastPart&6'")) } lastPart = StringBuilder() } else { lastPart.append(character) } } message.then(TextUtils.colorize(lastPart.toString())) message.send(player) EDIT: Changed code to be not utterly retarded. I should have slept before xD Result: Hover over "This is a message" Hover over "Normal text": Hover over "A command:
You guys are always amazing me with your coding talents lol it makes me feel so useless - But in the good way...cause it's so good...I'm bad at explaining
@I Al Istannen Thank you very much. I'll have the plugin finished a lot sooner now. Edit: Version 3.0 DOWNLOAD @Skrubzy Here's Version 3.0. Try it out, see what you think. There's a lot of stuff in the plugin, although I'm fairly sure I removed everything I had added for debugging, if you see any random messages in chat, just let me know. Source: https://github.com/TheMrJezza/SkylaskSpy Note: This version can be used on CraftBukkit as well. So you're no longer limited to Spigot/Paper.