Approved [1.12] ShortCommands

Discussion in 'Plugin Releases' started by scavenger, Feb 22, 2012.

  1. scavenger TShock Plugin Developer

    ShortCommands v1.0.5.3
    Make your own Commands!
    For TerrariaAPI[v1.12]
    Features:
    • Create your own commands, these commands are shortcuts to other commands.
    • Config to create as many commands as you want.
    Commands
    • /scmdrl - reloads the config file, Requires the permission "shortcmd"
    • Any other commands you specify in the config.
    • If the user has the permission "shortcmd.nocooldown" they will not have to wait for cooldowns.
    Configuration File:
    • Located in: tshock/PluginConfigs/ShortCommands.json
    • The config should automatically generate once you start the server
    • If you have problems or need help, please PM me your config file, and I will help you set it up (if i can).
    Installation:
    • Download & Extract.
    • Place the .dll file in the ServerPlugins folder.
    • Setup your config (An example config is included in the download).
    • Have fun!
    Download:
    TODO:
    • I am completely open to suggestions, so if you want something changed or added, Just ask!
    • This
    • Configure a default value if a parameter isnt specified.
    Changelog:
    • v1.0.5.3
      • Fixed /user group not updating
    • v1.0.5.2
      • Fixed a problem in 1.0.5.1.
    • v1.0.5.1
      • %variables get automatically wrapped in quotes incase they contain spaces.
    • v1.0.5
      • Fixed quotes still making space a new parameter.
      • "%name" will be replaced with the executing player's name.
      • "%account" will be replaced with the executing player's account name (or empty if not logged in).
      • "%group" will be replaced with the executing player's group name.
    • v1.0.4
      • Added cooldown option in config
      • using string.format to allow parameters in different positions
      • cleanup
    • v1.0.3
      • [Update] API tick to 1.12
      • New permission system: added a configurable permission for the alias, where you dont need permission to do the 'long' commands if you have permission to do the alias. set the alias's permission to nothing to disable this.
      • Changed config format, see example config in download.
    • v1.0.2
      • Pagination support (Parameters you use when typing the short command will be put at the end of all long commands).
      • Renamed ShortCMD.dll to ShortCommands.dll
    • v1.0.1
      • Aliases can do multiple commands
    • v1.0
      • Initial Release.
  2. darkos Tshock supporter and programming hack.

    great! i assume the json goes in tshock/tshock ?
  3. k0rd TShock developer

    cool! command alias plugin! :)
  4. DankBud TShock Supporter

    Great! :)


    Edit - Any way we could disable specific commands from showing in /help?
    To reduce confusion.
  5. scavenger TShock Plugin Developer

    I forgot to tell everyone, A blank config is created in tshock/PluginConfigs/ShortCommands.json
    What do you mean? ... The short commands don't show in /help
  6. TehCupcakes New Member

    Interesting idea. So this is basically like a "macro" in a sense for commands you use frequently?

    The only suggestion I have would be to add optional arguments. Although in a lot of cases supplying arguments with a "short command" would make it just as long as a long command, if you only had to change 1 argument out of say 5 it would still be quicker.
  7. k0rd TShock developer

    a per-user command alias database would be really neat

    like /alias lava 'buff "obsidian skin"'
    /lava

    or even scripts of commands

    /alias adventure 'gentraps 5000' 'genchests 999' 'i "shine potion"'

    /adventure
  8. k0rd TShock developer

    harder than it sounds btw :)
  9. scavenger TShock Plugin Developer

    I dont understand xD
    in the config you can give an alias parameters.
  10. k0rd TShock developer

    :)

    each user would be able to save their own commands, in a database.

    for instance, if i ran a certain command a lot (even as a regular default user)

    /warp emerald_city

    i could be like

    /alias 1 'warp emerald_city'

    and from then on, i could always just

    /1

    to issue that command (or list of commands!)
    scavenger likes this.
  11. scavenger TShock Plugin Developer

    That would be awesome.
  12. k0rd TShock developer

    the commands could be registered on greet player - with a check to see if that particular command exists
    it might be wise to use a different indicator for aliased commands so the plugin could e.handled it
    only obstacle would be multiple commands - how to reissue them as the player in sequence?
  13. k0rd TShock developer

    like if you wanted to set
    /alias 1 'warp emerald_city' 'buff 41' 'i dynamite'
  14. k0rd TShock developer

    also i didn't know you could pass parameters :)
  15. Snirk Immington TShock Plugin Developer

    There is a similar shortcut commands in Chat Blocker but stringing commands together under one letter is obviously much cooler. This could go rather far.
  16. DankBud TShock Supporter

    I meant replace the "real" command with the "short" command in /help ;)
    Pagination support would be awesome.
    /ss masterpricelist - i want it short, but pages wont work when its a short. ;(
    Great plugin, using and watching. ;P
  17. hachi Member

    great idea, also a fan of scripting features if possible. this would make all the region/schematic/conversion tasks just that much faster.
  18. scavenger TShock Plugin Developer

    Done, an alias can now do multiple commands!
    Make sure you update your config using the example, It will say theres an error if you keep your old conifg.

    Edit: also added Pagination support etc...
    Last time I tried I wasnt sucessful in removing commands from /help.
    However I can add the short commands to /help, But if you reload the config then I wouldnt be able to remove any commands you removed from the config.
    Oh, and I will add Pagination support.
    k0rd likes this.
  19. k0rd TShock developer

    THANK YOU FOR THIS!!!!!!!!!!!!!
  20. Snirk Immington TShock Plugin Developer

    oh nice, /r1 and /r2; /rd <name>, /ra <person>, /rp <true> (region set, region define, region allow, region protect)
    I had /rg instead of /region, but that looks much cooler.

Share This Page