i want to make a program that prints something but this error appears:
print:2: attempt to call nill
Code:
local p = peripheral.wrap("right")
p.newPage() --forgot that
local function printToPrinter(text)
p.write(text.."/n")
end
printToPrinter(mytexthere)
Second problem:
I want to make a program that formats the computer,but this error appears:
bios:339: [string "format"]:13: 'end' expected (to close 'for' at line 6)
Code:
print("Do u really want to format tottaly the computer?")
print("type Y if u really want type anything if not")
write("Really?: ")
y = read()
if y == y then
for k,v in pairs(fs.list("/")) do
if not fs.isReadOnly(v) then
fs.delete(v)
print("Sucefully formatted!")
sleep(2)
os.shutdown()
end
else
print("Cancelled formatting")
sleep(2)
os.reboot()
end
end











