Advertisement
PrinceOfCookies

Untitled

Feb 16th, 2023 (edited)
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. local monitor = peripheral.find("monitor")
  2. local periphList = peripheral.getNames()
  3.  
  4. local function rebootAtSixTwentyFiveAM()
  5. local curTime = os.time()
  6. if curTime >= 6.20 and curTime <= 6.30 then
  7. local file
  8. local mode = fs.exists("reboot.log") and "a" or "w"
  9. file = fs.open("reboot.log", mode)
  10. file.write("(E:L10) OS Reboot: " .. os.date() .. "\n")
  11. file.close()
  12. os.reboot()
  13. end
  14. end
  15.  
  16.  
  17. while true do
  18. sleep(1)
  19. rebootAtSixTwentyFiveAM()
  20.  
  21. local items = {}
  22. local pen = 0
  23. for i, periphName in pairs(periphList) do
  24. print("Cell")
  25. local periphType = peripheral.getType(periphName)
  26. if periphType == "ae2:energy_cell" then
  27. local Drive = peripheral.wrap(periphName)
  28. items = Drive.items()
  29. pen = pen + 1
  30. else
  31. if pen > 0 then
  32. break
  33. end
  34.  
  35. sleep(5)
  36. print("No Cells")
  37. local file
  38. local mode = fs.exists("reboot.log") and "a" or "w"
  39. file = fs.open("reboot.log", mode)
  40. file.write("EBR:L29 OS Reboot: " .. os.date() .. "\n")
  41. file.close()
  42. os.reboot()
  43. end
  44. end
  45. monitor.clear()
  46.  
  47. x, y = monitor.getSize()
  48.  
  49. monitor.setTextColor(colors.purple)
  50.  
  51. for i = 1, x do
  52. monitor.setCursorPos(i, 3)
  53. monitor.write(string.rep("-", i))
  54. end
  55.  
  56. monitor.setTextColor(colors.white)
  57. monitor.setCursorPos(1, 1)
  58. monitor.write("Top 10 Biggest Items!")
  59.  
  60. for i = 1, #items do
  61. monitor.setCursorPos(2, i)
  62. monitor.write(items[i])
  63. end
  64. end
  65.  
  66.  
  67. --getPatternsFor
  68. --getChannelEnergyDemand
  69. --getAverageEnergyIncome
  70. --pushItem
  71. --getCraftingCPUs
  72. --getCraftableItems
  73. --items
  74. --scheduleCrafting
  75. --pullFluid
  76. --tanks
  77. --getEnergyCapacity
  78. --getAverageEnergyDemand
  79. --getCraftableFluids
  80. --getChannelInformation
  81. --pushFluid
  82. --pullItem
  83. --getEnergy
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement