Quipex

Disk/mem/redworks/programs/MinePedia

Apr 23rd, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. tArgs = { ... }
  4. if #tArgs > 0 then
  5. sTopic = tArgs[1]
  6. else
  7. sTopic = "intro"
  8. end
  9.  
  10. local w,h = term.getSize()
  11. local file = io.open( "mem/redworks/minepedia/"..sTopic )
  12. if file then
  13.  
  14. local sLine = file:read()
  15. local nLines = 0
  16. while sLine do
  17. print( sLine )
  18. nLines = nLines + 1
  19. if nLines >= h then
  20. term.write( "Press any key to continue." )
  21. repeat
  22. local event = os.pullEvent()
  23. until event == "key"
  24. term.clearLine()
  25. local x,y = term.getCursorPos()
  26. term.setCursorPos(1,y)
  27. end
  28. sLine = file:read()
  29. end
  30. file:close()
  31. else
  32. print( "No data available. Type 'minepedia list'" )
  33. end
Advertisement
Add Comment
Please, Sign In to add comment