the error it is throwing is on line 37 (alot of * to mark the line) and the computer is saying attempt to call string
this is the table the program receives to do the compares
ive hardcoded to convert to string and do compares, but i converted back to booleans to have the program do the compares that way, still having issues
package = {mvOneMain = {isEmpty = true, isFull = true, spaceForEnergy = true},
mvOneBack = {isEmpty = true, isFull = true, spaceForEnergy = true}}
this is the program
MODEM = peripheral.wrap("back")
M = peripheral.wrap("top")
MODEM.open(2424)
x,y = M.getSize()
tri = x/3
package = {}
function draw()
M.clear()
for i=1,3 do
M.setCursorPos((tri*i)-9,1)
if i == 1 then
M.write("- MV 1 -")
elseif i == 2 then
M.write("- MV 2 -")
else
M.write("- LV 1 -")
end
M.setCursorPos((tri*i)-9,4)
M.write("Main")
M.setCursorPos((tri*i)-9,7)
M.write("Backup")
end
end
function e(X,Y,COLOR,TEXT)
M.setCursorPos(X,Y)
M.setBackgroundColor(COLOR)
M.write(" "..TEXT.." ")
M.setBackgroundColor(colors.black)
end
function checkStatus()
if package.mvOneMain.isEmpty == true then
e(4,5,colors.red,"Empty") **************************************************************************************
elseif package.mvOneMain.spaceForEnergy == true then
e(4,5,colors.orange,"Dischargin")
elseif package.mvOneMain.isFull == true then
e(4,5,colors.lime,"Full")
else
e(4,5,colors.grey,"NA")
end
end
while true do
e,side,iC,rC,msg,dist = os.pullEvent("modem_message")
package = textutils.unserialize(msg)
print(type(package.mvOneMain.isEmpty))
draw()
checkStatus()
end











