xXm0dzXx

FailSearch

Nov 10th, 2012
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. local x,y = term.getSize()
  2.  
  3. function navBar()
  4. term.setCursorPos(1,y-1)
  5. write( string.rep( "-", x ) )
  6. term.setCursorPos(1,y)
  7.  
  8. local pages = {}
  9. function addPage( name, link )
  10. pages[#pages+1] = {
  11. ["Name"] = name,
  12. ["Link"] = link,
  13. }
  14. end
  15.  
  16. --Add your pages here
  17.  
  18. addPage("Home","nexus/index")
  19. addPage("Contact Us","nexus/contact")
  20. addPage("Games","nexus/games")
  21. addPage("Search","nexus/search")
  22.  
  23. --End
  24.  
  25. if newLink then
  26. local maxPage = #pages
  27. for i=1,maxPage do
  28. local page = pages[i]
  29. newLink( " " ..page["Name"].. " ", page["Link"] )
  30. if i ~= maxPage then
  31. write("|")
  32. end
  33. end
  34. else
  35. if term.isColor() then
  36. term.setTextColour( colors.red )
  37. end
  38. print("NavBar v1.1 not supported in this version of REX.")
  39. end
  40. end
  41.  
  42. rednet.broadcast("rednet.api.ping.searchengine")
  43.  
  44. cPrint("NeXuS FailSearch v2.0")
  45.  
  46. local timez = os.startTimer(0.5)
  47. repeat
  48. local event, key, URL = os.pullEvent()
  49. if event == "rednet_message" then
  50. cLink( URL )
  51. end
  52. until key == timez
  53.  
  54. navBar()
Advertisement
Add Comment
Please, Sign In to add comment