CCCPaste

MultiLayer-MiningInformation-Screen

--MINING INFORMATION SCREEN for MULTILAYER-STRIPMINE--
--Made by ~ilike_zw4 --

--DESCRIPTION --
--This program is part of the Multilayer-Stripmine program of mine.--
--This program is uses to Display the sent messages from your mining turtle on a Screen in your base-- 

--FIELDS--
modemID = 15113

modem = peripheral.find("modem") or error ("no modem found)
modem.open(modemID)
monitor = peripheral.find("monitor")
monitor.setCursorPos(1,1)
monitor.clear()
sizeX, sizeY = monitor.getSize()

repeat 
	repeat
    	event, side, channel, replyChannel, message, 
            distance = os.pullEvent("modem_message")
    until channel == modemID
        if monitor.getCursorPos() +5 > sizeX then
            local x,y = monitor.getCursorPos()
            monitor.setCursorPos(1, y+1)
        end
        if message == "\n" then
            local x,y = monitor.getCursorPos()
            monitor.setCursorPos(1, y+1)
        end
        if message == "clear" then
            monitor.clear()
            monitor.setCursorPos(1, y+1)
        else
            monitor.write(tostring(message))
        end
until false