Paste #35992: Testing

Date: 2016/09/12 05:46:07 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Trade:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
    interact scripts:
      - 1 Trade_Interact


Trade_Interact:
    type: interact
    steps:
        1:
            chat trigger:
                1:
                    trigger: /Hello/ /Sup/ /Hey/ /Hi/
                    script:
                    - chat "Hello, my name is <npc.name>. How can I help?"
                2:
                    trigger: /I would like to see what you have/ /What do you have?/ /Whats in stock?/ /Whats for sale?/ /What have you got for sale?/ /What have you got?/
                    script:
                    - chat "Here is is:"
                    - wait 1
                    - inventory open d:in@Trading

Trading:
    type: inventory
    title: Trading
    size: 27
    slots:
    - "[i@trading_slot1] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"

trading_slot1:
    type: item
    material: diamond_sword
    display name: Trading Item

trading_handler:
    type: world
    events:
        on player clicks in Trading:
        - determine cancelled
        on player drags in Trading:
        - determine cancelled
        on player clicks trading_slot1 in Trading:
        - if player has item@emerald:
            - if true {
                - take item@emerald: 1
                - give item@diamond_sword: 1
                }
                else {
                - chat "What are you trying to do?"
                }