Advertisement
Guest User

Untitled

a guest
May 27th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. function clearScreen()
  2. -- Clears the screen and selects top left corner
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. end
  6.  
  7. function reactorStatus()
  8. -- Checks whether the Reactor is currently Online or Offline
  9. if r.getActive() == true then
  10. rStatus = "Online"
  11. elseif r.getActive() == false then
  12. rStatus = "Offline"
  13. end
  14. end
  15.  
  16. function comDisplay()
  17. -- The Main Display of the Computer Terminal
  18. print("Reactor is Currently: ", rStatus)
  19. print("Energy Stored: ", r.getEnergyStored(), " Rf/t")
  20. print("Energy Currently Produced: ", math.floor(r.getEnergyProducedLastTick()), " Rf/t")
  21. print("Fuel: ", r.getFuelAmount(), " / ", r.getFuelAmountMax(), " mB")
  22. print("Fuel Temperature: ", math.floor(r.getFuelTemperature()), " C")
  23. print("Waste: ", r.getWasteAmount(), " mB")
  24. print("Coolant Amount: ", r.getCoolantAmount(), " mB")
  25. print("Control Rods: ", r.getNumberOfControlRods(), " Rods")
  26. end
  27.  
  28. function arrayVariables()
  29. -- Creates and wirelessly sends the Array
  30. --###Need to finish Reactor Status.
  31. energyStored = r.getEnergyStored()
  32. energyProduced = r.getEnergyProducedLastTick()
  33. totalFuel = r.getFuelAmount()
  34. fuelMax = r.getFuelAmountMax()
  35. fuelTemp = r.getFuelTemperature()
  36. waste = r.getWasteAmount()
  37. coolantAmount = r.getCoolantAmount()
  38. controlRods = r.getNumberOfControlRods()
  39. reactorArray = {energyStored, energyProduced, totalFuel, fuelTemp, waste, coolantAmount, controlRods, fuelMax, rStatus}
  40. rednet.send(5, reactorArray)
  41. end
  42.  
  43. r = peripheral.wrap("back")
  44. clearScreen()
  45. rStatus = "???"
  46.  
  47. -- This is the loop to run the bulk of the program
  48. while true do
  49. reactorStatus()
  50. arrayVariables()
  51. comDisplay()
  52. sleep(0.1)
  53. clearScreen()
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement