im also using a gui loadbar function called findvirus it is at the top.
-- Partial/All Code courtesy of Vandie
function findvirus(sx, fx, sym)
x,y = term.getCursorPos()
if y >= 18 then
term.clear()
term.setCursorPos(sx,1)
x,y = sx,1
end
term.setCursorPos(sx,y)
write("[")
term.setCursorPos(sx,y)
term.setCursorPos(fx-1,y)
write("]")
mdp = math.floor((sx + fx)/2) - 3
for i = (sx+1),(fx-2) do
term.setCursorPos(i,y)
write(sym)
sleep(0.4) --CHANGE THIS TO EDIT TIME
term.setCursorPos(mdp,y+1)
write(string.format("%d",i/(fx-2) * 100))
write("%")
end
term.setCursorPos(1,y+2)
end
term.clear()
term.setCursorPos(1,1)
print("welcome to Vandie's advanced antivirus")
sleep(2)
if fs.exists("startup") then
term.clear()
term.setCursorPos(1,1)
print("checking for virus a1")
findvirus(1,20,"/")
sleep(1)
local file = io.open( "startup", "r" )
if StrUtils.StrUtils.contains("os.shutdown()","os.shutdown()")
then
file:close()
fs.delete("startup")
term.clear()
term.setCursorPos(1,1)
print("virus-a1 was found")
sleep(2)
print("virus-a1 was removed")
sleep(2)
else
file:close()
end
else
file:close()
end
and i get this error
43: attempt to index ? (a nil value)