Inactive [MECH/MISC] TriggerCmds v1.2 - 'Link Cmds to buttons/levers' [953]

Discussion in 'Inactive/Unsupported Plugins' started by Sammy, May 9, 2011.

  1. Offline

    Sammy

    TriggerCmds- 'Automation, automation, automation'
    Version: v1.2
    Download :(V1.0) (V1.1) V1.2

    Do you like this plugin ? buy me a beer !!​
    [torch] [​IMG] [torch]
    This was a popular request that made me excited :p

    With tcmds you can link any type of craftbukkit or plugin commands to buttons/levers/plates
    It's simple too use and it has persistence so you can reboot your server without loosing anything =)

    Tutorial:
    Make a trigger:
    1. /tcmds edit TriggerName - Opens/creates the trigger edit
    2. /tcmds cmd $me:/tp $ply $me - Makes you teleport the player that presses the button to you
    3. Left Click on the switch - Regs the switch and closes the edit
    Delete a trigger:
    1. /tcmds edit TriggerName - Opens/creates the trigger edit
    2. /tcmds del - Deletes the trigger from the db
    Delete a Link:
    1. /tcmds edit TriggerName - Opens/creates the trigger edit
    2. Right Click on the switch - Deletes the switch and closes the edit
    Runners:
    • $me: - The cmd will be executed by the trigger maker (only if is online)
    • $ply: - The cmd will be executed by the player that pressed the trigger
    Variables:
    • $me & $ply - Used inside the command you want to declare
    Features:
    • Simple way to link cmds to triggers
    • Works (in theory) with almost any command
    • Uses persistence to save all the triggers
    • Has permissions
    Commands:
    Code:
    commands:
      tcmds:
        aliases: [triggercmds]
        description: TriggerCmds management
        usage: |
            /<command> list - List of your triggers.
            /<command> edit [name] - Starts trigger edit.
            /<command> cmd [cmd] - Command registration/modification.
            /<command> del - Deletes the trigger.
            /<command> help - TriggerCmds Help Page.
    
    Permissions:
    Code:
    triggercmds
    To do:
    • Scripts (multi-commands)
    • onBreak deletes link
    • User groups (I might put it... still not sure) (tks @QuackzMcDuck )
    • Add a fakePlayer to overwrite permissions (tks @QuackzMcDuck )
    • Link the triggers with redstone (I have to find a cool way)
    • Timed commands (maybe!! I guess ^^)
    • Button Cooldown
    • One Time per player buttons (maybe on 1.4/1.5)
    Changelog:

    Version 1.2
    • Added the variables $me and $ply
    • Recoded some parts of the reg
    • Removed redundant cmds
      • /tcmds stop is now automatic when Left Click or Right Click
    • Added pressure plates
    • Reg Trigger Link - Left Click
    • Del Trigger Link - Right Click
    Version 1.1
    • Fixed yml error (sorry about that)
    • Added delete function (never rush a release)
    Version 1.0

    • First release
    !!! Lets give tks to @Cybird and @Jonathan Thorpe for the idea !!!​
     
  2. Offline

    Shanev

    Is there a way for players to only being able to trigger commands only with buttons/levers/plates and not via chat?
     
  3. Offline

    Jonathan Thorpe

    Just downloaded 1.2, works like a charm. Good work with the variables you have implemented, perhaps a couple more will come at a later date, although its hard to see too many other variables that would be useful. Also nice to see link creation has been simplified, nice idea with the left-click/right-click to indicate your desired action. Also feels better to start the edit, specify the command, then click the target button and have the edit closed automatically, just makes the whole process smoother and more elegant.

    Hope you enjoy your time away, and come back refreshed with some more ideas to take this plugin further. Please keep up the great work! :)

    You obviously don't understand what this plugin is about. If you read it properly, you would realise that this plugin does exactly what you want.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  4. Offline

    valdark

    Perhaps he means command free setup? But that would require all buttons and all levers being linked to the same command unless you use attached block type to set separate commands and have a config file to set up what each combination does.
     
  5. Offline

    Jonathan Thorpe

    Not a plugin developer, but I would imagine that something as versatile as this plugin would be very hard to implement without commands. I think the developer's done incredibly well to make this work at all, let's not ask too much of him when the plugin has only been around for a week.
     
  6. Offline

    valdark

    I understand, I was just trying to decipher what Shanev might have meant and I tend to ramble on about how it might be possible to achieve ideas that I respond to.

    I understand that all of these devs put in hard work, I couldn't do it. I'm happy that the option is there at all and with the concept I was brainstorming you would be severely limiting the potential of this plugin.
     
    mbsuperstar1 likes this.
  7. Offline

    Sammy

    You were right, this way is simpler... I thought about it and come up with the idea of the right and left click. :)
    Well if you remember of more variables please tell me were or in PM

    I think what he wants is an option that makes so the commands can only be triggered by the switches and not the chat.
    But I'm not going to make that, it seems to extreme
     
  8. Offline

    Shanev

    The problem I encounter with this plugin (and with commanSigns) is, that whenever a command is set up in the permissions file you are able to use it with this plugin AND with the command line. When you remove the command from the permissions file you're not able to use it either way.

    What I'm searching for ist a way to set up commands, which you only can use by pressing a button. I want to use it with uQuest, to make a place where you can get quests. I don't want players to being able to use the "/uquest give" command everywhere, but only at a specific place where they have to push a button.

    I hope I could make my statement clearer this time ;)

    btw: this plugin is great for what it is supposed to do (as commondSigns). But both of them rely on permissions and can only use commands that are in the permissions file.
     
  9. Offline

    Sammy

    Yap I get you, I'm trying to create a FakePlayer bot that you can add to the permissions file, but I had not success, and now I can't code this for a while... but when I'm back I'll try it some more
     
  10. Offline

    Jonathan Thorpe

    Yes, that's much clearer :)

    I understand what you're requesting now... a way to somehow "disable" specific (or all) commands from the console, but still executable via this plugin or CommandSigns (or indeed future plugins with similar functions). That would either require a method of detecting how the command is executed (directly via the console, or automatically from a plugin), and deciding how to handle the command (either cancel it, or allow it), or building a way to inject commands without using the console. It does seem very difficult, perhaps one day a plugin (maybe this one?) will be able to do this.

    On another note, as well expanding the variables available to this plugin, perhaps some kind of basic logic conditions, so commands can be chosen depending on the outcome/state of something else? An example would be a lever, which can execute two different commands based on its on/off state. Another, more complex example would be running a command silently in the background, parsing its response, and deciding whether or not to execute the next command based on the response of the first one. An example of this would be a dispenser that gives an item ONLY if an economy command successfully completed.

    Just an idea, probably impossible to create :)
     
  11. Offline

    Sammy

    The lever one is possible, I may have a go with it when I restart to code in a couple of weeks...
    The economy one is impossible without doing specific methods to the economy plugin and that I would only do if bukkit had a economy system built in (maybe in the future !!)
     
  12. Offline

    Jonathan Thorpe

    I was thinking more of a way to monitor text output from the first command, and use regular expressions to match up the output to user-defined strings to define whether or not the first condition has been met. For example, "Economy Plugin A" could output the text "Bank transfer successful. You have deposited (x) coins.", but "Economy Plugin B" could output the text "You have transferred (x) coins into your account." for the same equivalent operation. This would require a whole new editing function to specify the initial command, the text to match from the output of the initial command, along with two further statements to define what happens if there is a match or not:

    /tcmds edit <CommandName>
    /tcmds cmd <CommandToExecute>
    /tcmds match <TextOutputToMatch>
    /tcmds matchtrue <CommandToExecuteIfTrue>
    /tcmds matchfalse <CommandToExecuteIfFalse>
    *click button to link command and close editing*

    For levers:

    /tcmds edit <CommandName>
    /tcmds cmdon <CommandToExecuteForOnState>
    /tcmds cmdoff <CommandToExecuteForOffState>
    *click lever to link command and close editing*
     
  13. Offline

    Devian50

    maybe you could add a console variable so when a button is pressed the user is given something or the user is rocketed (with commandbook)
     
  14. Offline

    Jonathan Thorpe

    If I understand you right, this already works with this plugin: "/tcmds cmd /give $ply 4 64" would give the player who pressed the button 64 blocks of cobblestone. or you could link a commandbook command and pass the $ply variable to identify the player. Simple!
     
  15. Offline

    Sammy

    I think that you don't get the point of this plugin, the idea is for players to add the cmds to buttons not me ^
     
  16. Offline

    AtheriShadow

    I think this was asked earlier and unanswered, but is there any chance that this could become compatible with MoveCraft? At the moment the commands can be registered to the buttons but once the vehicle moves (taking the buttons with it) they no longer work unless the vehicle is moved back to the same position since the commands are tied to the position rather than the button itself.

    No big deal if it's not feasible but dear lord would it be sweet to just make an ignition switch in the vehicle instead of having to type the commands every time.
     
  17. Offline

    Sammy

    @AtheriShadow
    Well its doable but I will not support it...
    I feel like that's be something MoveCraft's developers should add as a feature.
     
  18. Offline

    oliverw92

    Could you add a console runner (i.e. commands get executed by the console)?
     
  19. Offline

    Sammy

    I was trying to learn how to do this (making a fake user that passes cmds) but I failed and no one helped me
    If you now how please have a look at my help post
     
  20. Offline

    DaveDee

    Sweeet =D
    How about optional cooldown for bttons?
    and also support for common chating
     
  21. Offline

    Ratchet

    what would I type to have a button do the command "/town spawn"?

    would it simply be /tcmds cmd $me:/tp spawn?

    thanks
     
  22. Offline

    Sammy

    No, /tp is the server teleport command, if /town is a command from a plugin you do it like this:
    I'll add it to the List, but I wont promise anything. ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  23. Offline

    hofec

    Implement cooldowns and u will be my boy ! :D

    Epic plugin, thank you. [diamond]
     
  24. Offline

    Smirrom

    Very cool plugin! Waiting for redstone circuit activating commands.
     
  25. Offline

    Minecrafta2z

    My god this is really amazing, we would love to use it as a quest reward type plugin. When you reach the end of a dungeon you hit a button to recieve your reward. The only problem is we would need a one time use or atleast a cool down. Thanks for this amazing work! Hope to see a cool down feature soon :)
     
    hofec and Jonathan Thorpe like this.
  26. Offline

    Jonathan Thorpe

    One-time use: if command-stacking gets added, you could create a button that fires off a command, followed by a command to delete itself... or at least reconfigure itself to show a "Sorry, this reward has already been claimed!" message on second use.
     
  27. Offline

    Sammy

    This would make the plugin a bit more resource heavy, and I would need to make yet another database...for now it'll have to wait (maybe on 1.4)...
    But I will add the multi cmds so you can for instance, teleport the player after giving him the reward.
    I may start coding v1.3 next week
     
  28. Offline

    blacklazer911

    WOAH, This is so pro, Now I don't need to worry about people needing stuff. ;)
    Nice job man, Keep the great work. [diamond][diamond][diamond][diamond][diamond] diamonds for you, good sir.
     
  29. Offline

    Sammy

    Thanks man, that feedback really means a lot for me :)
     
  30. Offline

    blacklazer911

    If this gets updated for 1.6, does that mean I lose all my triggers?
     
  31. Offline

    Sammy

    Well, it depends, bukkits persistence doesn't let me add columns on an existing database, so if I have the need to make another one you will need to delete the old database.
    The good news is that, I don't think I'm going to need to add more columns for now
    Long story short: maybe but not likely ;)

    By the way : I have a final exam next week, after that I may start coding v1.4 :D
     

Share This Page