Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ startup
- id="Hxm08R4U"
- loadstring(http.get("http://pastebin.com/raw.php?i=" .. id).readAll())()
- ]]--
- connected = false
- modem = false
- monitor = false
- debugmon = false
- glass = false
- myChannel = 6637
- function writeLine(message)
- monitor.write(message)
- local _,cY= monitor.getCursorPos()
- monitor.setCursorPos(1,cY+1)
- end
- if (peripheral.getType("left") == 'modem') then
- print("Found modem, attaching to " .. myChannel)
- modem = peripheral.wrap("left")
- modem.open(myChannel)
- connected = true
- end
- if (peripheral.getType("back") == 'monitor') then
- print("Found main monitor.")
- monitor = peripheral.wrap("back")
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setTextScale(0.8)
- end
- if (peripheral.getType("right") == 'monitor') then
- print("Found debug monitor.")
- print("Redirecting output.")
- debugmon = peripheral.wrap("right")
- debugmon.clear()
- debugmon.setCursorPos(1,1)
- debugmon.setTextScale(0.5)
- term.redirect(debugmon, false)
- end
- print("Hold CTRL-T for one second to stop, CTRL-R to reboot and update.")
- writeLine("Booted.")
- while connected do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- writeLine(message)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement