Unlimited Page GUI in skript?

Discussion in 'Skript' started by TaxINAxtrion, May 27, 2017.

  1. Hello Everyone,
    is it possible to make unlimited pages of gui just like AuctionHouse plugin in skript?
    if it possible, how to do it?
     
    #1 TaxINAxtrion, May 27, 2017
    Last edited: May 27, 2017
    • Informative Informative x 1
  2. You can make it using Looping, Indexing and a math logic i think
     
  3. Can you make a example?
     
  4. Like this?
    Need SkQuery and Skellet to do this
    Code (Text):
    command /gui [<text>] [<text>]:
        trigger:
            if arg 1 is "add":        # Add something to index #
                if arg 2 is set:
                    add arg 2 to {gui::list::*}
                    send "&7Added &b%arg 2% &7to list"
                    stop
                 
            if arg 1 is "page":            # Show index #
                if arg 2 isn't set:
                    set {_page} to 1
                if arg 2 is set:
                    set {_page} to arg 2 parsed as integer
                 
                wait 5 ticks
                open chest with 3 rows named "GUI" to player
             
                set {_size} to size of player's current inventory - 9
                set {_rows} to {_size} / 9
                set {_index} to ({_page}*({_rows}*9)) - (({_rows}*9) - 1)     # Math logic for searching index per page #
             
                loop {_size} times:
                    format slot (loop-number - 1) of player with stone named "&eIndex &6&n%{_index}%" with lore "||&a&lCONTAINS||&f%{gui::list::%{_index}%}%" to be unstealable
                    add 1 to {_index}
                 
                # Next and Previous Page System #
                format slot (({_rows}*9) - 1) of player with green stained clay named "&aNext Page" to close then run [make player execute command "gui page %{_page} + 1%"]
                if {_page} > 1:
                    format slot (({_rows}*9) - 9) of player with red stained clay named "&cPrevious Page" to close then run [make player execute command "gui page %{_page} - 1%"]
                stop
     
    #4 NuCodes, May 28, 2017
    Last edited: May 28, 2017
    • Useful Useful x 1
  5. mathhulk

    mathhulk Retired Moderator
    Retired

    • Informative Informative x 1