Posted 06 October 2016 - 09:17 AM
Ok here's my problem. I'm trying to make it so if the saturation or shields on my reactor get too low then have it shut down. When I do the check without the if offline or charging it works but when I add just that part the code doesn't work anymore. Here's the pastbin link for full code and a c/p of the part of the code I'm having trouble with.
http://pastebin.com/fDhPGR2Y
Edit: Now that I think about it. To make things easier is there a way to make a table that's from a peripheral into a local string? If so how would I get started as it would help a lot.
Edit 2: nevermind someone online showed me how and I got it fixed.
http://pastebin.com/fDhPGR2Y
if k == "energySaturation" then
term.setCursorPos(1,7)
dmon.setCursorPos(1,7)
spos = v / 876543209 * 100
print("RF Saturation: "..spos.."%")
dmon.write("RF Saturation: "..spos.."%")
if spos <= 20 then
-- When I add the stats check it stops working for some reason
if stats == "offline" or "charging" then
else
dreactor.stopReactor()
clear()
term.setCursorPos(1,10)
dmon.setCursorPos(1,10)
dmon.write("Shutdown.. Drained Too Fast")
print("Shutdown.. Drained Too Fast")
end
end
end
Edit: Now that I think about it. To make things easier is there a way to make a table that's from a peripheral into a local string? If so how would I get started as it would help a lot.
Edit 2: nevermind someone online showed me how and I got it fixed.
Edited on 06 October 2016 - 09:39 AM