Advertisement
Muzze77

TankReader1.1 by Muzze77

Jun 24th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1. --Tank Reader by Muzze77
  2. ------------------------------------
  3. --You need--
  4. --1 OpenCCSensor
  5. --1 Tank Card(MK stands for Range)
  6. --9 Screens ( Advance Golden)
  7. --1 Advance Computer
  8. --1 Tank (Buildcraft)
  9. ------------------------------------
  10. --Blinking colors ? True = Yes | False = No
  11. col = false
  12. color = {
  13. [1] = colors.white,
  14. [2] = colors.gray,
  15. [3] = colors.red,
  16. [4] = colors.blue,
  17. [5] = colors.green,
  18. [6] = colors.yellow,
  19. [7] = colors.lime,
  20. [8] = colors.cyan,
  21. [9] = colors.orange,
  22. [10] = colors.purple,
  23. [11] = colors.lightGray,
  24. [12] = colors.gray,
  25. [13] = colors.brown,
  26. [14] = colors.pink,
  27. [15] = colors.lightBlue,
  28. }
  29. ------------------------------------
  30. os.loadAPI("ocs/apis/sensor")
  31.  
  32.  
  33. num = 16
  34. while true do
  35.  
  36. m = sensor.wrap("back")
  37. t = m.getTargetDetails("-4,0,0")
  38. ran = math.random(1, 15)
  39. for v, k in pairs(t.Tanks) do
  40. term.clear()
  41. term.setCursorPos(1, 1)
  42. term.setTextColor(colors.green)
  43. print("Max Capacity")
  44. term.setTextColor(colors.white)
  45. term.setCursorPos(1, 16)
  46. term.setTextColor(colors.red)
  47. print("Min Capacity")
  48. term.setTextColor(colors.white)
  49. x = 1
  50. mid = 16
  51. num1 = num + 2
  52. while x ~= num1 do
  53.  
  54. if col == true then
  55.  
  56. term.setCursorPos(18, x)
  57. term.setTextColor(color[ran])
  58. print(mid .. "k Water")
  59. term.setTextColor(colors.white)
  60. x = x + 1
  61. mid = mid - 1
  62.  
  63. elseif col == false then
  64. term.setCursorPos(18, x)
  65. term.setTextColor(colors.yellow)
  66. print(mid .. "k Water")
  67. term.setTextColor(colors.white)
  68. x = x + 1
  69. mid = mid - 1
  70. end
  71.  
  72. end
  73. term.setTextColor(colors.yellow)
  74. print(k.Amount .. " Current")
  75. term.setTextColor(colors.white)
  76. r = k.Amount
  77. r = tonumber(r)
  78. if r ~= 0 then
  79. r1 = r / 1000
  80. y = num
  81. yn = y - r1
  82. else
  83. yn = num
  84. end
  85.  
  86. term.setCursorPos(14, yn + 1)
  87. term.setBackgroundColor(colors.blue)
  88. print(" ")
  89. term.setBackgroundColor(colors.black)
  90. term.setTextColor(colors.blue)
  91. term.setCursorPos(15, yn + 1)
  92. print("-->")
  93.  
  94. term.setTextColor(colors.white)
  95. end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement