Advertisement
Guest User

test

a guest
Jul 1st, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. ------------ Variables ------------
  2. rank = "Foggy"
  3. path = "Hexagon"
  4. headerIsCentered = true
  5.  
  6. rankType = "1"
  7.  
  8. kitHeader = "Rank kit"
  9. kit = {
  10. "Item 1",
  11. "item two",
  12. "whatever else they get"
  13. }
  14. kitItemPrefix = "--> "
  15.  
  16. textSize = 1
  17.  
  18. headerColor    = colors.red
  19. divideColor    = colors.yellow
  20. kitHeaderColor = colors.orange
  21. kitItemColor   = colors.lime
  22. rankRankColor  = colors.white
  23. rankTypeColor  = colors.lightGray
  24.  
  25.  
  26. divideFormat = "="
  27.  
  28. ------- Code below ----------------
  29. os.pullEvent = os.pullEventRaw
  30. mon = peripheral.find("monitor")
  31. mX, mY = mon.getSize()
  32. header = path..": "..rank
  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