Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- destTape1 = peripheral.wrap("right")
- destTape2 = peripheral.wrap("left")
- modem = peripheral.wrap("top")
- modem.open(1337)
- function ModemRecieve()
- local tempA, tempB, tempC, tempD, chonker = os.pullEvent("modem_message")
- print("chonker recieved")
- return chonker
- end
- while true do
- time = os.time()
- if time%0.1 == 0 then
- os.sleep(2.75)
- print("time satisfied")
- break
- end
- os.queueEvent("randomEvent")
- os.pullEvent()
- end
- function main()
- singleUse = true
- print("main running")
- while true do
- --
- --setting timers
- --
- print("setting timers")
- -- immediate -- U/M 1, M 2
- first = os.startTimer(0.4) -- Stop 2, WRIT
- second = os.startTimer(1) -- Start 2
- third = os.startTimer(2.5) -- U/M 2, M 1
- fourth = os.startTimer(2.9) -- Stop 1, WRIT
- fifth = os.startTimer(3.5) -- Start 1
- sixth = os.startTimer(5) -- Loop
- --
- -- First Stage
- --
- -- 0 seconds in
- --
- print("unmuting Tape 1, muting Tape 2")
- destTape1.setVolume(1)
- os.sleep(0.1)
- destTape2.setVolume(0)
- os.sleep(0.25)
- --
- -- Second Stage
- --
- -- 0.75 seconds in
- --
- local temp, ID1 = os.pullEvent("timer")
- print(ID1)
- print("stopping Tape 2, writing")
- local chonker = ModemRecieve()
- destTape2.stop()
- destTape2.seek((-destTape2.getPosition())+2000)
- for i=1,60 do
- destTape2.write(chonker[i])
- end
- destTape2.seek((-destTape2.getPosition()))
- --
- -- Third Stage
- --
- -- 1.1 second in
- --
- local temp, ID2 = os.pullEvent("timer")
- destTape2.play()
- print(ID2)
- if ID1 + 1 ~= ID2 then
- break
- end
- print("playing Tape 2")
- --
- -- Fourth Stage
- --
- -- 2.5 seconds in
- --
- local temp, ID = os.pullEvent("timer")
- print("unmuting Tape 2, muting Tape 1")
- destTape2.setVolume(1)
- os.sleep(0.1)
- destTape1.setVolume(0)
- os.sleep(0.25)
- --
- -- Fifth Stage
- --
- -- 3.25 seconds in
- --
- local temp, ID = os.pullEvent("timer")
- print("stopping Tape 1, writing")
- local chonker = ModemRecieve()
- destTape1.stop()
- destTape1.seek((-destTape1.getPosition())+2000)
- for i=1,60 do
- destTape1.write(chonker[i])
- end
- destTape1.seek((-destTape1.getPosition()))
- --
- -- Sixth Stage
- --
- -- 3.6 seconds in
- --
- local temp, ID = os.pullEvent("timer")
- print("playing Tape 1")
- destTape1.play()
- --
- -- Seventh Stage
- --
- -- 5 seconds in
- --
- local temp, ID = os.pullEvent("timer")
- print("looping")
- end
- end
- os.pullEvent("modem_message")
- os.sleep(1.4)
- while true do
- main()
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement