Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("left")
- local monitor = peripheral.wrap("right")
- local positions = {[1]= {[1]="spawn", [2]=856, [3]=21, [4]=-567,},}
- monitor.clear()
- monitor.setCursorPos(1,1)
- modem.open(1)
- while true do
- input = {os.pullEvent("modem_message")}
- if type(input[4]) == "number" or type(input[4]) == "string" then
- if type(input[5]) == "string" then
- print(input[4]..":"..input[5])
- x,y = monitor.getCursorPos()
- monitor.setCursorPos(1,y+1)
- monitor.write(os.time()..":"..os.day()..":"..input[4]..":"..input[5])
- if y == 25 then
- y = 1
- monitor.clear()
- monitor.setCursorPos(1,y)
- end
- if input[5] == "positions" then
- modem.transmit(1, input[4], textutils.serialise(positions))
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement