ive tryed looking around for a base script to edit to my setup but all i can find are outputing to monitors :/
Spoiler
Posted 30 December 2015 - 12:00 AM
Posted 30 December 2015 - 01:22 AM
Edited by Lupus590, 30 December 2015 - 01:23 AM.
Posted 30 December 2015 - 03:14 AM
--# Declare all our variables
local redstoneSide = "right"
local mfsu = peripheral.wrap("left")
local turnOnAt = 50
local turnOffAt = 90
local capacity = mfsu.getEUCapacity()
local stored,percentage --# Tell Lua that we want these to be local, we'll use them later
--# In an infinite loop...
while true do
stored = mfsu.getEUStored() --# Get the current level of EU
percentage = math.floor( stored/capacity * 100 ) --# Calculate the current percentage
if percentage > turnOnAt and percentage < turnOffAt then --# Is the percentage more than 'turnOnAt' and also less than 'turnOffAt'?
redstone.setOutput(redstoneSide,true) --# If it is, turn on the redstone
else
redstone.setOutput(redstoneSide,false) --# Otherwise, turn it off
end
sleep(1) --# This pauses the program for a second, no need to update too often
end
Edited by HPWebcamAble, 30 December 2015 - 03:17 AM.
0 members, 1 guests, 0 anonymous users