Since im not that familiar with coding, could you give me the example of what i need to change in order ir to work?
I'm guessing someone else wrote some of this code then?
Try using this:
term.clear()
term.setCursorPos(1,1)
Targets = sensors.getAvailableTargetsforProbe("right", "EUSensor", "EUStorage")
if #Targets ~= 0 then
Reading = sensors.getSensorReadingAsDict("right", "EUSensor", Targets[1], "EUStorage")
Max = Reading.maxStorage
Energy = Reading.energy
Tier = Reading.tier
for k, v in pairs(Reading) do print(k, V) end
else
Max = 0
Energy = 0
Tier = 1
end
if Tier == 1 then
unit = "BatBox"
elseif Tier == 2 then
unit = "MFE"
elseif Tier == 3 then
unit = "MFSU"
else
unit= "error"
end
if Energy == nil then
Energy = "error"
end
if Max == nil then
Max = "error"
end
while true do
sleep(0)
term.clear()
term.setCursorPos(1,1)
write("================UTILITIES=================")
term.setCursorPos(1,2)
write("Time : "..textutils.formatTime(os.time(),true))
term.setCursorPos(1,4)
write("===============STORAGE UNIT===============")
term.setCursorPos(1,5)
write("Energy : "..Energy.."/"..Max.." ")
term.setCursorPos(1,6)
write("Tier : "..unit.." ")
end
Now if there's a problem with the file reading, the computer will write error where energy,max and unit should be.
As for any errors with the sensor-related code, I can't help with that unles
s I know what the functions of it are.