# |==================================| # | Slime Economy | # | Internal economy manager for | # | $lime. | # |==================================| # # Author: mcmonkey # For: New2PC # Denizen version: REL-1710 # Original Date: 2019-08-11 # Last Update Date: 2020-06-10 # # Setup: # Just add the script. # Adjust the ranks list below. # # Give ops permissions: # slime.balance.other # slime.eco.edit # slime_max_money: type: procedure debug: false definitions: player script: - define player <[player]||> # ================ List ranks -> amount here, keep it from highest to lowest. ================ - if <[player].has_permission[eco.500000]>: - determine 500000 - if <[player].has_permission[eco.250000]>: - determine 250000 - if <[player].has_permission[eco.100000]>: - determine 100000 - if <[player].has_permission[eco.50000]>: - determine 50000 - if <[player].has_permission[eco.10000]>: - determine 10000 - if <[player].has_permission[eco.5000]>: - determine 5000 # The default limit - determine 2500 # ================ End editable ================ Slime_Economy: type: economy debug: false priority: normal name single: $lime name plural: $limes digits: 0 format: $ balance: has: ]||false> withdraw: - flag slime_money:-:<[amount].round> deposit: - if !: - flag player banked_money:+:<[amount].round> - stop - define orig_money - flag slime_money:+:<[amount].round> - if > : - flag player slime_money: - narrate "You lost ].sub[]>]> to the void, due to exceeding your max." balance_command: type: command debug: false name: balance usage: /balance description: Shows your current balance. aliases: - bal script: - if == 0: - narrate "Your wallet balance is . Your max is ]>." - else if : - define player ]||null> - if <[player]> == null: - narrate "'' is not a valid player." - stop - narrate "<[player].name>'s balance is <[player].money.formatted>." - else: - narrate "You don't have permission to look at the balance of others." - stop pay_command: type: command debug: false name: pay usage: /pay [player] [amount] description: Sends money to a player. script: - if : - narrate "/pay [player] [amount]" - stop - define player ]||null> - if <[player]> == null: - narrate "'' is not a valid player." - stop - define amount - if !<[amount].is_decimal>: - narrate "'<[amount]>' is not a valid number." - stop - if <[amount]> <= 0: - narrate "May only pay a positive number." - stop - if <[amount]> > : - narrate "You don't have ]> in your wallet." - stop - define targetmax ]> - if <[amount].add[<[player].money>]> > <[targetmax]>: - narrate "<[player].name> does not have room in their wallet for ]>." - stop - take money quantity:<[amount]> - give money quantity:<[amount]> player:<[player]> - narrate "Sent ]> to <[player].name>." - narrate "You received ]> from ." t:<[player]> economy_command: type: command name: economy usage: /economy give/take/set [player] [amount] description: Gives, takes, or sets the economy value for a specific player. aliases: - eco - slimeeconomy - slimeeco permission: slime.eco.edit script: - if || give|take|set !contains : - narrate "/economy give/take/set [player] [amount]" - stop - define player ]||null> - if <[player]> == null: - narrate "'' is not a valid player." - stop - define amount - if !<[amount].is_decimal>: - narrate "'<[amount]>' is not a valid number." - stop - choose : - case give: - give money quantity:<[amount]> player:<[player]> - case take: - take money quantity:<[amount]> player:<[player]> - case set: - money set quantity:<[amount]> player:<[player]> - narrate "<[player].name>'s balance has been updated to <[player].money.formatted>."