Posted 07 March 2014 - 10:13 PM
Hey Guys, I am having an issue with this program I am writing. Basically, it's a printer program and it asks you a serious of questions. But, I'm having an issue with it setting the page title when its not supposed to. Here is the code…
p = peripheral.wrap("printer_1")
function startprint()
term.clear()
term.setCursorPos(1,1)
p.newPage()
local ink = p.getInkLevel()
local paper = p.getPaperLevel()
print(" You have "..ink.." ink and "..paper.." pieces of paper.")
print("Enter your desired message: ")
term.write(" ")
printin = read()
term.write("Enter Paper Title(Enter none if not desired): ")
title = read()
--Here is where the error would occur if title ~= none or None then
p.setPageTitle(title)
end
p.write(printin)
p.endPage()
print("Print Job Successful")
end
function wait()
term.clear()
term.setCursorPos(1,1)
term.write("What Would you like to do? ")
input = read()
if input == "print" then
startprint()
end
end
wait()
Thanks in advance for all of the help! - CRFEdited on 07 March 2014 - 09:15 PM