Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = {peripheral.find("modem")}
- for i = 1, #modem do modem[i].open(rednet.CHANNEL_REPEAT) end
- local tower = {peripheral.find("bitnet_tower", function(name, object) return object.isTowerComplete() end)}
- local repeated, msgID, timerID, myEvent = 0, {}, {}
- local function RedstoneSetSignal(signal)
- if signal == "on" then
- --for k,v in pairs(redstone.getSides()) do
- --redstone.setOutput(v, true)
- --end
- --print"Waiting for audio disk..."
- --if then
- -- if disk.hasAudio(side)
- -- print("Disk Drive doesn't has the audio disk.\nPlease put in the '13' Song disk.")
- -- else
- -- disk.playAudio(side)
- -- end
- --end
- if peripheral.isPresent("top") then
- if disk.hasAudio("top") then
- disk.playAudio("top")
- else
- print("Disk Drive doesn't has the audio disk.\nPlease put in the '13' Song disk.")
- os.reboot()
- end
- else
- error("No disk drive found on Top.\nPlease Place the disk drive on the top of the computer.")
- os.reboot()
- end
- elseif signal == "off" then
- if peripheral.isPresent("top") then
- disk.stopAudio("top")
- else
- error("No disk drive found on Top.\nPlease Place the disk drive on the top of the computer.")
- end
- end
- end
- while #tower == 1 do
- myEvent = {os.pullEvent()}
- -- Message arriving via tower:
- if myEvent[1] == "bitnet_message" then
- print("Message: "..myEvent[3])
- RedstoneSetSignal(myEvent[3])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement