#(baileyc889) request for command script "Tab_map"

36 messages · Page 1 of 1 (latest)

quartz wedge
#

I have a command script with several arguments, each with their own unique set of sub-arguments and so on. The "tab completions" does not allow for tabs to filter per-argument, and "Tab complete" can get overly complicated. Im wondering if its possible to add another option called "tab map"

Maybe not exactly like my example, but something similar for dynamic tabbing without the need for extreme procedural tabbing and unwanted tabs from the simple method

For example:

    type: command
    debug: true
    name: test
    usage: /test
    tab map:
        check:
        list:
            <server.online_players>:
        teach:
            <server.online_players>:
                override:
        forget:
            <server.online_players>:
        spellbook:
        clear:
            <server.online_players>:
        clear_all:
        ban:
            <server.online_players>:
                spell:
        tempban:
            <server.online_players>:
                spell:
                    duration:
        unban:
            <server.online_players>:
                spell:
        treehouse:
    
    ```
dry juniperBOT
#

(baileyc889) request for command script "Tab_map"

dry juniperBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

indigo wedge
#

put a proc in the tab complete

#

then all the logic inside the proc

quartz wedge
#

do you have a good example I can follow then?

indigo wedge
#
tab completions
  1: check|list|teach|forget|spellbook|clear|clear_all|ban|tempban|unban|treehouse
  2: <context.args.proc[my_tab_proc]>
  ...
my_tab_proc:
    type: procedure
    definitions: args
    script:
    - choose <[args].first>:
      - case check:
        - determine ...
      - case list:
        - determine ...
      ...
#

pretty basic example

icy olive
#

i made this resource to do exactly that ^

quartz wedge
#

i can go down that route. but I felt like the tab map would be a lot easier for new players to follow and much more straight forward

indigo wedge
#

i have to agree with that

icy olive
#

sure, iirc my resource is what prompted mcmonkey to make even the basic version in the first place

quartz wedge
#

you could go one step further with this to make it accept perms per argument.

    type: command
    debug: true
    name: test
    usage: /test
    tab map:
        check: denizen.all
        list: denizen.all
            <server.online_players>:  denizen.admin
        teach: denizen.admin
            <server.online_players>: denizen.admin
                override: denizen.admin
        forget: denizen.admin
            <server.online_players>: denizen.admin
        spellbook: denizen.admin
        clear: denizen.admin
            <server.online_players>: denizen.admin
        clear_all: denizen.admin
        ban: denizen.admin
            <server.online_players>: denizen.admin
                spell: denizen.admin
        tempban: denizen.admin
            <server.online_players>: denizen.admin
                spell: denizen.admin
                    duration: denizen.admin
        unban: denizen.admin
            <server.online_players>: denizen.admin
                spell: denizen.admin
        treehouse: denizen.admin
    ```
#

(in this example, a player can "/test list" themselves only, while an admin could "/test list bailey" for the script part to pull online players

#

idunno. just a thought i wanted to get out

icy olive
#

thats not quite valid mapping syntax, you can have both a value and stuff under it

quartz wedge
#

not quite valid but it makes sense i guess

icy olive
#

in my engine i handle it with like ?denizen.all list:

#

but it might be better for a more offical things to just have a permissions key under it

quartz wedge
#

could have "permission" and "args" keys in each argument map, then more argument maps further in follwing the same format

#

the perm thing isnt necessary, that can be handled in the script party just as easy

#

but the tab map just makes a lot of sense

weary lodge
#

That's pretty similar to the new Brigadier API Paper added (Brigadier is the command system Mojang made, vs Denizen using the one Spigot/Bukkit made currently) - in Brigadier you basically define each argument and it's properties separately, in a tree structure.

So you could have a command that starts with a player argument and certain tab completions, then after that player argument a string (text) argument with different tab completions, etc.

#

tree structure = each argument can have an argument after it (a sub-argument basically, one of it's "branches"), or an argument on the same level as it, which means they are alternatives

#

So

arg1:
  arg2:
arg3:
  arg4:
  arg5:

Will let you do either /arg1 arg2 or /arg3 arg4 or /arg3 arg5

quartz wedge
#

Yeah that’s pretty much the same thing. I like that

indigo wedge
#

cant wait for brigadier in denizen

quartz wedge
#

Should I kick this over to a feature request?

weary lodge
#

Unless you want to request this for normal command scripts, probably no need - Brigadier's been planned for a while

quartz wedge
#

I think it would make sense to incorporate it directly into a command script

orchid vesselBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

quiet garden
#

reminds me of the command system i made

#

you could make your own system for this

#

if you want you can look at mine [here](#showcase message) (dont copy it over its really bad)