Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReactorObj = {}
- function ReactorObj:new()
- local obj = obj or {}
- setmetatable(obj, {__index = self})
- obj.reacBig = peripheral.find("BigReactors-Reactor") or nil
- obj.reacBigger = peripheral.find("BiggerReactors_Reactor") or nil
- if obj.reacBig then
- obj.mod = "BIG"
- elseif obj.reacBigger then
- obj.mod = "BIGGER"
- else
- obj.mod = "NONE"
- end
- return obj
- end
- function ReactorObj:modType()
- --return the modtype used (BIG or BIGGER)
- return self.mod
- end
- function ReactorObj:connected()
- -- return true if a reactor is connected/valid
- if self.reacBig or self.reacBigger then return true end
- end
- function ReactorObj:setActive(foo)
- if self.mod == "BIG" then
- self.reacBig.setActive(foo or false)
- elseif self.mod == "BIGGER" then
- self.reacBigger.setActive(foo or false)
- else
- return 0
- end
- end
- function ReactorObj:getActive()
- if self.mod == "BIG" then
- return self.reacBig.getActive()
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:setRods(foo)
- if self.mod == "BIG" then
- self.reacBig.setAllControlRodLevels((100-foo) or 100)
- elseif self.mod == "BIGGER" then
- self.reacBigger.setAllControlRodLevels((100-foo) or 100)
- else
- return 0
- end
- end
- function ReactorObj:getFlow()
- if self.mod == "BIG" then
- return self.reacBig.getHotFluidStats().fluidProducedLastTick
- elseif self.mod == "BIGGER" then
- return self.reacBigger.coolantTank().maxTransitionedLastTick()
- else
- return 0
- end
- end
- function ReactorObj:getRodLevel(num)
- if self.mod == "BIG" then
- return self.reacBig.getControlRodLevel(num or 0)
- elseif self.mod == "BIGGER" then
- return self.reacBigger.getControlRod(num or 0).level()
- else
- return 0
- end
- end
- function ReactorObj:getRodCount()
- if self.mod == "BIG" then
- return (table.getn(self.reacBig.getControlRodsLevels())+1)
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getTankAmount()
- if self.mod == "BIG" then
- return self.reacBig.getHotFluidStats().fluidAmount
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getTankCapacity()
- if self.mod == "BIG" then
- return self.reacBig.getHotFluidStats().fluidCapacity
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getFuelUsage()
- if self.mod == "BIG" then
- return self.reacBig.getFuelConsumedLastTick()
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getEnergyStored()
- if self.mod == "BIG" then
- return self.reacBig.getEnergyStored()
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getEnergyProduced()
- if self.mod == "BIG" then
- return self.reacBig.getEnergyProducedLastTick()
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getEnergyCapacity()
- if self.mod == "BIG" then
- return self.reacBig.getEnergyCapacity()
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
- function ReactorObj:getSize()
- if self.mod == "BIG" then
- local max = self.reacBig.mbGetMaximumCoordinate()
- local min = self.reacBig.mbGetMinimumCoordinate()
- local x = (max[1] - min[1]) +1
- local y = (max[2] - min[2]) +1
- local z = (max[3] - min[3]) +1
- return x, y, z
- elseif self.mod == "BIGGER" then
- return "NOT DONE"
- else
- return 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement