Paste #40134: Untitled Paste

Date: 2017/02/21 16:37:42 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"purchase_timer":
    type: world
    debug: minimal
    events:
        on system time minutely:
        - if <context.minute.mod[2]> == 0 queue clear
        - foreach <server.list_online_players> {
            - narrate target:<def[value]> "<&6>2분마다 실행함"
        }
        - run warehouse_Purchase_start

        on npc flag timeout expires:
        - foreach <server.list_online_players> {
            - narrate target:<def[value]> "<&6>flag 만료"
        }
        - run warehouse_Purchase_start

        on reload scripts:
        - wait 5t
        - foreach <server.get_spawned_npcs_flagged[warehousekeeper]> {
            - define flagged_npc <def[value]>
        }
        - bossbar remove test_bar
        - bossbar create test_bar players:<server.list_online_players> "title:HI GUYS" color:red progress:0.2

        on system time minutely:
        - wait 5t
        - bossbar update test_bar progress:<math:<<def[flagged_npc]>.flag[timeout].duration.in_second>/60>

warehouse_Purchase_start:
    type: task
    debug: minimal
    script:
    - foreach <server.list_online_players> {
        - narrate target:<def[value]> "<util.date><&nbsp><util.date.time> <s@purchaselist.yaml_key[purchase]>"
        - narrate target:<def[value]> "<s@purchaselist.yaml_key[purchase.granite]>"
        - narrate target:<def[value]> "<server.get_spawned_npcs_flagged[warehousekeeper]>"
        - define target <def[value]>
    }
    - foreach <server.get_spawned_npcs_flagged[warehousekeeper]> {
        - flag <def[value]> total_limit:100000
        - flag <def[value]> timeout:<util.date.time> duration:50s
        - flag <def[value]> purchase:<yaml[purchase].list_deep_keys[purchase_list].random[1]>
        - narrate target:<def[target]> "<def[value].flag[total_limit]>"
        - narrate target:<def[target]> "<script.yaml_key[PurchaseList].random>"
    }