[MISC] SpoutKeyCommands 2.1 - Easier commands with keys [Spout][1060]

Discussion in 'Inactive/Unsupported Plugins' started by Yurij, Aug 22, 2011.

  1. SpoutKeyCommands
    Download Latest: Check Bukkitdev
    Previous Versions: 1.0, 1.1
    GitHub: Link

    Features
    • Set commands to keys on your keyboard.
    • Sqlite and MySql support.
    • Api for developers.
    Requirements
    Optional
    This plugin allows users with the spoutcraft client to set commands to keys on the keyboard,
    wich can make stuff much easier.
    Imagine a long command you often use, made accessible with just the press of a button.

    It provides an api for other plugin developers.
    They can set commands to one player or or all players.
    If a plugin have set a command the player or other plugins cant remove or change it,
    unless the plugin is removed or disabled.

    Commands (open)
    /spoutkeycommands - Main command
    /skc - Main command alias
    /skc set <command> - Set a command to a key.
    /skc unset - Remove a keys command.
    /skc check - Check wich commands are set.
    /skc clear - Removes all your key commands.
    /skc save - Saves the keys to the database.
    /skc load - Loads the keys from the database.

    Usage
    You first set the command by typing "/skc set <command>" in the chat console.
    Then you press your desired key.
    You cant set a command to a key you have set for regular minecraft stuff like
    the movment keys or changing fog distance etc.

    To remove a command you type "/skc unset" in the console and press
    the key you want to remove the command from.

    Permissions (open)

    • SpoutKeyCommands.* - Allows you to use all commands and functionality.
      Defaults to ops
    • SpoutKeyCommands.use - Allows you to set commands to keys.
      Defaults to all users
    • SpoutKeyCommands.reload - Allows you to save and load database config
      Defaults to ops
    API (open)
    You need to add both this plugin jar and spouts api to your project for it to work.

    Example
    Code:
    Plugin skc = pm.getPlugin("SpoutKeyCommands");
    if (skc != null && skc.isEnabled()) {
        SpoutKeyCommandsHandler handler = ((SpoutKeyCommands) skc).getHandle();
        handle.addCommand(player, Keyboard.KEY_R,  "lightning", this;
    }
    
    Methods
    • addCommand(String player, Keyboard key, String command, Plugin plugin)
      Set a player specific key command.
    • removeCommand(String player, Keyboard key, Plugin plugin)
      Remove a player specific key command.
    • checkCommand(String player, Keyboard key, Plugin plugin)
      Check status of a player key command, if it is occupied by another plugin or not.
    • addGlobalCommand(Keyboard key, String command, Plugin plugin)
      Set a global key command.
    • removeGlobalCommand(Keyboard key, Plugin plugin)
      Remove a global key command.
    • checkGlobalCommand(Keyboard key, Plugin plugin)
      Check status of a global key command, if it is occupied by another plugin or not.


    Known Issues:
    • Unknown
    Todo
    • Fix stuff in known issues
    • More config options
    • Maybe localization
    Changelog

    Version 1.1.1
    • Permissions support
    Version 1.1
    • Global commands show up in the list
    • Some api fixes
    • PermissonsEx support
    • Fixed default sqlite database file path for linux (I think)
    Version 1.0
    • Inital release
     
  2. Offline

    Mercury

    @Yurij
    Can you update it please?
     
  3. I dont see any urgent need to do that as it works fine with the latest version (or have you discovered a bug?).
    Although I have some minor enhancements planned
     
  4. Offline

    Mercury

    It doesn't even work for latest CB. There is no config file.

    Code:
    2011-09-30 23:45:52 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-1067-g6301507-b1185jnks (MC: 1.8.1)
    2011-09-30 23:45:52 [INFO] [SuperpermBridge] Superperm/Permissions bridge initialized
    2011-09-30 23:45:52 [SEVERE] ebean.properties not found
    2011-09-30 23:45:52 [INFO] DataSourcePool [SpoutKeyCommands] autoCommit[false] transIsolation[SERIALIZABLE] min[2] max[20]
    2011-09-30 23:45:53 [SEVERE] FATAL: DataSourcePool [SpoutKeyCommands] is down!!!
    2011-09-30 23:45:53 [INFO] Reseting DataSourcePool [SpoutKeyCommands] min:2 max:20 free:0 busy:0 waiting:0 highWaterMark:0 waitCount:0 hitCount:0
    2011-09-30 23:45:53 [INFO] Busy Connections:
    
    2011-09-30 23:45:53 [SEVERE] Could not load 'plugins\SpoutKeyCommands.jar' in folder 'plugins':
    com.avaje.ebeaninternal.server.lib.sql.DataSourceException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.<init>(DataSourcePool.java:210)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourceManager.getDataSource(DataSourceManager.java:210)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager.getDataSource(DataSourceGlobalManager.java:63)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:427)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:388)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:168)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:64)
        at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:78)
        at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:176)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:175)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:138)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:103)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:136)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.createUnpooledConnection(DataSourcePool.java:401)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.createConnectionForQueue(DataSourcePool.java:607)
        at com.avaje.ebeaninternal.server.lib.sql.PooledConnectionQueue.ensureMinimumConnections(PooledConnectionQueue.java:205)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.initialise(DataSourcePool.java:248)
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.<init>(DataSourcePool.java:208)
        ... 17 more
    Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:254)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
        ... 36 more
     
  5. I see you are using mysql.
    It seems it cant create one of the tables by itself.
    One workaround seems to be using some gui to create them manually

    They should be looking like this:
    Code:
    CREATE TABLE SpoutKeyCommands_Global (
        id integer primary key,
        keys varchar(255),
        command varchar(255),
        plugin varchar(255)
    CREATE TABLE SpoutKeyCommands_GlobalConf (
        id integer primary key,
        config varchar(255),
        value varchar(255)
    CREATE TABLE SpoutKeyCommands_Personal (
        id integer primary key,
        player varchar(255),
        keys varchar(255),
        command varchar(255),
        plugin varchar(255)
    CREATE TABLE SpoutKeyCommands_PlayerConf (
        id integer primary key,
        player varchar(255),
        preferred varchar(255)
    I will work on a fix

    EDIT: There should not be any config file
    It is only two configurations wich is saved in the database
     
  6. Offline

    Mercury

    @Yurij

    I tried to add manually.

    Code:
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys varchar(255), command varchar(255), plugin varchar(255) CREATE T' at line 3
    Thing is that 1.0 version with SQLite worked for me.
     
  7. Version 2.0 also works with sqlite.

    I think it has to do with reserved keywords or somthing like that

    EDIT: Version 2.1 submitted for approval at bukkitdev
     
  8. Offline

    misutaanime

    ever thought about a config file so I can keep players from being able to bind certain things to keys.. and example would be I dont want players to be able to use the keys to use /warp or /home commands since in certain things .. like mob arena, player can by pass the built in restrictions on this plugin using hot keys.. which causes all kinds of problems
     
  9. Have you confirmed that they can use them?
    I did a little testing and I could not access any commands I should not have any access to.
    Using this plugin instead of typing a command should not make any difference.
     
  10. Offline

    Windwaker

    You realize this is a vanilla Spoutcraft feature now right?
     
  11. Yes, but it only takes one key.
    With this plugin you can use modifiers
     
  12. Offline

    Lxyx

    Hi There thank you for this very useful plugin, grat.

    But I am afraid I missed something as i tried

    /skc set copy
    /skc set /copy
    /skc set //copy

    I always get "Unknown command"

    Would you have an idea ?

    Thanks
    Lxyx
     
  13. Offline

    Grovert11

    I want to set WorldEdit commands to, but it isnt possible :(
    it just ignores the slashes so if i type /skc set /pos1 it just deletes the slash, and registers it as pos1.
    Could you plzz fix this?
     
  14. It removes the slash in the beginning. (It should do that, but I think it removes all of them).
    When performing commands programmatically, it is done whitout the slash.

    I will begin work on fixing this.
     
  15. Offline

    Grovert11

    Thank you :D
     
  16. Offline

    Lxyx

    Would be graet, Thanks
     
  17. Offline

    pigrocket

    Can you update it now that it's broken? I'm on R0-2, and it doesn't load. I like this plugin because it lets me hook the setting of certain commands to keys into other plugins.
    Code:
    Example:
    I have the Heroes RPG plugin and I want users
    to be able to bind the skills it provides to keys of their choice.
    I'm also using CommandHelper to provide aliases for their commands,
    ("/magic bolt" would ask them to set the command to a key),
    and forcing them to use the aliases by not letting them
    to type in the command to execute it normally.
    With vanilla spoutcraft I can't do all of this.
     

Share This Page