Advertisement
Guest User

startup

a guest
Jan 23rd, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. -- Config
  2.  
  3. powerCellAmount = 1
  4. OilTankAmountPrLayer = 10
  5. xOffsett = -1
  6.  
  7.  
  8. -- end of config
  9.  
  10.  
  11. local mon = peripheral.wrap("top")
  12. rednet.open("right")
  13.  
  14. function cText(text, yPos, xOff)
  15. x,y = mon.getSize()
  16. xPos = (x - string.len(text))/2 - xOffsett - xOff
  17. mon.setCursorPos(xPos,yPos)
  18. mon.write(text)
  19. end
  20.  
  21. function sSave(filename, input)
  22. file = io.open(filename,"w")
  23. file:write(tostring(input))
  24. file:close()
  25. end
  26.  
  27. function isNumeric(data)
  28.     if type(data) == "number" then
  29.       return true
  30.     else
  31.       return false
  32.     end
  33. end
  34.  
  35. function sLoad(filename)
  36. file = io.open(filename,"r")
  37. config = file:read()
  38. file:close()
  39. return config
  40. end
  41.  
  42. function sendMessage(message, messageType)
  43.  
  44. end
  45.  
  46. function getMessage()
  47. senderID, message, protocol = rednet.receive()
  48. print(message .. " " .. protocol)
  49. if protocol == "power" then
  50. end
  51. if protocol == "fuel" then
  52. end
  53. if protocol == "Oil" then
  54.     oStored = message
  55. end  
  56. if protocol == "email" then
  57. end
  58. end
  59.  
  60.  
  61. pLevel = 3
  62. pCap = 1000000
  63. pStored = 3450000
  64. pProdused = 670
  65.  
  66. oCap = 10000
  67. oStored = 9000
  68.  
  69. fCap = 10000
  70. fStored = 9000
  71. fActive = "Active"
  72.  
  73. fCap = 10000
  74. fStored = 9000
  75.  
  76.  
  77. function updateUI()
  78. mon.clear()
  79. cText("SetPanel by _TheSettler_", 2, 0)
  80.  
  81. mon.setCursorPos(2,4)
  82. mon.write("Power: ")
  83. mon.setCursorPos(4,5)
  84. mon.write("Capasity: " .. pStored .. " / " .. pCap)
  85. mon.setCursorPos(4,6)
  86. mon.write("Generating " .. pProdused .. "RF / Power level: " .. pLevel)
  87. mon.setCursorPos(2,8)
  88. mon.write("Fuel levels:")
  89. mon.setCursorPos(4,9)
  90. mon.write("Disel: " .. fStored .. " / " .. fCap)
  91. mon.setCursorPos(4,10)
  92. mon.write("Oil: " .. oStored)
  93. mon.setCursorPos(2,12)
  94. mon.write("Status computer store")
  95. mon.setCursorPos(4,13)
  96. mon.write("Email: You have " .. 1 .. " unread message")
  97. end
  98.  
  99. while true do
  100. updateUI()
  101. getMessage()
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement