Paste #51378: whole thing

Date: 2019/01/06 17:29:26 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# ████████████████████████████████████████████████████
# ██   Formatting
# ██
# ██▓▓▒▒░░

# ███ [ Chat Format ] ███
cf:
    type: format
    debug: false
    format: <&2>[<&a>B<&d>e<&a>hrShop<&2>] <&f><&o><text>
# ███ [ Item Format ] ███
if:
    type: format
    debug: false
    format: <text>

# ████████████████████████████████████████████████████
# ██   Commands
# ██
# ██▓▓▒▒░░

# ███ [ Open GUI Command Basic ] ███
InventoryGUI_Command:
    type: command 
    name: behrtest
    aliases: 
    - behrt
    script: 
    - if <player.name> != Behr_Riley:
        - narrate "<&c>You are not Behr. This command is <&4>Developmental<&c>"
        - determine fulfilled
    - else:
        - Narrate format:cf "Success."
        - inventory open d:in@ShopGUI

# ████████████████████████████████████████████████████
# ██   GUI
# ██
# ██▓▓▒▒░░
ShopGUI:
    type: inventory
    title: Shop GUI
    size: 54
    slots:
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank]"
    - "[PM1] [PM2] [PM3] [PM4] [Blank] [TPI] [TPD] [Blank] [Close]"

# ████████████████████████████████████████████████████
# ██   Items
# ██
# ██▓▓▒▒░░

# ███ [ General GUI Buttons ] ███
# TPI | TogglePriceIncrease
# TPD | TogglePriceDecrease
TPI:
    type: item
    material: player_head[skull_skin=UUID|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2VkZDIwYmU5MzUyMDk0OWU2Y2U3ODlkYzRmNDNlZmFlYjI4YzcxN2VlNmJmY2JiZTAyNzgwMTQyZjcxNiJ9fX0]
    display name: "<&6>[<&2><&l> +<&r> <&6>] <&l><&e>Price Increase Tools"
    lore:
    - <&e> Toggle the <&a>Item Price Increase <&e>price tools. 
TPD:
    type: item
    material: player_head[skull_skin=UUID|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ4YTk5ZGIyYzM3ZWM3MWQ3MTk5Y2Q1MjYzOTk4MWE3NTEzY2U5Y2NhOTYyNmEzOTM2Zjk2NWIxMzExOTMifX19]
    display name: "<&6>[<&4><&l> -<&r> <&6>] <&l><&e>Price Decrease Tools"
    lore:
    - <&e> Toggle the <&a>Item Price Decrease <&e>price tools.
Blank:
    type: item
    material: black_stained_glass_pane
    display name: " "
    no-id: true
Close:
    type: item
    material: barrier
    display name: "<&6>[<&4><&l> X<&r> <&6>] <&l><&e>Close"
    lore: 
    - <&e> Closes the shop.
# ███ [ Price Modifier Items ] ███
PM1:
    type: item
    material: iron_block
    display name: "<&6>[<&2>$1<&6>]<&f> <&e><&l>Price Modifier"
    lore:
    - <&a> Modifies item price by <&6>[<&2>$1<&6>]<&f>.
PM2:
    type: item
    material: gold_block
    display name: "<&6>[<&2>$10<&6>]<&f> <&e><&l>Price Modifier"
    lore:
    - <&a> Modifies item price by <&6>[<&2>$10<&6>]<&f>
PM3:
    type: item
    material: diamond_block
    display name: "<&6>[<&2>$100<&6>]<&f> <&e><&l>Price Modifier"
    lore:
    - <&a> Modifies item price by <&6>[<&2>$100<&6>]<&f>
PM4:
    type: item
    material: emerald_block
    display name: "<&6>[<&2>$1,000<&6>]<&f> <&e><&l>Price Modifier"
    lore:
    - <&a> Modifies item price by <&6>[<&2>$1,000<&6>]<&f>.

