Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- function navBar()
- term.setCursorPos(1,y-1)
- write( string.rep( "-", x ) )
- term.setCursorPos(1,y)
- local pages = {}
- function addPage( name, link )
- pages[#pages+1] = {
- ["Name"] = name,
- ["Link"] = link,
- }
- end
- --Add your pages here
- addPage("Home","nexus/index")
- addPage("Contact Us","nexus/contact")
- addPage("Games","nexus/games")
- --End
- if newLink then
- local maxPage = #pages
- for i=1,maxPage do
- local page = pages[i]
- newLink( " " ..page["Name"].. " ", page["Link"] )
- if i ~= maxPage then
- write("|")
- end
- end
- else
- if term.isColor() then
- term.setTextColour( colors.red )
- end
- print("NavBar v1.1 not supported in this version of REX.")
- end
- end
- navBar()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement