Date: 2016/01/27 10:14:35 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
3:
chat trigger:
'deposit_money':
trigger: '/REGEX:(1|deposit|d)/'
script:
- ^run "deposit_money_task"
'withdraw_money':
trigger: '/REGEX:(2|withdraw|w)/'
script:
- ^run "withdraw_money_task"
4:
chat trigger:
'deposit_money_amount':
trigger: '/REGEX:\A\d*\.?\d*\Z/'
script:
- ^if '<player.money>' >= <player.chat_history>
narrate format:banker_format "<light_purple>There is now <green>β<proc:deposit_procedure><light_purple> in your account"
else narrate format:banker_format "<light_purple>You don<&sq>t have <green>β<player.chat_history><light_purple> to deposit!"
- trigger name:chat toggle:false
- ^run "manage_account_task"
5:
chat trigger:
'withdraw_money_amount':
trigger: '/REGEX:\A\d*\.?\d*\Z/'
script:
- ^if '<player.flag[bankbalance]>' >= <player.chat_history>
narrate format:banker_format "<light_purple>You have withdrawn <green>β<player.chat_history><light_purple> from your account; your remaining balance is <green>β<proc:withdraw_procedure>"
else narrate format:banker_format "<light_purple>You don<&sq>t have <green>β<player.chat_history><light_purple> to withdraw!"
- trigger name:chat toggle:false
- ^run "manage_account_task"
deposit_procedure:
type: procedure
script:
- flag player 'bankbalance:+:<player.chat_history>'
- ^take money qty:<player.chat_history>
- determine "<flag.p:bankbalance>"
withdraw_procedure:
type: procedure
script:
- flag player 'bankbalance:-:<player.chat_history>'
- ^give money qty:<player.chat_history>
- determine "<flag.p:bankbalance>"