xXm0dzXx

navBar Installation Installer

Nov 24th, 2012
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. local part1 = [[
  2. local text = [[
  3. local x,y = term.getSize()
  4.  
  5. function navBar()
  6. term.setCursorPos(1,y-1)
  7. write( string.rep( "-", x ) )
  8. term.setCursorPos(1,y)
  9.  
  10. local pages = {}
  11. function addPage( name, link )
  12. pages[#pages+1] = {
  13. ["Name"] = name,
  14. ["Link"] = link,
  15. }
  16. end
  17.  
  18. --Add your pages here
  19.  
  20. addPage("Home","nexus/index")
  21. addPage("Contact Us","nexus/contact")
  22. addPage("Games","nexus/games")
  23.  
  24. --End
  25.  
  26. if newLink then
  27. local maxPage = #pages
  28. for i=1,maxPage do
  29. local page = pages[i]
  30. newLink( " " ..page["Name"].. " ", page["Link"] )
  31. if i ~= maxPage then
  32. write("|")
  33. end
  34. end
  35. else
  36. if term.isColor() then
  37. term.setTextColour( colors.red )
  38. end
  39. print("NavBar v1.1 not supported in this version of REX.")
  40. end
  41. end
  42.  
  43. navBar()
  44. ]]
  45.  
  46. write("Enter the path to the page: ")
  47. file = fs.open( read(), "w" )
  48. file.write( text )
  49. file.close()
  50. ]]
  51.  
  52. print("Downloading...")
  53. print("Getting part1...")
  54. fs.delete("navBar")
  55. fs.makeDir("navBar")
  56. fs.open("navBar/DONTDELETE","w").close()
  57. file = fs.open("navBar/install")
  58. file.write( part1 )
  59. file.close()
  60. print("Done!")
  61. print("In rexHost, type install navBar")
Advertisement
Add Comment
Please, Sign In to add comment