Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor
- reactor = peripheral.wrap("bottom")
- local screen
- screen = peripheral.wrap("back")
- local wirelessModem
- wirelessModem = peripheral.wrap("top")
- local turbineArray = {}
- function buildTurbineObject(turbine) do
- return object {
- "getActive" = turbine.getActive(),
- "getRpm" = turbine.getRotorSpeed(),
- "getRft" = turbine.getEnergyProducedLastTick()
- }
- end
- function getTurbines()
- local peripherals = peripheral.getNames()
- local count = 0
- for number,device in ipairs(peripherals) do
- if string.match(device,'(Turbine)') ~= nil then
- turbineArray[count] = peripheral.wrap(device)
- print(buildTurbineObject(turbineArray[count])
- count = count +1
- end
- end
- turbineArray["count"] = count
- end
- function setRod(amount, reactor)
- local numberOfRods
- numberOfRods = reactor.getNumberOfControlRods()-1
- for i=0,numberOfRods,1 do
- reactor.setControlRodLevel(
- i,
- reactor.getControlRodLevel(i)+amount
- )
- end
- end
- function updateRods()
- while true do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- print(event .. " => Side: " .. tostring(side) .. ", " ..
- "X: " .. tostring(xPos) .. ", " ..
- "Y: " .. tostring(yPos))
- end
- end
- getTurbines()
- print(turbineArray[0].getActive())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement