Paste #45099: i dont understand, pls help

Date: 2017/10/20 15:45:15 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


gpa_com_skularr_trash_landfill_evt:
  type: world
  debug: false
  events:
    on system time minutely:
    - repeat 59 {
      - foreach <server.flag[gpa.com.skularr.trash.in_landfill].as_list||li@> {
        - if '!<def[value].open_inventory.title.escaped.starts_with[&ss3&sslLandfill&ssr &ss8Page ]||false>' {
          - flag server 'gpa.com.skularr.trash.in_landfill:<-:<def[value]>'
        }
      }
      - wait 1s
    }
    on player joins:
    - flag server 'gpa.com.skularr.trash.in_landfill:<-:<player>'
    - flag server 'gpa.com.skularr.trash.in_landfill_priority:<-:<player>'
    on player closes inventory:
    - if <context.inventory.title> == '<&3><&l>Trash Bin' {
      - if <context.inventory.list_contents.filter[is[EQUALS].to[i@air].not].is_empty> {
        - queue clear
      }
      - define t '<context.inventory.list_contents.filter[is[EQUALS].to[i@air].not]>'
      - define ta 'li@'
      - foreach <def[t]> {
        - define l '<def[value].lore||li@>'
        - adjust <def[value]> 'lore:<def[l].include[&sp|&ss7Trashed by <player.name>|&ss7Click to claim]>' save:n
        - define ta '<def[ta].include[<entry[n].result>]>'
      }
      - flag server 'gpa.com.skularr.trash.landfill:|:<def[ta]>'
      - define s '<server.flag[gpa.com.skularr.trash.landfill].as_list.size||0>'
      - if <def[s]> > 270 {
        - flag server 'gpa.com.skularr.trash.landfill:!'
        - flag server 'gpa.com.skularr.trash.landfill:|:<server.flag[gpa.com.skularr.trash.landfill].as_list.get[<def[s].sub[270]>].to[<def[s]>].separated_by[|]>'
      }
      - foreach '<server.list_online_players.filter[open_inventory.title.escaped.starts_with[&ss3&sslLandfill&ssr &ss8Page ]]||li@>' {
        - inventory open 'd:in@gpa_com_skularr_trash_landfill_inv_<def[value].open_inventory.title.after_last[ ]>' player:<def[value]>
      }
      - narrate '<&f>Successfully sent trash to the landfill!' format:gpa_com_skularr_trash_chat_format
      - if !<player.has_permission[sku.trash.cooldown]||<player.is_op||true>> {
        - flag <player> 'gpa.com.skularr.trash.trash_cmd_cool' duration:30s
      }
    }
    - wait 1t
    - if <context.inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]||true> && !<player.open_inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]||true> {
      - flag server 'gpa.com.skularr.trash.in_landfill_priority:<-:<player>'
      - queue clear
    }
    on player clicks in inventory:
    - if !<context.inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]> {
      - queue clear
    }
    - determine passively 'CANCELLED'
    - define n '<context.inventory.after_last[_]>'
    - if <context.item.material> == m@slime_ball {
      - if <context.raw_slot> == 48 {
        - inventory open d:in@gpa_com_skularr_trash_landfill_inv_<def[n].sub_int[1]>
        - queue clear
      }
      else if <context.raw_slot> == 52 {
        - inventory open d:in@gpa_com_skularr_trash_landfill_inv_<def[n].add_int[1]>
        - queue clear
      }
    }
    - if <context.raw_slot> <= 45 && <context.item> != i@air {
      - flag server 'gpa.com.skularr.trash.in_landfill:->:<player>'
      - if <server.flag[gpa.com.skularr.trash.in_landfill].as_list.size||0> > 1 && <server.flag[gpa.com.skularr.trash.in_landfill].as_list.find[<player>]||1> > 1 {
        - inventory open 'd:<context.inventory>' player:<player>
        - queue clear
      }
      - adjust <context.item> lore:<context.item.lore.remove[last].remove[last].remove[last]> save:i
      - if <player.inventory.can_fit[<entry[i].result>]> {
        - give <entry[i].result>
        - define fs '<server.flag[gpa.com.skularr.trash.landfill].as_list.size||0>'
        - define rem_num '<context.raw_slot.add[<el@45.mul[<def[n].sub[1]>]>].round_down||0>'
        - define new_li '<server.flag[gpa.com.skularr.trash.landfill].reverse||li@>'
        - narrate '<def[new_li]>' targets:<p@GrandPartyMask>
        - define new_li '<def[new_li].remove[<def[rem_num]>]||li@>'
        - flag server 'gpa.com.skularr.trash.landfill:!'
        - flag server 'gpa.com.skularr.trash.landfill:|:<def[new_li].as_list.separated_by[|]>'
        - foreach '<server.list_online_players.filter[open_inventory.title.escaped.starts_with[&ss3&sslLandfill&ssr &ss8Page ]]>' {
          - inventory open 'd:in@gpa_com_skularr_trash_landfill_inv_<def[value].open_inventory.title.after_last[ ]>' player:<def[value]>
        }
        - flag server 'gpa.com.skularr.trash.in_landfill:<-:<player>'
        - queue clear
      }
      - narrate '<&c>You can<&sq>t fit that in your inventory!' format:gpa_com_skularr_trash_landfill_chat_format
    }
    - wait 1t
    - inventory update
    on player opens inventory:
    - if <context.inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]> {
      - flag server 'gpa.com.skularr.trash.in_landfill_priority:->:<player>'
    }