#(jironis) Space tab completions

1 messages · Page 1 of 1 (latest)

topaz adder
tardy kilnBOT
#

(jironis) Space tab completions

tardy kilnBOT
#

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.

bleak needle
#

.parse[unescaped] will return an elementtag; if_null[] will return <empty>

#

your tag failed because <context.args.first> returned invalid because the the returne value from the initial tag fragment <context.args> was li@, an empty list

#

your debug says that word for word, also)

#

odd that's in the guide like that though

topaz adder
#

due to it being empty, it returns us the same as with tab's complement 2 or 3

#

Is there nothing we can do about this?

#

Example:


my_command:
    type: command
    name: mycmd
    description: Does something
    usage: /mycmd <&lt>arg<&gt>
    permission: dscript.mycmd
    tab completions:
        1: yn|another
        2: <context.args.first.equals[yn].if_true[no|yes].if_false[]>
    script:```

mycmd command which have tab completions `yes / no` after `"yn"`
delicate timber
topaz adder
#

ого

delicate timber
#

попробуй использовать <context.args.get[1].equals[yn].if_true[no|yes].if_false[]>

topaz adder
#

я не могу сделать таб комплишн

delicate timber
#

context.args - лист, .get[1] получает значения в этом листе

topaz adder
#

так же

delicate timber
#

в твоем случае это 1

topaz adder
#

если оно пустое выводит

#

мой таб комплишн

#

а мне этого не нужно

delicate timber
#

а

#

если оно пустое

topaz adder
#

мне нужно сделать если пусто то не предлагать ничего

delicate timber
#

тебе это кидает?

topaz adder
#

да

delicate timber
#

если ты yn вводишь

#

все корректно работает?

topaz adder
#

да

delicate timber
#

не знаю кстати

#

должно корректно работать

topaz adder
#

чем бы помог .parse[unescaped]

delicate timber
#

хз

#

попробуй

#

.if_false[<&sp>]>

#

хотя тоже говнецо

topaz adder
delicate timber
#

попробуй .if_false[da]

#

выводит da?

#

или все то же

topaz adder
delicate timber
#

просто da

#

без <>

topaz adder
#

я нашёл интерестную вещь если if_false заменить на if_null[да] то выводит корректно:

#

если сделать if_null[]

#

если значение пустое то работает как нужно
Но VScode на это жалуеться

delicate timber
#

мб новое что то

#

сделали

topaz adder
#

нужно позвать кого-то повыше разобраться но мой английский на уровне 5 класса (это если с переводчиком)

delicate timber
#

я всегдс просто его и юзаю

merry tide
#

Please stick to using English for supports chats here, that way we can make sure all advice given is accurate and/or correct any mistakes

delicate timber
#

He uses this code

#

Example:


my_command:
    type: command
    name: mycmd
    description: Does something
    usage: /mycmd <&lt>arg<&gt>
    permission: dscript.mycmd
    tab completions:
        1: yn|another
        2: <context.args.first.equals[yn].if_true[no|yes].if_false[]>
    script:```

mycmd command which have tab completions `yes / no` after `"yn"`
#

when you enter not "yn", he gets this one

#

More precisely, this

delicate timber
topaz adder
#

If you put if_null instead of if_false, it will work, but Vscode does not approve of it.

merry tide
#

context.args.first gets the first argument, if there is no first argument it will error

merry tide
#

You can use something like .if_null[] to make it return nothing if it can't find the first argument (and the tag errors)

#

if_null wouldn't replace the if_false, that's still part of the tag - you add it to your existing tag after the if_false

delicate timber
#

А, точно ведь

cloud siloBOT
delicate timber
#

Если ты не создаешь первый аргумент , то и второй появится не может, поэтому и ошибка

delicate timber
merry tide
#

That's just how Minecraft/Spigot works, when you type a space it thinks you're done with the first argument, whether you actually specified one or not

elder nacelleBOT
#
Resolved

Thread closed as resolved.

topaz adder
#

@atomic pollen

elder nacelleBOT
#
Thread Reopened

Thread was manually reopened by @granite palm.