Filled commandCooldown

Discussion in 'Plugin Requests' started by madtomic, Jan 3, 2019.

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

    madtomic

    Minecraft version: 1.12.2

    Suggested name: commandCooldown

    What I want: I need a plugin to run command or commands after a set of time passed between commands in a task command.

    How it would work: a task command to start the task, execute the initial commands and wait after cool down (timer) then it would run the other set of define commands.

    Player cool down timer are store in a file and keep it persistence if server restarts/crashes.
    Data are save when new player active a cool down command and save again to update when cool down task are executed thus removing it.

    Requirement:

    Starting the task command would store player and time of start.

    /cooldown %player% taskcommand1

    cooldowns.yml
    uuid: <player uuid>
    timer: 20190101122457 (date+time)
    command: command1

    In this example, it would use taskcommand1 to start the task.

    commands.yml
    Code:
    taskcommand1:
      command1:
        - say hello %player%
        - say %player% here some money for you
        - eco give %player% 100
        timer: 2 (seconds)
      command2:
        - say %player% command 2
    
    taskcommand2:
      command1:
        - say command2
        timer: 1
      command2:
        - say command2
    
    ***taskcommand1 starts the task
    ***command2 is execute after 2 seconds after the last command "eco give %player% 100 is executed in command1 set.

    Each player cool down will reference to a set of cool down commands would run when time is reached. All commands should execute as console commands.

    Thank you for reading.

    Ideas for commands/permissions:
    /cooldown %player% taskcommand1
    cooldown.use

    When I'd like it by: As soon as you can, please!
     
    Last edited: Mar 1, 2019
  2. Offline

    PolarBearGalaxy

  3. Offline

    madtomic

    @PolarBearGalaxy
    Thank you for point them out. I am aware of those plugins. As they do not meet my requirements.

    I do not need it task on load. What I need is when a command is executed per player. Every player have their own timer for a set of commands they performed. This only happens when a player start the timer with a command but not with server load task.
     
    Last edited: Jan 3, 2019
  4. Offline

    madtomic

    Anyone else can take a crack at this?
     
  5. Offline

    KarimAKL

    @madtomic I'll try. :)
    EDIT: What is a "task command"?
    EDIT2: From what i understood isn't this more like delayed commands than cooldowns?
     
    Last edited by a moderator: Feb 14, 2019
  6. Offline

    madtomic

    @KarimAKL

    task command, I called it task command because it executes a set of commands in that group.

    It could be delayed commands but it can be use as a cool down as well.

    Such as, I can set a task command to refresh a set of permissions when cool down is reached.

    command1
    - command run task
    timer - cooldown
    command2:
    - command unset permission1
    - command set permission2

    Like for a cool down for quest for example
     
  7. Offline

    KarimAKL

    @madtomic Okay so it works like this?
    Code:
    #List of commands
    TaskCommands:
      #If the command 'Task1' is executed it'll go on here
      Task1:
        #And then execute the commands in the list of commands under 'Command1'
        Command1:
          #It'll execute all these commands
          Commands:
          - "say hello player1"
          - "eco give player1 100"
          #Then wait this amount of time (in seconds)
          Time: 2
        #Then execute all commands in 'Command2'
        Command2:
          Commands:
          - "say hello again player1"
          - "eco give player1 200"
          #Then wait 0 seconds because this is the end of 'Task1'
          Time: 0
      #Then if the command executed is 'Task2' it'll do the same for 'Task2'
      Task2:
        Command1:
          Commands:
          - "say hello player2"
          - "eco give player2 100"
          Time: 2
    Is this correct?
     
  8. Offline

    madtomic

    @KarimAKL

    Looks good!

    Delayed command would work like this
    Code:
    taskcommand3:
      command1:
        - (no command) no action, just a delay of 1 second
        timer: 1
      command2:
        - say delayed_command
     
    Last edited: Feb 14, 2019
  9. Offline

    KarimAKL

    @madtomic
    1. To set no commands you would do this:
    Code:
    Commands: []
    instead of this:
    Code:
    Commands:
    - say hello
    2. You said you don't want any commands and permissions here:
    but here you said to use a command:
    Do you want a command? If so what permission should it have?
     
  10. Offline

    madtomic

    @KarimAKL

    I do need commands and permissions. Sorry about this.

    command would be /cooldown %player% taskcommand1
    permission would be based on taskcommand1, eg. cooldown.taskcommand1, taskcommand2. etc

    Note: All commands should execute as console commands.
     
    Last edited: Mar 1, 2019
  11. Offline

    KarimAKL

    @madtomic Would it be okay to make the command '/cooldown <player> <task>' as i don't see a reason for 'start'?
     
  12. Offline

    madtomic

    @KarimAKL

    That is fine. At first, I thought I was letting the players to start and stop the task commands. This is not needed in fact.
     
    Last edited: Feb 16, 2019
  13. Offline

    madtomic

    Checking in on the status.
     
  14. Offline

    KarimAKL

    @madtomic Just got back from holidays (i was away from my computer in the holidays) and haven't had a chance to work more on it yet.
     
  15. Offline

    KarimAKL

  16. Offline

    madtomic

    @KarimAKL

    It seems to work pretty well. The only thing missing is the permission system.

    permission would be based on taskcommand IDs,

    permission examples:

    cooldown.taskcommand1
    cooldown.taskcommand2
    etc...

    We can also keep this simple by only allowing OP can start the cooldown in-game or keep this a console only command.
     
    Last edited: Mar 1, 2019
  17. Offline

    KarimAKL

    madtomic likes this.
  18. Offline

    madtomic

    @KarimAKL
    Awesome, everything is working as requested.
     
    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page