[INACTIVE][MECH]CommandSigns v0.4 - Issue commands using signs [672]

Discussion in 'Inactive/Unsupported Plugins' started by Edward Hand, Feb 22, 2011.

  1. Offline

    Edward Hand

    CommandSigns v0.4

    Tired of having to type out the same commands again and again? Newbs to your server to lazy to type /rules? Help is at hand!

    Instructions

    Just add the text '[command]' to the top of a sign and put any commands you like on the next 3 lines. Players can then right-click the sign to instantly run those commands. Any command that can be run in chat normally can be run through these signs. Note also that normal permissions for the player using the sign are not effected.

    Here's an example:
    [​IMG]

    (Notice that a single command can spill over several lines if necessary)

    To make the player using the sign say something, use a backslash (\) rather than a forward slash. You can make the player say multiple things using this syntax:

    [​IMG]

    (The colour is achieved using my SignColours mod)

    Advanced:

    [command] can now be replaced by the text of your choice. Square brackets must still surround the title and custom titles must be prefixed by '**' (this is to prevent conflict with other plugins as well as to leave space for the colour tag)

    @ followed by either a player's name or a permissions group restricts commands following to that player/group (does not support inheritance for permission groups).
    This may be used multiple times on a sign to make the sign have different effects for different groups.

    using /*command in place of /command runs that one command as the imaginary user '/CommandSigns'. Add /CommandSigns to your permissions file as if it were any other user (or make /CommandSigns an op) to define what permission level this simulates. The '/' is just to ensure there can't be an actual player with the same name.
    In this way it is possible to allow commands to be run through signs that players would not be able to use in chat.
    Syntax Summary (open)

    • /command - runs a command as the player using the sign
    • /*command - runs a command as the fictional user #CommandSigns
    • @player/group - commands following (up to the next @) are limited to that player/group.
    • \message - prints in chat
    • <NAME> / <X> / <Y> / <Z> - replaced with the using players name/x/y/z-coord on running.
    • **[title] - use on the first line in place of [command] to customise the title of the sign



    Permissions:

    The mod is of course pemissions-friendly. In order to create a command sign you need to have
    Code:
    commandSigns.create

    and to use them:
    Code:
    commandSigns.use

    To target players/groups/use * command modifyer:
    Code:
    commandSigns.super

    Feature Summary
    • Allows chat commands and chat messages to be send on right-clicking a sign.
    • Allows commands to be run on signs that players wouldn't be able to use through chat.
    • Signs usage can be limited to specific players or groups.
    • Supports 'variables' for player name and x,y,z position.
    • Won't allow users to gain access to forbidden commands without permission (secure).
    • Permissions-friendly
    Download Link:

    http://www.srcf.ucam.org/~eh392/minecraft/CommandSigns/CommandSignsv0.4.zip
    (source code is included)

    Change Log (open)

    version 0.1
    • Plugin Released
    version 0.15

    • Bugfix ("Insufficient Permissions" annoyance bug)
    version 0.3

    • Added NAME, X, Y and Z variables
    • Added permission filter
    • Allowed creation of signs that call commands user would not usually have access to
    • Allowed customisation of [command] to other text.
    version 0.35
    • Fixed conflict when using <NAME> in commands overriding permissions.
    version 0.4
    • Bukkit team trying to break everything again
     
    Dimochka, Phaedrus, Xaostica and 4 others like this.
  2. Offline

    Brocklehurst

    This is awesome dude, thanks loads for this!
     
  3. Offline

    anon

    Hmm will you extend this on the future?

    Old mod plugin had a option where a player could issue comands that he did not have access via chat, like for example, a admin plaed a sign /time day. User couldnt run the command, but could use the sign.

    Also, iconomy suport, or itens tax suport if this worked would be great too.
     
  4. Offline

    AntonyDream

    Oh my oh my 8)) I just think about using this with DynamicMarket's buy/sell commands to make physic shop with dynamic prices! Going test it riiiight now!
    --- merged: Feb 22, 2011 4:02 PM ---
    Ahh looks like it need to be upgraded to latest craftbukkit builds
    Code:
    22.02.2011 22:55:20 org.bukkit.plugin.SimplePluginManager loadPlugins
    SEVERE: Could not load plugins\CommandSigns.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:79)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:117)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:82)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.NoSuchMethodException: com.edwardhand.commandsigns.CommandSigns.<init>(org.bukkit.plugin.PluginLoader, org.bukkit.Server, org.bukkit.plugin.PluginDescriptionFile, java.io.File, java.io.File, java.lang.ClassLoader)
            at java.lang.Class.getConstructor0(Unknown Source)
            at java.lang.Class.getConstructor(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
            ... 8 more
    Fix it pleeeease ^^
     
  5. Offline

    Edward Hand

    It is. Are you?
     
  6. Offline

    AntonyDream

    Will it work on 409? If so, ok it's my time to upgrade ^^
     
  7. Offline

    Edward Hand

    It should do, yes.
    --- merged: Feb 22, 2011 4:29 PM ---
    I don't believe this is possible with the way permissions are currently set up. There might be a way to get things like /time to work (with difficulty) but I can't see a way to make it work for command that relate to the play calling them (like /kit for example).

    By this do you mean making command signs cost money to make?
     
  8. Offline

    anon

    Nah, the cost to cast the comand itself, but it would not make any sense if player could only use the signs to cast comands he have access.

    I was refering if he could cast the comands on a sign that he doesnt have access, then it would make sense, but as its not possible, this is not something that should be done. :(
     
  9. Offline

    SSA

    Can this allow players to use commands they don't otherwise have access too?
    I think you can now set it to modify the users permissions to give them the command needed, and then use it, and then remove it. I think permissions is all run cached now or what not.

    What about adding variables to the sign.
    Basically,
    Can I make a sign
    [command]
    /modgrp <player> standard

    to promote who ever hits it to that rank?

    What about setting it so only certain groups can use certain signs?

    Just some thoughts.
     
  10. Offline

    d4vz

    This is awesome! Would it be possible to add in some kind of redstone functionality? Like, the command on a sign is run whenever it receives power?
     
  11. Offline

    RustyDagger

    Dose this work with 424+?

    If so im considering downloading it as well as ur sign colors Cause My stupid players cant seem to read black signs And it has very important info on it maybe some bright colors will get their attention .......
     
  12. Offline

    Edward Hand

    All of my plugins are compatible with the latest builds. (tested on 432)


    Unlikely I'm afraid. You can work out when a sign is powered but not who caused it to be powered (especially if its connected so some very complex circuit).


    Not normally, no. I'm looking into that possibility.
    Its a nice idea. I'll see about adding that too.
    I don't want to overcomplicate the plugin, but its a possibility. What variables would you need?
     
  13. Offline

    Cosmic Break

    i would love to have this.

    so my guests can read the rules sign, then someone sets em to member, and then they cant use the sign anymore.
    since i have the sign to say "X has read the rules" i dont want idiots spamming that in chat
     
  14. Offline

    SSA


    Personally, just player name.
    I'd love to set up a bunch of signs like so.
    Sign 1 promotes you from group A to group B (can only be used by group A) and maybe charge for it (can already do that I believe)
    the sign would look like
    [command]
    /mod <player> groupB
    /pay bank 100
    <player> would use the name of whoever just hit the sign.
    I'm getting the mod command from essentials. http://ess.earth2me.com/index.php/Command_Reference


    I don't know the best way to make everything work. But I would say that by default, only people who could otherwise use the commands could use a sign. And maybe add a /sign <group> command that will let the assigned group (and above) use the sign you were looking at when you used the command.
     
  15. Offline

    Jekotia

    Your download link DISPLAYS as 0.2, but it links to the 0.1 archive. And your versioning seems to conflict with your changelog; the new download is 0.2, but the changelog says 0.15.

    Love the plugin, however. Would it be possible to specify on the second line using square brackets an alternate text to display on the sign? E.g.

    The sign would be created as:
    1 | [command]
    2 | [Ticket Booth]
    3 | /depart

    This would run the /depart command, however, the sign would be DISPLAYED as
    1 | [Ticket Booth]

    I'm mainly asking because on the server I help run we'll be using CommandSigns to remove the need to type /depart to receive a VoxelPort transport ticket, one less "artificial" step in our RP aims, and it would be nice if the ticketbooth signs were a tad cleaner, if possible. I'm guessing this is possible but would require the plugin use either a flatfile or database to store the CommandSigns, as right now you probably store everything necessary in the sign itself.
     
  16. Offline

    Edward Hand

    Thanks for pointing that out. Try it now.

    Correct. That's the nice thing about using signs. I'll see if I can think of some clever fudge to make it work. If so, It'll be in the next release.
     
  17. Offline

    foogasi

    Would there be any way to create some kind of cooldown so that signs couldn't be spammed.

    something like "[command:60]" could give the sign a cooldown of 60 seconds
     
  18. Offline

    Jekotia

    A possible "clever fudge" would be the pairing of two signs. In this example, C = cobblestone block, S# = sign. I'll continue with my earlier ticket booth example.

    From a side view, S1 C S2 (this is part of the "ticket booth", S1 is on the outside, S2 is on the inside where it isn't visible)
    The signs would be attached to opposite sides of the block.
    S1 (the sign visible on the outside to the player)

    1 | [Ticket Booth]
    2 |
    3 |
    4 |

    S2 (the sign hidden on the inside)
    1 | [command]
    2 | [TicketBooth]
    3 | /depart
    4 |

    Right-Clicking S1 would cause it to check the other side of the block for a CommandSign with [TicketBooth] on line two. If this requirement is met, it then runs any commands on lines 3 and 4 of S2



    Another idea that could work with/as an alternative to the pairing system would be to have a flatfile that stores admin-defined "alias" and command pairings. Either from manual editing of server files, or an ingame command: /comsign calias <AliasName> command1|command2|command3|etc, e.g. /comsign calias TicketBooth /depart. Whenever a command sign is used that looks like

    1 | [command]
    2 | [TicketBooth]
    3 |
    4 |

    it would check the flatfile for the alias 'TicketBooth' and run the associated command(s). In this case, just /depart. A huge advantage I see to this method is that the commands executable by clicking a sign now become much more flexible as you have much more space to write the commands than just 3 lines on a sign, such as the ability to do things like iConomy transactions and then a command (because as it is it can be tricky to fit both in there sometimes xD).
     
  19. Offline

    PrivateAlpha


    +1 i want that (can be used for easy warping etc) please!
     
  20. Offline

    Jekotia

    Oh also, would probably help if you remembered to to update your thread title with version numbers. You'll likely get more feedback if people can tell it's been updated at a glance (cause humans are lazy meatbags :p)
     
  21. Offline

    Edward Hand

    Wow. Thank's for your detailed suggestions!

    The problem with your first idea is that it doesn't work if there isn't space on the other side of the block, or if the sign is a signpost not a wall-sign. It works well for your particular implementation but wouldn't work for others in their specific circumstances.

    I like the idea of having separate 'macro' files. I may end up adding that later if there is some interest in it.

    What I think I will try and do initially is change it from requiring [command] to be at the top of the sign to requiring anything at all in square brackets to be at the top of the sign to recognise it as a command sign (while trying to avoid conflicting with other plugins).

    Oh, and I never asked: did you fix the unbreakable signs you mentioned earlier? What was the problem in the end?
     
  22. Offline

    Jekotia

    I'm not sure; unbreakable things keeps popping up, and I'm unsure what causes it. I can say with a fair bit of certainty it is unrelated to your plugins, I just made that association initially due to the timing (I had just loaded CommandSigns onto the server and was in the process of testing them). I worry it is related to the WorldGuard beta and I may have to remake all of the protection regions (as no other plugins on the server should prevent block destruction).

    Also, not to nag, but you should probably update the "header" of your OP where it says "CommandSigns V0.1" in medium-ish, bold text.
     
  23. Offline

    Edward Hand

    Haha thanks. I always forget something.
     
  24. Offline

    SSA


    I would love macro files, it would be amazing =D
     
    Jekotia likes this.
  25. hmm... does anyone know if LWC has any bearing on this? (can i protect a sign so that only certain users can use it? :D )

    Also, it would be cool if you had the option for certain signs to be destroyed after use. Sort of like a scavenger hunt, or a 1-time-only prize.
     
    SSA likes this.
  26. Offline

    Freezy

    Awesome, I was waiting for a plugin like this.

    Variables would be nice, <player> seems to be the most relevant for commands, <holding> for type of item would be nice for tool repair signs.


    how about grouping permissions with different tags:

    example for admin only sign:
    [admin]
    /saveall

    any user:
    [cheat]
    /time day

    [command]
    regular vanilla


    Permissions would work per group
    commandSigns.admin.create
    commandSigns.admin.use

    commandSigns.{whatever}.create
    commandSigns.{whatever}.use

    You might only need a few groups, but let the server admin worry about the exact words
    flatfile config that has different group names
    add run as admin [true | false | as user]

    command
    admin
    cheat
    - asAdmin=true
     
  27. Offline

    Jekotia

    There's really no point adding admin-only signs... The functionality exists: It's called don't be lazy :p It's completely redundant to make admin-only signs. Cheat seems utterly redundant too, as the staff control what commands go on a sign, unless you plan on letting players make [command] signs and saving [cheat] for staff placement. But I honestly cant think of any context where there would be a command a PLAYER normally has access to would be of any use on a sign.


    I agree that a <player> variable would be nice, and an option to destroy the sign on use. The player variable would be pretty simple so I wont touch on that. The single-use signs could be set with [command-1] meaning command - 1 use. If it's possible for your plugin to edit existing signs, it would be nice if we could set the number of times a sign may be used with [command-#] and each time it decrements the # by 1. When it's used when uses = 1, activating the sign would also delete it.
     
  28. Offline

    Zankou666

    Every time I click a sign this shows up.

    2011-02-25 19:30:50 [INFO] This server is running Craftbukkit version git-Bukkit
    -0.0.0-458-g557f3d2-b440jnks (MC: 1.3)

    2011-02-25 19:31:36 [SEVERE] Could not pass event BLOCK_RIGHTCLICKED to SignColo
    urs
    java.lang.NullPointerException
    at com.edwardhand.commandsigns.SignListener.onBlockRightClick(SignListen
    er.java:39)
    at org.bukkit.plugin.java.JavaPluginLoader$21.execute(JavaPluginLoader.j
    ava:232)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:225)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-02-25 19:32:14 [SEVERE] Could not pass event SIGN_CHANGE to SignColours
    java.lang.NullPointerException
    at com.edwardhand.commandsigns.SignListener.onSignChange(SignListener.ja
    va:23)
    at org.bukkit.plugin.java.JavaPluginLoader$27.execute(JavaPluginLoader.j
    ava:262)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:225)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:842)
    at net.minecraft.server.Packet130UpdateSign.a(SourceFile:39)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-02-25 19:32:17 [SEVERE] Could not pass event BLOCK_RIGHTCLICKED to SignColo
    urs
    java.lang.NullPointerException
    at com.edwardhand.commandsigns.SignListener.onBlockRightClick(SignListen
    er.java:39)
    at org.bukkit.plugin.java.JavaPluginLoader$21.execute(JavaPluginLoader.j
    ava:232)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:225)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)

    So I tried removing sign colors plugin and still get the same error.
    To rule everything out, I put a sign down and put [command] on the first line and /god on the second line?
    (I didnt use text colors on the sign does that matter?)
     
  29. Offline

    Jekotia

    Is this the error you got before or after removing SignColours? If it's from BEFORE you removed it, you should paste the error again, but from after removal, as it may differ and make it easier to isolate the problem. Might not make a difference though, as for all we know SignColours is something within CommandSigns. I wouldn't be surprised if it's a module (or the java equivalent) comprised of SignColours' code, used to colour line 1 of the sign.
     
  30. Offline

    Emalde

    Cool plugin, easy way to force people to read help files~
     

Share This Page