Paste #28836: Bank

Date: 2016/01/21 07:46:34 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#Create File BankChests.Yml in Denizen Folder
#flag player BanqueSize:++ To add bank inv lines
bankers:
  type: assignment
  actions:
  interact scripts:
  - 10 Banking
Banking:
  type: interact
  steps:
    1:
      click trigger:
        script:
        - run script:OpenBankChest
OpenBankChest:
  type: task
  script:
  - narrate '<green>Un instant S.V.P.'
  - yaml "load:BankChests.yml" "id:BankChests"
  - define lines <player.flag[BanqueSize]>
  - define BankChestPlayer <player.uuid>BankChestPlayer
  - note 'in@generic[title=<&c>Banque;size=<def[lines].mul_int[9]>]' 'as:%BankChestPlayer%'
  - inventory add 'd:in@%BankChestPlayer%' 'o:<yaml[BankChests].read[<player.uuid>]>'
  - inventory open 'd:in@%BankChestPlayer%'
WorldBanks:
  type: world
  debug: true
  events:
    on player closes inventory:
    - if !<context.inventory.replace[<player.uuid>].is[contains].to[in@BankChestPlayer]> queue clear
    - define dvlist <c.inventory.list_contents>
    - yaml set 'id:BankChests' <player.uuid>:%dvlist%
    - yaml savefile:BankChests.yml id:BankChests
    on player clicks in inventory: 
    - if !<context.inventory.replace[<player.uuid>].is[contains].to[in@BankChestPlayer]> queue clear
    - if !<context.inventory.replace[BankChestPlayer].is[contains].to[in@<player.uuid>]> inventory close 'd:in@<player.uuid>BankChestPlayer'