Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- tArgs = { ... }
- if #tArgs > 0 then
- sTopic = tArgs[1]
- else
- sTopic = "intro"
- end
- local w,h = term.getSize()
- local file = io.open( "mem/redworks/minepedia/"..sTopic )
- if file then
- local sLine = file:read()
- local nLines = 0
- while sLine do
- print( sLine )
- nLines = nLines + 1
- if nLines >= h then
- term.write( "Press any key to continue." )
- repeat
- local event = os.pullEvent()
- until event == "key"
- term.clearLine()
- local x,y = term.getCursorPos()
- term.setCursorPos(1,y)
- end
- sLine = file:read()
- end
- file:close()
- else
- print( "No data available. Type 'minepedia list'" )
- end
Advertisement
Add Comment
Please, Sign In to add comment