Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. -- Hot Pocket Server
  2. rednet.open("right")
  3.  
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6.  
  7. while true do
  8. computer_id, info, protocol = rednet.receive("HotPocketProtocol")
  9. data = {}
  10. for i in string.gmatch(info, "%S+") do
  11. table.insert(data, i)
  12. end
  13. name = data[1]
  14. quantity = tonumber(data[2])
  15. x = data[3]
  16. y = data[4]
  17. z = data[5]
  18.  
  19. if quantity >= 1 and quantity <= 10 then
  20. rednet.broadcast("42", "HotPocketProtocol")
  21. computer_id, info, protocol = rednet.receive("HotPocketProtocol")
  22. if info == "73" then
  23. print(name)
  24. print(tostring(quantity) .. " Hot Pocket(s)")
  25. print("Computer ID: " .. tostring(computer_id))
  26. print("--------------------------------")
  27. end
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement