_buy_item 376 B

123456789101112131415
  1. # $buy_item
  2. !! call this to actually buy an item from a store
  3. count = ARGS[0]
  4. $item = $ARGS[1]
  5. price = ARGS[2]
  6. $variable_name = $ARGS[3]
  7. $location = $ARGS[4]
  8. dynamic "set <<$variable_name>> += <<count>>"
  9. set money -= price
  10. $message = '<font color="green">You bought <<count>> <b><<$item>></b>.</font>'
  11. gt $location, $message
  12. --- $buy_item ---------------------------------