Filled Commands without a "/" if user meets criteria (double layered)

Discussion in 'Plugin Requests' started by Dark_Serpent, Sep 22, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Dark_Serpent

    Plugin category: Chat Related

    Suggested name: ShoutCommands

    What I want: I want the ability for players to say a word and follow it with a command, sort of like casting a spell. By shouting the command, the server will force them to use the command with OP privileges.

    (For the sake of readability, imagine stands for a new line of text (Pressing enter and then entering a new line of text).)

    i.e. Person shouts "Command Start", forcing them to use "/kick Dark_Serpent". Even though they're not OP'd, the command would still go through as if they were, sort of like "/sudo" in Essentials.

    The uses for this plugin includes for instance, a deity following system where you use one of their abilities.

    i.e. "Midus Ice", which forces the command "/cast ice" to be used.

    In order to prevent people who do not follow this deity from casting it, commands would fall under categories. Imagine "Midus" is a category, and the command input is "Ice". There would also be "Midus Freeze" and "Midus Ice Pillar", but only people who are allowed to use Midus commands would be able to cast them. There would also be a cooldown for each command.

    Because of how tedious it would be to rewrite permissions every time somebody acquired a new deity, instead, there could be a list of categories and then a list of players in the config file.

    i.e.
    Midus:
    Commands:
    Ice:
    cast: "/cast ice"
    cooldown: 0s
    Freeze:
    cast: "/cast freeze"
    cooldown: 5m
    Ice Pillar:
    cast: "/cast icepillar"
    cooldown: 1h
    Players:
    - Dark_Serpent
    - Notch
    - Dinnerbone

    That way, editing would be easy, and a /scom reload command would reload the config.

    Ideas for commands: /scom
    reload
    version (If needed)

    Ideas for permissions: scom.
    reload
    version (If needed)

    When I'd like it by: Honestly, I'd like it by the end of this week, but that's a rather naive idea, but for my purposes I need it no later than by the end of this month. I realize this couldn't possibly be an easy plugin to create, even with my limited experience with coding.

    I do believe that this is theoretically possible, after looking into it. If somebody said Midus in chat, for instance, the server doesn't have to wait for a command input unless you actually are allowed to use commands under the category, and if you use the word in a sentence, for example: "Midus is great", the server wouldn't wait for a input, even if you are allowed to use the Midus category.

    It would be great if somebody could take up this, or point me to a plugin that accomplishes it. Thanks in advance!

    Additional Information: Since it just occurred to me that this might be helpful, I recently was helped by ninwa in order to make this guy:
    https://www.dropbox.com/s/iwm06gfiryqq672/timer-1.0 by ninwa.jar?dl=0
    Essentially a timer plugin that informs players that their ability is on cooldown, which might translate well into this request? I don't know, I just thought I'd put it here.
     
    Last edited: Sep 22, 2015
  2. Offline

    SkillAura

    Sadly, i can't do this

    But i have a question.

    Let's say a player says one of the msgs, it will run the cmd, but will the chat msg be DELETED, or will it stay too?
     
  3. Offline

    Dark_Serpent

    It would make more sense if the chat message remained, since if you wanted the chat message to disappear, you'd just use the command instead.

    The intended purpose would be more for a server that used a deity system, but there are other applications, such as certain moderator commands having to be broadcasted to the entire server before it was used, which may prove useful to some server owners.
     
  4. Offline

    Dark_Serpent

  5. This seems cool... but I don't know how to make the skills. Everything else seems simple to me.
     
  6. Offline

    Dark_Serpent

    I don't need the skills to be made. They're just example commands this plugin would be used for.
     
  7. So what commands do you want included or should that be config?

    EDIT: I'll start making all the events and listeners, but I would like a little more information on exactly what you would like included.
     
  8. Offline

    Dark_Serpent

    Essentially, any commands you would use normally, for instance, Essentials' /home, could be used. There wouldn't need to be any commands specifically made for the plugin.

    The config would allow you to designate which people have access to what group, and each group shows what commands would be used.

    People in the "Admin" group, for instance, would start the command chain by saying "Admin" in chat. After this, the server would listen for another command. If the command isn't within the group, nothing would happen. Let's say your config looks similar to this:

    Admin:
    Commands:
    Kick:
    cast: "/kick Dark_Serpent"
    cooldown: 1h​
    Players:
    - Dark_Serpent
    When the player in this subgroup says "Admin", the server would listen. If they say "Kick" next in chat, the command typed under "cast" would be used, regardless of the player's current permissions, and the server will act as if the player used the command, rather than the console.

     
  9. So you would like it to depend on essentials and pex groups?
     
  10. Offline

    Dark_Serpent

    The groups would be defined in the config. The groups in the config and the groups in your permissions plugin would have no relation.
     
  11. Invisible

    Reynergodoy

    is this solved? there is a plugin that does it in bukkit, so just search for keywords and aliases you will find it
     
  12. Offline

    Dark_Serpent

    That's great. After some searching though I can't seem to find the plugin that you're referring to. I'll keep looking in the meantime, but if you happen to know the plugin, do you think you could link it to me?
     
  13. Invisible

    Reynergodoy

    I saw it long time ago, but there are no things like the categories for the deities

    Don't worry, I will TRY to make the plugin that you want and link you to the bukkit page :)

    But to make this plugin, are you already using the plugin for the deities? If yes, I need to know what plugin it is to make only the follower of the deity use the powers :)

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 3, 2015
  14. Offline

    Dark_Serpent

    I was thinking you'd just be able to put people in certain groups, and when the player said that name, it would listen for the next input, the first text being the group, and the second text being the subgroup.

    Sort of like a permissions group, in the config for this plugin that allows you to use commands without a "/" by essentially shouting it in the chat, you would be able to customize which players would use which commands.

    That way, you wouldn't need a second plugin. Currently, the plugin I'm planning to use with this feature would be Magic, and when used in a way, could warn other players a powerful spell is about to be cast. Imagine a player shouting "Super Spell" (or something of the like), which would be the group, and then "Kaboom", which would be the subgroup. The config to allow the player, say "Notch", to use this ability would look like this:

    Commands:
    Super Spell:
    #This is the first text the player must say in chat in order to use the command. Imagine this as an index.
    Kaboom:
    #This is the second text the player must say in order to use the command. Imagine this as a specific point of the index.
    cast: "/cast kaboom size 50"
    #This will choose what command the player will use. In this cast, the /cast command from the Magic plugin.
    cooldown: 5m
    #This will define the cooldown of the command before it can be used again. In this case, 5 minutes. In theory, the player would be notified his "ability" is on cooldown if he tried to use it before it was up.
    Players:
    #This will determine which players can use this specific ability in the group.
    - Notch
    I hope that clears some things up.
     
  15. Invisible

    Reynergodoy

    Got it, it will be hard, but I will try ( after I finish my history studies :) )

    Trying to do it :\
    I'm not good with config files
    EDIT: Sorry man, I've tried, but AsyncChatEvent does not have getConfig() so I could not make a customizable config, but that would be easy to manually do the things, but I don't know what commands you would like and what deities you have (and that would took too much time to do manually) ;-;

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 3, 2015
  16. Offline

    Dark_Serpent

    @Reynergodoy

    So it's technically impossible without manually putting in everything? That sucks, thanks for trying though.
     
  17. Invisible

    Reynergodoy

    It's not impossible, that's just that I don't know how to do, the method I thought was not possible
     
  18. Offline

    boomboompower

    Configs can be such a pain.
    And no, I can't do this either :p
     
  19. Offline

    flash1110

    Just get an instance of your main class and then use it to get the config.
     
  20. Offline

    I Al Istannen

    @Dark_Serpent That sounds like a nice idea. I will try to make this, but I don't know how long it will take :/. I have school and a few other activities. But I will definitly try to make it as fast as possible.
     
  21. Invisible

    Reynergodoy

    after i deleted the whole project i thought of creating an "X" = "Y";
    and put the X in the config
    but now its useless, i already deleted it all
     
  22. Offline

    I Al Istannen

    @Dark_Serpent I have a few more questions:
    1. Just double layered?
    2. Or should there be the possibillity for more?
    3. Do you pass the arguments behind the "Midus Ice" as arguments behind the "/cast ice"?
    4. How should the case be treated? Case sensitive or not?
    5. And, may sound stupid, but if one command is on cooldown, JUST this command or all?
    6. And what should happen if the Text message was cancelled, e.g. by a permissions / chat block plugin?
     
  23. Offline

    Dark_Serpent

    1 & 2. Yes, double layered works fine for my purposes. I can't see much use in multiple text prompts.
    3. Yes.
    4. Case sensitive.
    5. Just the command (and don't worry, it's a valid question) (EDIT: Also note, if the command is on cooldown, there probably should be a notification informing the user that it is, just so they know it isn't just them misspelling the command or the command being disabled. "§dYour ability is on cooldown! []d[]h[]m[]s").
    6. I'm not sure what would be best here, perhaps a notification? "§cYour text could not be phrased."

    Thank you for the help.
     
  24. Offline

    Scimiguy

    I'll make this for you, but I just want to clarify:

    You want players to be able to call the command at any time simply by using the primary keyword as the first word in a chat line?
    You want it to support more than just your own commands if possible?

    What reason is there for executing the command as console?
    Could the plugins to which the command belongs to not look after the cooldowns?
     
  25. Offline

    I Al Istannen

    @Dark_Serpent It is a quite easy plugin, and finished. I just need to know one more thing.
    You wanted to have a player list in the "spells.yml". I could see that getting quite big. What about a permission for every group you create? In your example you would need the permission: "shoutcommands.Midus" or even make it more detailed with "shoutcommands.Midus.Ice". Would that be acceptable. If not just write it, i will adjust it. Currently it looks like this. Please note, that I just quickly made the chance for cancelling the chat event random, so I could show you all of the messages.
    upload_2015-10-7_20-1-31.png
     
  26. Offline

    Dark_Serpent

    First off, thank you so much!

    Secondly, permissions are fine, and the detailed version would be better.

    Originally my intention was "Example" and then "Enchant", indicative of a break between messages, so I'd like to ask if that would be possible, but if it's out of the way and/or impossible, I'm completely fine with having it all be in the same line of text.

    EDIT: I completely forgot to ask, but will this be compatible with all versions of Minecraft 1.7.2 and onward, or only 1.8 and above?
     
    Last edited: Oct 7, 2015
  27. Offline

    I Al Istannen

    @Dark_Serpent I used permissions now, the message is configurable and can also be turned off. You can change between one or two messages needed for a command using a switch in the config. I have also added a switch to allow commands to be executed by the console or the player who casted the command. Further you can use "{PLAYERNAME}" in the "run_command" to get the name of the casting player.
    I hope it is compatible with all versions, I'm not doing crazy stuff in it ;)

    The link is on DropBox if you don't mind: Link. The source is in the jar file, if you want to look at it. But I warn you, it could probably definitly be a lot better. Kinda hard changing the way it works when it is nearly finished ;)
     
  28. Offline

    Dark_Serpent

    @I Al Istannen
    I plugged in into my 1.7.10 server but it didn't seem to work. I also inserted it into an outdated 1.8.3 version of my server but it also didn't work properly. I don't get any errors, a config file isn't generated and I don't think the plugin is conflicting with anything. Does it require anything special, or is there any possibly known conflictions between existing plugins?
     
  29. Offline

    I Al Istannen

    @Dark_Serpent I don't know any. It worked in my 1.8.6 and 1.7.10 server. If no error occures, there may be none. What did you write in chat? In the DEFAULT settings you need to write "Example Greet" in ONE chat message. This is the only predefined command. And it uses one message by default. If that doesn't work, I may put in some kind of debug mode with messages to try to find whats wrong.
     
  30. Offline

    Dark_Serpent

    @I Al Istannen
    I placed it on a blank server and it doesn't work. No config file is generated, no folder, it doesn't show up in the plugins list, and "Example Greet" doesn't appear to do anything.
     
Thread Status:
Not open for further replies.

Share This Page