Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MONITOR
- function redirMon(size)
- if size ~= nil then
- if size < 1 or size > 5 then
- size = 1
- end
- else size = 1
- end
- for n,mon in pairs(rs.getSides()) do
- if peripheral.getType(mon) == "monitor" then
- mon = peripheral.wrap(mon)
- term.redirect(mon)
- mon.setTextScale(size)
- break
- end
- end
- end
- function restoreMon()
- term.restore()
- end
- -- REDNET
- function rednetOn()
- for n,modem in pairs(rs.getSides()) do
- if peripheral.getType(modem) == "modem" then
- rednet.open(modem)
- end
- end
- end
- function rednetOff()
- for n,modem in pairs(rs.getSides()) do
- if peripheral.getType(modem) == "modem" then
- rednet.close(modem)
- end
- end
- end
- -- OTHER
- function cPrint(text)
- x2,y2 = term.getCursorPos()
- x,y = term.getSize()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- print(text)
- end
- function clear(n1,n2)
- term.clear()
- if n1 == nil then
- term.setCursorPos(1,1)
- elseif n1 ~= nil and n2 == nil then
- term.setCursorPos(1,n1)
- else
- term.setCursorPos(n2,n1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment