[MISC] ScrollingMenuSign - scrollable command menus with many view types [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by desht, May 24, 2011.

  1. Offline

    desht

    ScrollingMenuSign - scrollable command menus
    Note: ScrollingMenuSign is now on dev.bukkit.org:

    All documentation for the plugin can now be found there. General discussion for the plugin is fine here, but please use dev.bukkit.org tickets for problem reports.

    ScrollingMenuSign lets you attach a scrollable command menu to any sign or map and add menu items to it. Right-click the sign to scroll the list of items, left-click it to select an item and execute its associated command. The inspiration for this plugin was the large number of Minecart Mania station names I (and others) have to remember and type in.



    Some possible uses:
    • A menu of station setting commands for Minecart Mania
    • Newbie user guide menus
    • Warp menus for your favourite teleportation plugin
    • A shop menu - buy/sell/swap items & credits
    • Controlled access to commands that users can't normally run
    Links:
    Changelog

    See the Changelog on dev.bukkit.org
     
    HWei, bluehasia, elmoo32 and 6 others like this.
  2. Offline

    Adam6120

    I'm looking at a sign and i type /sms create hi hi and it gives me a list of the commands
     
  3. Offline

    HWei

    I love this plugin! :D

    Players can pay to wear a hat (BlockHat).
    And pay to get some temporary permissions such as warp and blink (permissionsEx, Essentials, WorldEdit).
    And pay to refill sand pit (WorldEdit). The use limits are refreshed every hour to prevent abuse (SimpleCronClone).

    Unlimited possibility.:p
     
    desht likes this.
  4. Offline

    desht

    Ok, I'll try to take a look tomorrow (not near a computer right now - on my phone).

    Nope, can't reproduce this at all. /sms create hi hi does exactly what I'd expect - creates a menu named "hi" with a title of "hi".

    What version of SMS and CB are you running?

    New release:

    ScrollingMenuSign v0.7.3 (26 Sep 2011)

    • Fixed bug where "elevation_user" setting was being ignored.
    • Fixed bug in command costs where all item stacks in inventory which matched a cost got removed, instead of just one stack.
    • Fixed bug in map view renderer which caused a player kick if a menu which was currently being rendered on a map had an item removed.
    Download from http://dev.bukkit.org/server-mods/scrollingmenusign/files/8-scrolling-menu-sign-v0-7-3/


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

    nala3

    so does sms still need CommandSigns to elevate permissions? Or did desh make it built in now.
     
  6. Offline

    desht

    It's built-in now. See http://dev.bukkit.org/server-mods/scrollingmenusign/pages/command-parser/

    It's mostly compatible with the way CommandSigns did things, with a few changes (and some extras). The page above should give you enough information to get going.

    (CommandSigns is still checked for and can be used, but I'm not sure it even works with CB 1185. I'll probably drop support for it in the next major release).
     
  7. Offline

    nala3

    thanks for the reply :p and great now I can move on lol

    Ohh sorry to nag again. But do uses work? like a user can only use the sign 1 time ever. I didnt see an option for it on the page you gave me but it is in the sign data files
    eNevermind, I'm dumb

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

    desht

    As it sounds like you've already worked out, usage limitations are handled separately from the command parser :) All documented on dev.bukkit.org.
     
  9. Offline

    desht

    Anyone who is using permission elevation needs to read this.

    I'm planning some significant changes to the way permission elevation is handled in the next major release (0.8? 1.0?) of SMS, and there will be a certain amount of migration required. Here's a summary of what I'll be doing:
    • Dropping support for the CommandSigns plugin. All command handling will be via the SMS built-in parser.
    • Dropping the elevation_user setting (the fake &SMS user)
    • Dropping fake user elevation commands. That's the /*command style, although signs using that command will continue to execute them but as if they were /@command
    • Dropping Permissions 2.x/3.x support entirely. Permissions is a dead plugin, I won't be supporting it anymore. If you're still using it, you need to migrate to a superperms plugin (PermissionsEx, bPermissions, PermissionsBukkit...) or accept that SMS just won't work for you any more.
    • Adding new elevation.nodes setting, which will be a list of permission nodes to be temporarily added (with value 'true') to any user who runs an elevated command.
    • Adding new elevation.grant_op setting (default false) which if true will temporarily grant op status to any user who runs an elevated command. This would be needed if you need to run a command from any plugin which doesn't support superperms.
    • Undecided about the @g:group restrictor. Checking for player groups means I have to hook into the API of every permissions plugin I want to support, which is ugly. But, I appreciate some commands may depend on this. What might make a suitable replacement is a @n:node, to check if the player has a specific permission node before running the command. Dropping @g would allow SMS to be completely permissions-provider-agnostic (as long as the permissions plugin in use implements superperms).
    So why am I doing all this? A few reasons:
    1. The fake-player model (/*command) as originally implement in CommandSigns was a very clever way of getting around the problem of running commands as a different user, but at the end of the day, it was a nasty hack - it hooked directly into craftbukkit.jar and used undocumentated/unstable calls, hence the need for a rebuild when the last RB of CraftBukkit came out. It was needed because Bukkit back then didn't provide the necessary support for permissions elevation. Now it's easy to dynamically add permissions to a player with the Bukkit API.
    2. I'm ditching Permissions 2.x/3.x support forever (or unless & until a version of Permissions is released which implements superperms :) ).
    3. I don't want to directly hook into the API of any permissions plugin if I can at all avoid it (hence the possible loss of the @g: restrictor). E.g. as far as I can see, zPermissions doesn't provide a published API for checking if a player is in a given group, so @g: won't work with zPermissions (but everything else will). And I don't intend to hook into a new API every time a new superperms permissions provider is released. When we're asking if a player is in a group, what we really want to know is if a player has a certain permission. So why not just ask that directly with a @n: restrictor? (What is actually likely to happen is that @g: and @n: will both be supported for one release, and then @g: will be dropped).
    I appreciate some people may be inconvenienced by the change, but I believe it's necessary to streamline SMS and remove a lot of cruft that it's inherited. The migration should be easy enough, and is a one-off process: take the list of nodes that the &SMS user has from your permissions config, and put them in elevation.nodes in the SMS config.yml. And set elevation.grant_op to true if you need to run commands from any plugin which doesn't understand superperms.

    I'd appreciate any comments or suggestions about this. The next release is still a little way off and I'd like to ensure it goes as smoothly as possible.
     
  10. Offline

    Imm0rt41

    i cant figure out how the fuck im supposed to remove an item from a menu, i have tried to many variations, i DONT FUCKING GET IT. it just says Usage /sms remove <menu-name> <item-index|item-label>

    i do EXACTLY that, and it just keeps saying it, and its PISSING ME OFF. someone tell me how i would remove something with these options

    menu is gameworldwarps
    item is labeled as The Redstoning
    item command is /warp Redstoned

    how would i remove that item from that menu? dont give me the usage thing, tell me exactly how i would type it
     
  11. Offline

    HWei

    It is OK. Just needs some configuration changes when update. ;)

    Code:
    /sms show gameworldwarps
    Read what's the number of the item "The Redstoning".
    Suppose it is 3.
    Code:
    /sms remve gameworldwarps 3
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  12. Offline

    Imm0rt41

    oh, ok, thanks
     
  13. Offline

    desht

    @HWei has already explained it pretty well, but you can also remove items by label if you want, e.g. in your case, do:
    Code:
    /sms remove gameworldwarps "the redstoning"
    
    You need to quote that one because it contains spaces. For labels which don't contain spaces, the quotes are optional.

    It's all documented on dev.bukkit.org, in particular http://dev.bukkit.org/server-mods/scrollingmenusign/pages/usage/removing-menu-items/
     
  14. Offline

    panade

    if i install the jar from 1.7.3 i still get 1.7.2 in my pluginlist, is this just not updated version number or a wrong file.

    i got a problem with the command parser. i use mcmyadmin this means editing the permission files manualy is always a bad idea with it XD otherwise it does strange things. but i added &SMS as operator and as highest rank with all permissions, but it still says no permissions. this means in my eyes the elevation is broken for me :\ im searching for a solution the whole day and im realy out of ideas. maybe here someone knows a workaround.
    i tryed first a combination with commandhelper but the problem seems to be in the command parser itself.

    another question is, when and why exactly does the plugin print the (sorry dont kmpw the exact error anymore) "Cannot Execute....." or similiar in the chat. and i mean in the chat and not console, it shows then the whole sms line i typed in.
     
  15. Offline

    desht

    Huh. Not sure what happened there, but you're right - it was 0.7.2. Sorry about that. I've uploaded the real 0.7.3 - get it at http://dev.bukkit.org/server-mods/scrollingmenusign/files/9-scrolling-menu-sign-v0-7-3/

    I'd need to see your permissions file, and your menu file (that's in plugins/ScrollingMenuSign/data/menus/<menuname>.yml) as I'll also need to know just what permissions plugin you're using.

    Again, I'll need to know the exact error text here, but I think it's probably related to your first problem above, with the permissions for the &SMS user.

    By the way, the whole permission elevation thing will be a lot simpler and less error-prone in the next major release, although it will require the use of a superperms plugin - no more Permissions 2.x/3.x.
     
  16. Offline

    panade

    oh good :-D about the version thx.

    im using permissions bukkit with mcmyadmin.
    this is what mcmyadmin does instead of adding the fake user right:
    Code:
        panade:
            groups:
            - supernerd
        ?
        :   groups:
            - supernerd
    this is the permissions group
    Code:
        supernerd:
            permissions:
                superpermbridge.*: true
                commandhelper.useralias: true
                commandhelper.reloadaliases: true
                commandhelper.repeat: true
                superpermbridge.commandhelper.*: true
                mchat.prefix.supernerd: true
                mchat.suffix.supernerd: true
                mchat.prefix.admin: false
                mchat.suffix.admin: false
            inheritance:
            - admin
    
    u see i gave it superpermbridge nodes für everything wich usualy works fine :-D

    heres the permissions node for the lowest group, only me is able to make those signs but everyone can use it.
    Code:
        default:
            permissions:
                scrollingmenusign.execute.elevated: true
                mchat.prefix.default: true
                mchat.suffix.default: true
                permissions.build: true
    but &SMS is also added as Op so... i will try the new version and maybe try to fix the group user ? with an backup :-D but its all realy weird.

    and i have read the info about the new version, im verry looking forward to it :-D
    its incredible how theres not much plugins to elevate the rank for users to perform some stuff XD
    this + commandhelper is a allround tool, you can replace 90% of all economy shop plugins with this but if commandsigns or this is broken im screwed XD

    EDIT: error reproduced, only appears if i wanna combine it with commandhelper (macro plugin)
    Code:
    Execution of [$0,200 /*bplot mcs1 <NAME>] failed.
    maybe this isnt scrollingmenu sign but im realy not sure. the command itself is tested and working btw.

    i got fixed the no permissions problem now with op &SMS and the new version :-D

    EDIT2: i figured out, that if i add $0,200 in a commandhelper command to make a automated macro for the signs its keep saying "cost: format must be <item,quantity>"
    i dont know why heres the macro i wanna do with commandhelper. usualy commandhelper only issues the macros i give him, in this example i is issuing the sms create but then stops at sms add.

    /bplot $plot $user = /region addowner $plot $user \ /sms delete $plot
    /plots $plot = /sms create $plot $plot \ /sms add $plot Buy "$0,200 /*bplot $plot <NAME>"

    EDIT3:
    ok as it looks now, my problem is chaining commands well doesnt work. i have 2 commands only to be executed if the fee is paid. if i do "$o,200 /*sms delete mcs1 /*region addowner mcs1 <NAME>" it thinks i do one big command (tought off the message from sms how to use the del command)
    if i use && between both command the sms delete is only executed by fee but the region addowner is executed anyways :-P
    if i try to workaorund it with commandhelper i get stuck, because sms seems to not be able to handle commandhelper. i think its sms because it also includes the $0,200 part of the execution.
    im getting crazy right now XD but well maybe theres another way ich i dont see even if i have read the wiki command parser page 10000 times now :-P

    if its not added, i recommend to add a support for more than 1 comman, im not sure if this macro thing works because it seems to only be able to handle 1 command watched for restriction by group.

    the reason why i need sms delete is, people cant remove the sign otherwise after they bought plot wich would be the perfect solution because otherwise others can also buy this plot if the sign is not removed. if there is a way to execute more than 1 command with 1 fee it would be mighty.

    EDIT4:
    i know its much to read :-P i tryed the uses limitation now according to my problem in EDIT3...
    XD if user has not enough money, the use is wasted and the sign locked.... :-\
    also cant do that.
     
  17. Offline

    desht

    Yeah, a lot to read :)

    OK, I'm not really familiar with mcmyadmin but it sounds like it has problems with the &SMS user, presumably the & symbol. A couple of workarounds until the next major release (when the &SMS user will just go away):

    - Manage your permissions file directly with a FTP upload or whatever - probably not the best idea.
    - You can change the &SMS user to something else with "/sms set elevation_user XXXXX". But take are to choose a username that won't be used by a real person. A long random string of letters and numbers. (The reason for the & is to prevent a real account being created and getting the permissions assigned to the &SMS use

    For the $0,200 not working in CommandHelper, it looks like CommandHelper is performing an argument substitution on the "$0 ..." part, changing it before SMS sees it. Again, not too familiar with CommandHelper, but maybe there's some way of escaping the $0,200 part so CommandHelper ignores it?

    I see what you're trying to achieve there, and I think the next release might help there too - it will become possible to have macros inside a costed command, e.g. put your 2 commands in a macro and then do "$0,200 %mymacro". Hopefully that will solve your problem...
     
  18. Offline

    desht

    @panade, I've done some testing with SMS in conjunction with CommandHelper, and there are definitely some odd interactions which make doing what you're trying to do a bit tricky. I have some plans to get this all working nicely, but it's going to take a little more coding and design work. Expect something useful soon, in the next major release...
     
  19. Offline

    desht

    New release (quite a big one):
    ScrollingMenuSign v0.8 (6 Oct 2011)

    • Dropped support for Permissions 2.x/3.x. Only superperms-compatible permissions plugins are now supported.
    • Dropped support for CommandSigns 0.9. The built-in command parser is now used for everything.
    • Now uses Register (multi-economy support) as an external plugin. Download fromhttp://dev.bukkit.org/server-mods/register/files/1-1-5/ and put Register.jar in your plugins/ folder along with whatever economy plugin you use.
    • Initial Spout support. If present (and player is using the Spoutcraft client) then maps which are menu views now show the menu title as their item name in the inventory. Also, configurable key bindings can now be defined to scroll and execute menus (default is cursor up/down, and Return). Further Spout enhancements are planned...
    • Dropped support for the &SMS fake user. Instead a configurable setting 'elevation.nodes' is used to list the temporary permission nodes to add to a player who is running an elevated command. The first time v0.8 is loaded, this setting will be automatically initialised to the permission nodes that the &SMS user has (or whatever user was specified by the 'elevation_user' setting). Permissions are now added via the built-in Bukkit superperms interface.
    • All fake-user commands (e.g. /*command) now get run as if they were /@command.
    • New configuration setting 'elevation.grant_op', default false. If set to true, players get temporary op status when running elevated commands. You should only need to set this true if you need to run elevated commands from plugins which don't support superperms.
    • Command parser enhancement: new restriction operators @n: and @i:. @n:node restricts commands to player who have the specified permission node. @i:id restricts commands to players who are holding an item of the given id in their hand.
    • The @g:group restriction operator should be considered deprecated. @n:node can be used instead (e.g. instead of @g:admins, put a node like 'isAdmin: true' in your admins group in your permissions config, and then use @n:isAdmin).
    • Command parser enhancement: new cost types $X, $H, $F, $E can be used to charge (or grant) experience, health, food, or economy credits respectively. ($0 can still be used for economy credits)
    • Command parser enhancement: the string <INAME> is now replaced by the name of the held item.
    • Macro enhancements. Macros can now be called from anywhere in a command (i.e. after a @ or $ restriction) where previously they could only be called at the start of a command. In addition, macros can now be passed arguments.
    • Macros are now stored one per file under the data/ directory, like menu and view data is. On startup, the commands.yml file will be automatically migrated to the new structure and renamed to commands.yml.OLD.
    • New permission nodes scrollingmenusign.maps.toSign and scrollingmenusign.maps.fromSign to control whether players may copy maps to and from signs, respectively. Default is true if player is an op or has scrollingmenusign.admin.
    • Menu views (signs & maps) may now have owners (default for new views is no owner). New configuration item 'use_any_view', default true. New permission node scrollingmenusign.useAnyView. If 'use_any_view' is set to false and players do not have the 'scrollingmenusign.useAnyView' node, they will not be able to use views owned by someone else. This may be useful if you want to restrict a map view to one player only - you can set the ownership of the map with the new '/sms view' command.

    Download from http://dev.bukkit.org/server-mods/scrollingmenusign/files/10-scrolling-menu-sign-v0-8/

    Docs on dev.bukkit.org not updated yet, in progress.

    @panade - you should be able to do what you trying to achieve with this release, although in a slightly different way:

    1 .Set up a macro in SMS like this:

    Code:
    /sms m a buyplot $0,200 /@region addowner <1> <NAME> $$ \\&cYou can't afford that plot! $$$
    /sms m a buyplot /@sms delete <1>
    
    2. Add this alias to CommandHelper:

    Code:
    /plots $plot = /sms create $plot $plot \ /sms add $plot Buy "%buyplot $plot"
    
    3. Make sure you have the right permission elevation in SMS:

    Code:
    /sms set elevation.nodes scrollingmenusign.commands.delete
    /sms set elevation.nodes worldguard.region.addowner.*
    
    That should do it. The macro might look a bit odd, but it works like this:
    • 200 credits is charged, and if that's affordable, the /@region command is run
    • If it's not affordable, the command after $$ is run - tell the user he can't afford the plot, and terminate the macro with $$$
    • If it is affordable, macro execution continues to the next command, and the menu is deleted.
    • <1> inside the macro is a parameter - it's replaced with the the plot name ($plot)
    You'll also need to ensure that whoever runs /plots is able to use /sms add and /sms create, but presumably that would be an admin-type user anyway.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  20. Hey @desht , I like what you've done here with your plugin!

    I'm currently busy with my own and can't get the map working. I was wondering if you would share your source code with us (or just me.) I would like to see what you've done to create this excelent plugin!

    Thanks in advance!
     
  21. Offline

    desht

    The source is available and always has been :)

    There's a link to my github repo in the top post. The map stuff is a bit weird and I'm not totally certain I've done it the best way, but it seems to work... anyway, see the SMSMapView and SMSMapRenderer classes in particular.
     
  22. Offline

    HWei

    CB 1240, ScrollingMenuSign 0.8, PEX 1.14.
    Can not use permission elevation...
    No help to set elevation.grant_op to true or add permissions to elevation.nodes.

     
  23. Offline

    desht

    I'll need a bit more info...

    What does your elevation.nodes setting contain? And what is the command (and plugin) you're trying to run?
     
  24. Offline

    HWei

    essentials.weather is OK. (Essentialsplugin)
    blockhat.hat failed. (BlockHat plugin)
    permissions.manage.users.permissions.timed still in test failed. (PEX plugin)
    worldedit.clipboard.load and worldedit.clipboard.paste is OK. (WorkdEdit plugin)
     
  25. YouTube preview is broken.
     
  26. Offline

    desht

    Yeah looks like the uploader closed his account. I'm looking for someone to do new videos right now.

    blockhat.hat worked fine with elevation.grant_op set to true (BlockHat isn't superperms-aware).

    PEX... yeah. This one's a problem. Although it's (obviously!) a superperms-aware plugin, it doesn't use the player.hasPermission() interface that a regular plugin does, so adding nodes in the usual way (player.addAttachment()) doesn't work. And giving the caller temporary op status with grant_op doesn't work either, since PEX doesn't appear to take any notice of player op status.

    There is a way around this - a new type of elevated command. My thought is for a command style like "/#pex user desht timed add blockhat.hat 60", where /# means to run the command on the console, i.e. using the console as the command sender. This will only work for commands that support being run from the console, but in that case should always succeed. In the case of PEX commands, they all run fine on the console.

    This doesn't even need a node to be added to elevation.nodes, since plugins never (?) check for permissions when the command sender is the console.

    I've done some testing with this, and it looks good so far. I'll see if I can get an 0.8.1 release out very soon.

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

    HWei

    This solution is smart! :D
     
  28. Offline

    desht

    New release:
    ScrollingMenuSign v0.8.1 (7 Oct 2011)
    • Added support for /#command style, to run the command as if from the console. This only works for commands which can be run from the console in the first place, but for supported commands, will always work. This may be useful for running commands like 'pex' (PermissionsEX) which doesn't work with normal elevated permissions or temporary op, but do work from the console.
    See http://dev.bukkit.org/server-mods/scrollingmenusign/pages/command-parser/ for more information (section Console Commands)

    Download from http://dev.bukkit.org/server-mods/scrollingmenusign/files/11-scrolling-menu-sign-v0-8-1/

    Docs on dev.bukkit.org are pretty much up to date now.
     
  29. Offline

    HWei

    Thank you for updating! [diamond]
     
  30. Offline

    panade

    sms doesnt create a config file :-\ it seems to be enabled but every command i try shows help of sms
    console spams "Cannot run alias commands, no config file is loaded"
    dont know the source of this warnings
     
  31. Offline

    desht

    Hmm, are you sure that error isn't coming from CommandHelper?

    And what files are under your plugins/ScrollingMenuSign folder?
     

Share This Page