Posted 08 December 2013 - 01:32 PM
Automatic Energy Cell refilling system
Hello out there! ;)/>
So.. i made this code for a friend yesterday, and it didnt really work out as it was suppose to do, so i began to make a new, but i keep hitting the same wall, i've tryed to walk around to issue by saying it to do it in another way..
the code is simple enough:p
Spoiler
local c = peripheral.wrap("bottom")
local function cell()
if c.getEnergyStored() < 500000 then
rs.setBundledOutput("back", 1)
elseif c.getEnergyStored() == c.getMaxEnergyStored() then
rs.setBundledOutput("back", 0)
sleep(10)
end
end
while true do
cell()
term.clear()
term.setCursorPos(1,1)
print("Energy cell management")
sleep(2)
end
i get the error message: Attempt to compare number with string expected, got string
Please help me out here.. i dont understand it since i would mean it's simple enough and should work just fine?
Regards Plazter