Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tape = peripheral.wrap("bottom")
- modem = peripheral.wrap("left")
- tape.seek(-tape.getPosition())
- singleBlankByte = string.char(170)
- blankChunk = string.char(170)
- for i=1,250 do
- blankChunk = blankChunk .. singleBlankByte
- end
- blankMessage = {}
- for i=1,60 do
- blankMessage[i] = singleBlankByte
- os.queueEvent("randomEvent")
- os.pullEvent()
- end
- --while true do
- -- time = os.time()
- -- if time%0.1 == 0 then
- -- print("Time satisfied")
- -- os.sleep(1)
- -- break
- -- end
- --end
- while true do
- os.startTimer(2.5)
- rs.setOutput("right",true)
- os.sleep(0.5)
- rs.setOutput("right",false)
- chonker = {}
- if tape.isReady() then
- print("Tape drive full, transmitting contents")
- for i=1,60 do
- chonker[i] = tape.read(250)
- end
- else
- --print("Tape drive empty, transmitting blank")
- --chonker = blankMessage
- end
- os.pullEvent("timer")
- if tape.isReady() then
- modem.transmit(1337,1338,chonker)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement