Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Hot Pocket Server
- rednet.open("right")
- term.clear()
- term.setCursorPos(1, 1)
- while true do
- computer_id, info, protocol = rednet.receive("HotPocketProtocol")
- data = {}
- for i in string.gmatch(info, "%S+") do
- table.insert(data, i)
- end
- name = data[1]
- quantity = tonumber(data[2])
- x = data[3]
- y = data[4]
- z = data[5]
- if quantity >= 1 and quantity <= 10 then
- rednet.broadcast("42", "HotPocketProtocol")
- computer_id, info, protocol = rednet.receive("HotPocketProtocol")
- if info == "73" then
- print(name)
- print(tostring(quantity) .. " Hot Pocket(s)")
- print("Computer ID: " .. tostring(computer_id))
- print("--------------------------------")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement