Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.find("monitor")
- function centerText(text)
- local x2,y2 = term.getCursorPos()
- local x,y = term.getSize()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- function mWrite(text)
- local x2,y2 = m.getCursorPos()
- local x,y = m.getSize()
- m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- m.write(text)
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function mClear()
- m.clear()
- m.setCursorPos(1,1)
- end
- function nLine()
- line = line + 1
- x, y = term.getSize()
- x2,y2 = term.getCursorPos()
- if x2 == x then
- nLine()
- end
- end
- function mNline()
- mLine = mLine + 1
- m.setCursorPos(1,mLine)
- end
- function mTxt(text)
- x, y = m.getSize()
- x2,y2 = m.getCursorPos()
- if x2 == x then
- nLine()
- end
- m.write(text)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement