Paste #42135: Untitled Paste

Date: 2017/05/22 20:47:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


banker:
    type: assignment
    debug: true
    actions:
        on click:
        - chat "Hello <player.name>!"
    interact scripts:
    - 1 banker_interact
banker_interact:
    type: interact
    debug: true
    steps:
        1:
            click trigger:
                script:
                - chat "What can I do for today?"
            chat trigger:
                1:
                  trigger: I'd like to /regex:(?i)(create|open|buy|purchase|make|add|start)/ a new account.
                  script:
                  - chat "Okay"
                  - if <player.money> >= 25000 {
                    - if flag.player.accounts_owned == 3 {
                      - chat "Sorry, but you can only open a max of 3 accounts."
                      } else {
                      - chat "You will be charged $25000. No refunds."
                      - chat "Would you like to continue?"
                      - zap 2
                      }
                    } else {
                    - chat "You do not have enough money."
                    }
                2:
                  trigger: I'd like to /rename/ my account.
                  script:
                  - chat "..."
                3:
                  trigger: Show me bank /regex:(?i)(info|information)/.
                  script:
                  - chat "..."
                4:
                  trigger: I'd like to make a /deposit/.
                  script:
                  - chat "..."
                5:
                  trigger: I'd like to make a /withdrawal/.
                  script:
                  - chat "..."
                6:
                  trigger: I'd like to /add/ a member to my account.
                  script:
                  - chat "..."
                7:
                  trigger: I'd like to /remove/ a member from my account.
                  script:
                  - chat "..."
                8:
                  trigger: /REGEX:.+/
                  script:
                  - chat "Things I can do for you:"
                  - narrate "- Create a new bank account."
                  - narrate "- Rename a bank account."
                  - narrate "- Display bank information."
                  - narrate "- Make a withdrawal or deposit."
                  - narrate "- Add or remove members."
                9:
                  trigger: Purge /flags/.
                  script:
                  - flag global account_names:!
                  - flag player account_owned:!
                  - narrate "Flags purged."
        2:
            chat trigger:
                1:
                  trigger: /regex:(?i)(yes|okay|yeah|ok|sure|y)/
                  script:
                  - chat "Okay... give me one second..."
                  - chat "What would you like to name your account?"
                  - zap 3
                2:
                  trigger: /regex:(?i)(no|nah|n)/
                  script:
                  - chat "Okay, come back if you change your mind!"
                  - zap 1
        3:
            chat trigger:
                1:
                  trigger: /REGEX:.+/
                  script:
                  - chat "Alright..."
                  - chat "Trying to add your bank account, <context.message>..."
                  - define name <context.message>
                  - if <flag.[global.account_names].find[name]> == -1 || <flag.[global.account_names].find[name]> == null {
                    - flag global account_names:->:name
                    - flag player accounts_owned:++
                    - execute as_server "manuaddp <player.name> hyperconomy.bank"
                    - execute as_player "bank create <context.message>"
                    - execute as_server "manudelp <player.name> hyperconomy.bank"
                    - chat "Is there anything else I can do for you?"
                    - zap 1
                    } else {
                    - chat "That name already exists in our database. Please give another name."
                    }