Advertisement
Terminator_NL

UnlimitedCraft path picker

Jul 1st, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------------ Variables ------------
  2. path = ""
  3. rank = ""
  4.  
  5. headerIsCentered = true
  6.  
  7. rankType = "1"
  8.  
  9. kitHeader = "Rank kit"
  10. kit = {
  11. ""
  12. }
  13. kitItemPrefix = "--> "
  14.  
  15. textSize = 1
  16.  
  17. headerColor    = colors.red
  18. divideColor    = colors.yellow
  19. kitHeaderColor = colors.orange
  20. kitItemColor   = colors.lime
  21. rankRankColor  = colors.white
  22. rankTypeColor  = colors.lightGray
  23.  
  24.  
  25. divideFormat = "="
  26.  
  27. ------- Code below ----------------
  28. os.pullEvent = coroutine.yield
  29. mon = peripheral.find("monitor")
  30. mX, mY = mon.getSize()
  31. header = path..": "..rank
  32. os.setComputerLabel(header)
  33. divideString = ""
  34. repeat
  35.  divideString = divideString..divideFormat
  36. until string.len(divideString) >= mX
  37.  
  38. function cWrite(text,line)
  39.  local len = string.len(text)
  40.  mon.setCursorPos(math.floor((mX/2))-(len/2),line)
  41.  mon.write(text)
  42. end
  43.  
  44.  
  45. mon.setTextScale(textSize)
  46. mon.setBackgroundColor(colors.black)
  47. mon.clear()
  48. mon.setTextColor(headerColor)
  49. if headerIsCentered == false then
  50.  mon.setCursorPos(1,1)
  51.  mon.write(header)
  52. else
  53.  cWrite(header,1)
  54. end
  55. mon.setCursorPos(1,3)
  56. mon.setTextColor(divideColor)
  57. mon.write(divideString)
  58. mon.setCursorPos(1,5)
  59. mon.setTextColor(rankTypeColor)
  60. mon.write("Rank type: ")
  61. mon.setTextColor(rankRankColor)
  62. mon.write(tostring(rankType))
  63. mon.setTextColor(divideColor)
  64. mon.setCursorPos(1,7)
  65. mon.write(divideString)
  66. mon.setCursorPos(1,9)
  67. mon.setTextColor(kitHeaderColor)
  68. mon.write(kitHeader)
  69. yPos = 10
  70. mon.setTextColor(kitItemColor)
  71. for k,v in pairs(kit) do
  72.  yPos = yPos + 1
  73.  mon.setCursorPos(1,yPos)
  74.  mon.write(kitItemPrefix..v)
  75. end
  76.  
  77.  
  78. -- Locking the pc
  79. while true do
  80.  term.setBackgroundColor(colors.black)
  81.  term.clear()
  82.  term.setCursorPos(1,1)
  83.  term.setTextColor(colors.lightGray)
  84.  term.write("This computer is protected.")
  85.  coroutine.yield()
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement