Solved Format slots in ListGUI misses Icons and Cmds's Args

  • 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.
May 25, 2022
2
0
1
Hey,

I want to make homes list in gui, but it doesnt work as i expected. Unlike gui, text menu works
perfectly and returns values well.

format slot
- doesnt show any icon of items / blocks at all. Unless you didnt put second arg in /xsethome while making new home.
- is supposed to execute command and dont fill commands with argument /home <name> from variables

Code:
command /xsethome [<text>] [<text>]:
    trigger:
        if arg 1 is set:
            set {creative::database.%player%.homes::%arg 1%} to "%arg 1%"
            set {creative::database.%player%.homes.command::%arg 1%} to arg-1
            if arg 2 is set:
                set {creative::database.%player%.homes.icon::%arg 1%} to arg-2
            if arg 2 is not set:
                set {creative::database.%player%.homes.icon::%arg 1%} to Big Dripleaf
        
command /xunsethome [<text>]:
    trigger:
        if arg 1 is set:
            delete {creative::database.%player%.homes::home.%arg 1%}
            delete {creative::database.%player%.homes.command::perform.%arg 1%}
            delete {creative::database.%player%.homes.icon::icon.%arg 1%}
        
command /xtesthome [<text>] [<text>]:
    trigger:
        if arg 1 is set:
            send "/xtesthome %arg 1% - %arg 2%" to player
        
        

command /xhome [<text>] [<text>]:
    trigger:
        if arg 1 is not set:
            execute player command "/xhome xcd-erun:[folder=home]"
        if arg 1 is set:
            open chest with 6 rows named "&8Menadzer domow" to player
            wait 1 ticks
            format slot 1 of player with 1 of diamond named "x" with lore "" to run [send "./home bug get %player%" to player]
            if arg 1 is "list" or "xcd-erun:[folder=home]":
                set {_page} to arg 2 parsed as number
                if {_page} is not set:
                    set {_page} to 1
                set {_numberofrecords} to size of {creative::database.%player%.homes::*} and {creative::database.%player%.homes.command::*}
                set {_numberofpages} to ceil({_numberofrecords}/14)
                if {_numberofpages} is smaller than 1:
                    set {_numberofpages} to 1
                if {_page} is smaller than 1:
                    send "none"
                    stop
                if {_page} is greater than {_numberofpages}:
                    send "none"
                    stop
                if size of {creative::database.%player%.homes::*} is smaller than 1:
                    send "none"
                    stop
                loop {creative::database.%player%.homes::*}:
                    add loop-value to {_creative::database.%player%.homes::*}
                loop {creative::database.%player%.homes.command::*}:
                    add loop-value to {_creative::database.%player%.homes.command::*}
                loop {creative::database.%player%.homes.icon::*}:
                    add loop-value to {_creative::database.%player%.homes.icon::*}
                loop {_numberofrecords} times:
                    set {_list} to ({_page}-1)*14
                    add loop-number to {_list}
                    if {_creative::database.%player%.homes::%{_list}%} is not set:
                        stop
                    if loop-number is 14:
                        stop
                    format slot (18+{_list}) of player with 1 of {_creative::database.%player%.homes.icon::%{_list}%} named "&e&l%{_creative::database.%player%.homes::%{_list}%}%" with lore "" to run [send "./home %{_creative::database.%player%.homes.command::%{_list}%}% get %player%" to player]
                    send "&7ID --- Name --- Persorm --- Icon"
                    send "&a%{_list}% &f--- &b&l%{_creative::database.%player%.homes::%{_list}%}% &f--- &e&l%{_creative::database.%player%.homes.command::%{_list}%}% &f--- &c%{_creative::database.%player%.homes.icon::%{_list}%}% " to player

Server Engine: Purpur 1.18.2
Skript and All Addons are Latest possible updated Builds compatible with 1.18.2. Addons i have
SkQuery, Skore, SKBee, Scacket, SkyRayFall.

is someone here more experienced and smarter than me and may explain what i have done wrong in skript code? I lost mind after few tries to find a solution. is this a bug caused by addons?
 
Last edited:
Currently i use this associated addons: SkQuery, Skore, SkBee, Skacket and SkyRayFall. Skript and All Addons are possible latest updated Builds for 1.18.2.
[doublepost=1653769919,1653725702][/doublepost]I have found solution by myself. If someone need code of DynamicListGUI for own project, just feel free to use them: DynamicListGUI_EN - Pastebin.com
 
Status
Not open for further replies.