Solved Completion of on complete

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Seo_Rong

Member
Mar 30, 2021
2
0
1
condition precedent
Addon [SkQuery] will apply it

[command] to be defined in [ontab complete]

[command] is positioned to be recognized higher than [on tab complete]


Code:
on tab completer for "/command":

@if argument at 1 is not "factor1" or "factor2":

@@add "factor1" to tab completions

@@add "factor2" to tab completions


@if argument at 1 contains "factor1":

@@if argument at 2 is "": # If the argument corresponding to factor 3 is empty

@@@add "factor3" to tab completions

@@if argument at 3 is set: # if argument corresponding to factor 3 is populated

@@@if argument at 4 is "": # If the argument corresponding to factor 4 is empty

@@@@add "factor4" to tab completions


@if argument at 1 contains "factor2":

@@loop {argument::*}:

@@@set {_a} to loop-value

@@@add loop-value to tab completions

As a result, factor 1 factor 2 appears as a tab after hitting the command and entering the space bar.

If you enter factor 1, factor 1 factor 2 does not appear in the tab by condition, and factor 3 appears new.

If you subsequently populate argument 3, a new factor 4 appears.

When factor 2 is entered, factor 1 factor 2 does not appear on the tab by condition {argument::*} The predefined children of the array appear on the tab.
 
Status
Not open for further replies.