# ████████████████████████████████████████████████████
# ██   Handlers
# ██
# ██▓▓▒▒░░
ShopGUI_Handlers:
    type: world 
    debug: true 
    events:

# Raw_Slot Reference

#   1   2   3   4   5   6  7   8   9    above glass bar
#   10  11  12  13  14  15  16  17  18
#   19  20  21  22  23  24  25  26  27
#   28  29  30  31  32  33  34  35  36
#   -   -   -   -   -   -   -   -   -
#   37  38  39  40  41  42  43  44  45  glass bar
#   46  47  48  49  50  51  52  53  54  buttons 
#   -   -   -   -   -   -   -   -   -
#   55  56  57  58  59  60  61  62  63  player inv
#   64  65  66  67  68  69  70  71  72  player inv
#   73  74  75  76  77  78  79  80  81  player inv
#   -   -   -   -   -   -   -   -   -
#   82  83  84  85  86  87  88  89  90  player inv


# ███ [ GUI Button Handlers ] ███

        # ███ [ RAW SLOT TESTER ] ███
        on player clicks in ShopGUI with PM1:
        - if <context.raw_slot> >= 55:
            - narrate "Raw Slot is <context.raw_slot>"
            - narrate "And this determined cancelled"
            - determine cancelled
        - else:
            - narrate "<context.raw_slot>"
            - narrate "else"
#end script
#nothing past this
# PM1 | Price Modifier $1
        on player clicks PM1 in ShopGUI: 
            - flag player PM1
# PM2 | Price Modifier $10
        on player clicks PM2 in ShopGUI:
# PM3 | Price Modifier $100
        on player clicks PM3 in ShopGUI:
# PM4 | Price Modifier $1,000
        on player clicks PM4 in ShopGUI:

# TPIMode | Toggle Price Increase Mode
        on player clicks TPI in ShopGUI: 
        - if <player.has_flag[TPDMode]>:
            - flag player TPDMode:!
        - else
            - flag player TPIMode
        - flag player TPIMode
        - determine cancelled 
# TPDMode | Toggle Price Decrease Mode
        on player clicks TPD in ShopGUI: 
        - if <player.has_flag[TPIMode]>:
            - flag player TPIMode:!
        - else
            - flag player TPDMode
        - determine cancelled 
# Close Shop | Remove Modes
        on player clicks Close in ShopGUI: 
        - inventory close d:<context.inventory> 
        - ^determine cancelled 
        on player clicks Blank in ShopGUI: 
        - ^determine cancelled 

# ███ [ GUI Misc Event Handlers ] ███
        on player clicks in ShopGUI:
        -
        on player closes inventory:
        - flag player TPIMode|TPDMode:!
#        - if <context.inventory.replace[<player.uuid>].starts_with[in@pvault].not||true>:
#            - queue clear
#        - define vault_id <context.inventory.after[_]>
#        - define dvlist <context.inventory.list_contents>
#        - yaml set id:pvaultkey "<player.uuid>.<def[vault_id]>:<def[dvlist]>"
#        - yaml "savefile:data/pvault/pvaultkey.yml" "id:pvaultkey"
#        - define id "<player.uuid>pvault_<def[vault_id]>"
#        - note remove as:<def[id]>



# ████████████████████████████████████████████████████
# ██   YAML Handlers
# ██
# ██▓▓▒▒░░
#   [ Example ]
#   - narrate format:f "<script.yaml_key[a1]>"
#   - wait 1s
#   -^ narrate format:cf "This is delayed for after the previous completes"
#   -^ narrate format:cf "This will also be formated via cf in Format section"

# ████████████████████████████████████████████████████
# ██   YAML Keys
# ██
# ██▓▓▒▒░░
#   [ Example ]
#   a1: "This is dialog via YAML Key."
#   FR | FlagResponse
#   IR | InputResponse

    fr1: "You currently have a shop set up"