Posted 30 December 2015 - 12:00 AM
Im trying to make a MFSU detector that emits a red stone signal when its above/below a certain EU amount %.
ive tryed looking around for a base script to edit to my setup but all i can find are outputing to monitors :/
local turnOnAt = 50
local turnOffAt = 90
local euStored = 0
local euMax = 0
local euStoredPercent = 0
local reactorON = redstone.setOutput("right", true)
local reactorOFF = redstone.setOutput("right", false)
function checkeu()
euStored = mf.getEUStored()
euMax = mf.getEUCapacity()
euStoredPercent = math.floor((euStored/euMax)*100)
sleep(0.1)
end
function Power()
if euStoredPercent() < turnOnAt() then
reactorON
else euStoredPercent() > turnOffAt() then
reactorOFF
end
end
——————————–
while true do
checkeu()
Power()
sleep(1)
end
ive tryed looking around for a base script to edit to my setup but all i can find are outputing to monitors :/
Spoiler
mf = peripheral.wrap("left")local turnOnAt = 50
local turnOffAt = 90
local euStored = 0
local euMax = 0
local euStoredPercent = 0
local reactorON = redstone.setOutput("right", true)
local reactorOFF = redstone.setOutput("right", false)
function checkeu()
euStored = mf.getEUStored()
euMax = mf.getEUCapacity()
euStoredPercent = math.floor((euStored/euMax)*100)
sleep(0.1)
end
function Power()
if euStoredPercent() < turnOnAt() then
reactorON
else euStoredPercent() > turnOffAt() then
reactorOFF
end
end
——————————–
while true do
checkeu()
Power()
sleep(1)
end