Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Printing Program/API by LDShadowLord
- --Function Descriptions:
- --Prepare: Setup function
- --GetCP : Finds the Cursor Pos
- --(L,C,R) Print : print Left, Print Center, Print Right
- --Extra : nullVoid
- --Setting Variables
- local ver = 1.1
- local side = "right"
- local cons = 1
- local kons = 1
- --Local Functions
- local function prepare()
- p = peripheral.wrap(side)
- p.newPage()
- p.setPageTitle(tostring(kons))
- kons = kons + 1
- end
- local function inc()
- local vx, vy = p.getCursorPos()
- local vw, vh = p.getPageSize()
- cons = vy + 1
- if cons == 20 then
- p.setCursorPos(1,21)
- p.write(" PRNT API // V1.1")
- p.endPage()
- p.newPage()
- cons = 1
- p.setPageTitle(tostring(kons))
- kons = kons + 1
- end
- end
- --Global Functions
- function setup()
- prepare()
- local vx, vy = p.getCursorPos()
- local vw, vh = p.getPageSize()
- end
- function title(name)
- p.setPageTitle(name)
- end
- function lPrint(text)
- p.write(text)
- inc()
- p.setCursorPos(1,cons)
- end
- function cPrint(text)
- local vx, vy = p.getCursorPos()
- local vw, vh = p.getPageSize()
- vl = #text
- myvx = (vw + 1) / 2
- myvxx = math.ceil(myvx - (vl / 2))
- term.setCursorPos(myvxx, cons)
- lPrint(text)
- end
- function rPrint(text)
- local vx, vy = p.getCursorPos()
- local vw, vh = p.getPageSize()
- vl = #text
- myvx = 24 - vl
- term.setCursorPos(myvx, cons)
- lPrint(text)
- end
- function endmain()
- p.setCursorPos(1,21)
- p.write(" PRNT API // V1.1")
- p.endPage()
- end
Advertisement
Add Comment
Please, Sign In to add comment