StarOS: wallet

The wallet is the owner's, in drops: 1 MT = 1 000 000 drops. Amounts are whole numbers. See the overview.

function does
wallet.balance() balance in drops, as the turn began
wallet.pay(to, amount, memo="") record a payment of amount drops to the player named to
  • At most 5 payments a turn. A sixth is a script error, and a failed script pays nothing.
  • Payments are applied after the scripts, in robot id order.
  • A payment that would overdraw you, names nobody, names several players or names yourself fails alone: a payment_failed event on the robot.
  • The memo is cut at 200 bytes.
MT = 1000000

def tick():
    if robot.turn % 24 == 0 and wallet.balance() > 100 * MT:
        wallet.pay("Ada", 5 * MT, "daily rent")