Posted 22 January 2014 - 03:23 PM
some times it says "too long without yeilding"
–Variables
local m = peripheral.wrap("left")
local gatefr = peripheral.wrap("gateReader_7", "gateReader_8")
local gateba = peripheral.wrap("gateReader_6")
local rSide = "bottom"
local stat1
local stat2
x , y = term.getSize()
–Functions
function drAcross(line, char , col)
term.setCursorPos(1 , line)
term.setTextColor(col)
for i = 1, x do
term.write(char)
end
end
function drCenter(line , text , col)
term.setCursorPos((x-string.len(text))/2, line)
term.setTextColor(col)
term.write(text)
end
function text()
m.setTextColor(colors.red)
term.setTextColor(colors.red)
m.setCursorPos(1,1)
term.setCursorPos(5,4)
end
–Code
m.clear()
term.clear()
drAcross(1, "*", 2 )
drCenter(2, "Everland energy system control", 4 )
drAcross(3, "*", 2 )
while(true) do
stat1 = gatefr.get()
stat2 = gateba.get()
if stat1["Full Energy"] == true then
rs.setOutput(rSide, false )
text()
m.write("Enengines OFF ")
term.write("Energy cube is full, engine OFF ")
end
if stat2["No Energy"] == true then
rs.setOutput(rSide, true )
text()
m.write("Engines ON ")
term.write("Energy cube is NOT full, engine ON")
end
sleep(2)
end
–Variables
local m = peripheral.wrap("left")
local gatefr = peripheral.wrap("gateReader_7", "gateReader_8")
local gateba = peripheral.wrap("gateReader_6")
local rSide = "bottom"
local stat1
local stat2
x , y = term.getSize()
–Functions
function drAcross(line, char , col)
term.setCursorPos(1 , line)
term.setTextColor(col)
for i = 1, x do
term.write(char)
end
end
function drCenter(line , text , col)
term.setCursorPos((x-string.len(text))/2, line)
term.setTextColor(col)
term.write(text)
end
function text()
m.setTextColor(colors.red)
term.setTextColor(colors.red)
m.setCursorPos(1,1)
term.setCursorPos(5,4)
end
–Code
m.clear()
term.clear()
drAcross(1, "*", 2 )
drCenter(2, "Everland energy system control", 4 )
drAcross(3, "*", 2 )
while(true) do
stat1 = gatefr.get()
stat2 = gateba.get()
if stat1["Full Energy"] == true then
rs.setOutput(rSide, false )
text()
m.write("Enengines OFF ")
term.write("Energy cube is full, engine OFF ")
end
if stat2["No Energy"] == true then
rs.setOutput(rSide, true )
text()
m.write("Engines ON ")
term.write("Energy cube is NOT full, engine ON")
end
sleep(2)
end
Edited on 23 January 2014 - 01:57 AM