Inactive [MISC] bShortcut 1.1.0 - define Shortcuts for Commands [1000]

Discussion in 'Inactive/Unsupported Plugins' started by beecub, Apr 29, 2011.

  1. Offline

    beecub

    bShortCut - Shortcuts:
    Version: 1.2.0
    Download bShortcut
    [​IMG]


    You dont want to type long commands or messages?, you wanna have a shortcut?
    This is your plugin.


    Features:
    • define shortcuts for commands or messages
    • use variables
    • type one command, perform several
    Examples:
    The commands are not from this plugin.
    They are only examples!, You can set up every plugins commands here.
    /fc [item] instead of /fullchest [item]
    /clean instead of /item 1 64
    /wl [name] instead of /weather lightning [name]
    /trules instead of Rules are on our website. go there and read them

    Permissions for all commands are obtained. Someone who does not have the permission to use /item also cant use /item.


    Commands:
    /bShortcut - reloads config file (use it after changes in your config)


    Variables:
    &args - All arguments given to the command
    &player - Name of player whos performing the command
    &[number] - One of the given arguments. Example: &2
    &system - As first parameter in your perform message to write as "system". Example:
    - '&system&args'
    &onlineplayers - Somewhere in your perform message to use this replaced for every player online
    &permissions - Use this as single perform message to show the plugin you want to check the permission for this command. Permission will be bShortcut.user.[YourShortcut] (Example: bShortcut.user./test)
    Any suggestions?


    Configuration:
    Show Spoiler

    The commands are not from this plugin.
    They are only examples!, You can set up every plugins commands here.

    Example - files:
    Show Spoiler

    Example 1:
    shortcuts:
    commands:​
    /g:​
    - /give &1 &2 &3​
    - /m &1 there you got &3 of &2 from me.​
    /myName:​
    - My name is &player​
    - Iam &1 years old​
    /t: /time &args​
    /cleanstone: /item 1 64​
    /breload: /bShortcut reload​

    Example 2:
    shortcuts:
    commands:​
    /gi: /give &args​
    /mp: /manpromote &args​
    /md: /mandemote &args​
    /fc: /fullchest &args​
    /rd: /remove drops &args​
    /tell: /m &args​
    /lbp: /lb player &args​
    /lba: /lb area &args​
    /lbrb: /lb rollback &args​
    /li: /lightning &args​
    /inv: /invsee &args​
    /clear: /clearinventory &args​
    /plugins: /ttttt &args​
    /v: /vanish &args​
    /sreload:​
    - '&4 Attention! Serverreload several seconds lags. Dont move or press any key to stay logged in!'​
    - /save-all​
    - /reload​
    /sstop:​
    - '&4 Attention!, stopping server!'​
    - /save-all​
    - /stop​



    Changelog:
    Version 1.2.0
    • More Wildcards (Variables)
    • Permissions support, not necessary
    Version 1.1.0
    • Variables
    • type one command, perform several
    Version 1.0.0
    • Initial Release
    Request?, i wanna do it. Give me Feedback. I want to hear your opinion. Thanks a lot :).
     
    Witek094, Mahagon, r3Fuze and 10 others like this.
  2. Offline

    CoolOppo

    I feel so stupid... I fixed it because I set the command to be /ban &args... It should just be /ban.
    Sorry, this plugin is awesome beecub!
     
  3. Offline

    enelar

    Thanks, but howto change color of printing text?

    And how to output text not by player?

    LoL nice
    Code:
    2011-07-01 01:13:28 [SEVERE] Could not load 'plugins\bShortcut.jar' in folder 'plugins':
    while parsing a block mapping
     in "<reader>", line 3, column 9:
                /me:
                ^
    expected <block end>, but found Anchor
     in "<reader>", line 4, column 19:
                - &player &args
                          ^
    
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:576)
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
        at org.bukkit.util.config.Configuration.load(Configuration.java:82)
        at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:157)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:175)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:199)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:89)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  4. Offline

    e_zach

    why are you starting a command with an &?
    shouldn't it be - /player &args? if you ment to print out the text, put '' around the text. read the examples first next time.
     
  5. Offline

    Cenarius

    hi there :D
    Code:
    18:37:30 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to bShortcut
    java.lang.StringIndexOutOfBoundsException: String index out of range: 24
            at java.lang.String.charAt(Unknown Source)
            at java.util.regex.Matcher.appendReplacement(Unknown Source)
            at java.util.regex.Matcher.replaceAll(Unknown Source)
            at java.lang.String.replaceAll(Unknown Source)
            at com.beecub.bShortcut.bConfigManager.handleVariables(bConfigManager.ja
    va:90)
            at com.beecub.bShortcut.bConfigManager.handleShortcuts(bConfigManager.ja
    va:77)
            at com.beecub.bShortcut.bShortcutPlayerListener.onPlayerCommandPreproces
    s(bShortcutPlayerListener.java:30)
            at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.ja
    va:272)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:321)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:719)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:691)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:684)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    thought you wanna know about this :p
    thanks for this great plugin ^_^
     
  6. Offline

    enelar

    Nope, i wanna output(And i readed examples ofcource!)
    /me fall assleep => Enelar fall assleep
    /me dancing => Enelar dansing

    And can you replace & with for example %, because minecraft text color codes are &#1, &#2 etc
     
  7. Offline

    Pasukaru

    @enelar
    I don't know the name of the "real" command, but this is probably what you need:
    Code:
    /me: /"realcommandname" &player &args
    
     
  8. Offline

    e_zach

    my point was:
    Code:
    - &player &args #<----- wrong
    
    - '&player &args' #<------ right
    you need to surround text which contains special characters with '' otherwise it tries to parse it as yml and not a string.
     
  9. Offline

    enelar

    Thanks, my fault, example with quotes was soooo far))
     
  10. Offline

    e_zach

    np, i tend to not be very clear about things sometimes. specially at 4 in the morning :p
     
  11. Offline

    beecub

    Up to 953
     
  12. Offline

    Heliwr

    Hi beecub, any thoughts on my request for a &world variable?

    Cheers
     
  13. Offline

    e_zach

    a &world var would be nice. although most plugins with a world parameter already default to the current world if it's not entered anyway. still, could be useful.
     
  14. Offline

    xsrrpp

    Hello beecub,
    could you please add permissions for shortcut comands.
     
  15. Offline

    e_zach

    again, would be nice to set permission nodes
     
  16. Offline

    paully104

    Testing this plugin on build [1000] i'll reply here soon.

    On build [1000] still works perfectly!
     
  17. Offline

    beecub

    Done.
    Setup a perform message containing only "&permissions".
    While performing the shortcut the plugin will check if the player has the permission bShortcut.user.[Your Shortcut]
    Example 5 in first post for another example.


    Version 1.2.0

    • More Wildcards (Variables)
    • Permissions support, not necessary
     
  18. Offline

    e_zach

    which permissions? 3.x or permissionsEX? or do both work?
     
  19. Offline

    jtlcr777

    Keep adding variables! I enjoy using this plugin. Keep up the good work!
    Maybe some variables you could add can be "&randomplayer" or "&iteminhand"

    EDIT: I think theres a bug with &onlineplayers. When I use it in a chain command, any commands after one with &onlineplayers in it doesnt go through.

    /save:
    - /broadcast Attention &onlineplayers! You may now continue. (this one goes thru)
    - /save-all (this one doesnt go thru)

    Also...

    Right now its like this with "/broadcast Attention &onlineplayers! You may now continue":
    Attention jtlcr777! You may now continue.
    Attention beecup! You may now continue.

    I would like rather it be this:
    Attention jtlcr777, beecup! You may now continue.

    Like a list of everyone online.
     
  20. Offline

    beecub

    onlineplayers performs the message for each player online replaced with &onlineplayers

    The second, not performed, message, this was a bug. Fixed a few hours after release, please redownload.
     
  21. Offline

    SieniFani

    This is so awesome plugin thanks for making it! ;)
     
  22. Offline

    Hacr

    NICE :D

    Love this plugin :)
     
  23. Offline

    jtlcr777

    Do you think you could add a delay variable? Like this?
    Code:
    /terror:
    - /spawnmob creeper
    - &delay 1
    - /spawnmob creeper
    - &delay 1
    - /spawnmob creeper
    &delay 1 meaning wait one second, &delay 2 meaning wait two seconds etc?

    Or is that not possible in bukkit?
     
  24. Offline

    VolkovTheGreat

    Hey, just installed it on 1000, and its not working! This is how I set up the config:

    Code:
    shortcuts:
        commands:
            /g: /give &args
            /survival: /mvtp Survival
            /survivalnether: /mvtp NetherSurvival
            /nether: /mvtp Nether
            /normal: /mvtp Normal
            /skylands: /mvtp SkyLands
            /creative: /mvtp Creative
            /spawn: /mv spawn
            /tools: /kit tools
            /homo:
            - &player is truly a total homosexual for life!
            /restart: /say Server Is Restarting! Please Log Off!
            /dbag:
            - You sir are a douchebag!
            /staff:
            - /say STAFF: Owner: VolkovTheGreat, Co-Owner: vNexx, Lead Admin: OblitaRape...
            - /say ...Admins: xXxRedGhostxXx, KFConsumer, Mods: cheesybang22...
            - /say ...200503878, MufusBinLaden.
            /sreload:
            - /say Server Is Reloading! Lag Will Occur! Stay Still!
            - /save-all
            - /reload
    
    What did I do wrong? None of these work for me, and bShortcut does NOT show up in /plugins!

    My log after restart: http://pastebin.com/SLqZ192C
     
  25. Offline

    e_zach

    try putting quotes around all the text based commands:

    Code:
    shortcuts:
        commands:
            ........
            /staff:
            # This
            - "/say STAFF: Owner: VolkovTheGreat, Co-Owner: vNexx, Lead Admin: OblitaRape..."
            # Not This
            - /say ...Admins: xXxRedGhostxXx, KFConsumer, Mods: cheesybang22...
            # this should work as well
            - '/say ...200503878, MufusBinLaden.'
            /sreload:
            - /say Server Is Reloading! Lag Will Occur! Stay Still!
    
    
    the yaml parser is trying to parse that block of text as yaml instead of just thinking it's a string of text. always put single or double quotes round your text blocks.

    EDIT: you should probably fix CreeperNerf as it's also broken.
     
  26. Hey is there any way you could add in an In Game command to add a shortcut ty:)
     
  27. Offline

    VolkovTheGreat

    It works! THANKS!
     
  28. Offline

    briman0094

    Could you add some sort of permissions support for each custom command? Like "bshortcut.[shortcut]"? I don't want my players messing up the map with certain shortcuts.
     
  29. Offline

    ells551

    i would like to have a command that is /day and it would change it so it /time set 0 but i havnt a clue where to start as im new to the stuff could you help please thank you
     
  30. Offline

    jtlcr777

    Code:
    shortcuts:
        commands:
            /day: /time set 0
     
  31. Offline

    e_zach

    it's already implemented, checkout example 5 in the config spoiler in the OP
     

Share This Page