Advertisement
Guest User

startup

a guest
Apr 24th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. mon = peripheral.wrap("left")
  2. rednet.open("right")
  3. while true do
  4. rednet.broadcast("GET","tankInfo")
  5. id,message = rednet.receive("tankOut")
  6. mon.clear()
  7. mon.setCursorPos(1,1)
  8. info = textutils.unserialize(message)
  9. amount = math.ceil(info[1].contents.amount)
  10. capacity = math.ceil(info[1].capacity)
  11. mon.setTextScale(1.5)
  12. mon.write(amount .. " XP")
  13. mon.setCursorPos(1,2)
  14. mon.write("----------")
  15. mon.setCursorPos(1,3)
  16. mon.write(capacity .. " XP")
  17. mon.setCursorPos(1,5)
  18. mon.write(math.ceil((amount/capacity)*100) .. "%")
  19. os.sleep(3)
  20. print(message)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement