Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- write "Welcome to Notepad"
- sleep(1)
- term.setCursorPos(1,1)
- term.clearLine()
- --this is getting rid of that line that we no longer need
- sleep(1)
- --this is getting the user typeing
- write "you may start typing. when you are done please push 'end' to print"
- function notepad()
- x = io.read()
- --now this is going to get the users keyboard button press p.s. i wanted it to be the end key
- if event == "char" and param1 == "end" then
- sleep(1)
- print "which side is your printer on"
- c = io.read()
- local printer=perhipheral.wrap(c)
- end
- --print start
- -- this is to see if the printer is out of ink or paper
- if printer.getInkLevel()==0 then
- write "No Ink! Add Some More To Print"
- while printer.getInkLevel()==o do
- os.sleep(.5)
- end
- if printer.getPaperLevel()==0 then
- write "No Paper! add some more please"
- while printer.getPaperLevel()==0 do
- os.sleep(.5)
- end
- --print end
- -- this is where the printer starts the print
- --print start
- printer.newPage()
- sleep(1)
- m = io.read()
- if m == "yes" then
- title()
- printer.write(x)
- printer.setCursorPos(1,2)
- local w, h=printer.getPageSize()
- printer.setCursorPos(1,h)
- local str="Vertical"
- for i=1,#str do
- printer.setCursorPos(w.i
- printer.write(string.sub(str,i,i))
- elseif m == "no" then
- notepad()
- end
- --print end
- -- this asks if the user wants to add a title
- write "would you like to add a title to show in inventory"
- i = io.read()
- if i == "yes" then
- write "what should it be"
- o = io.read()
- funcion title()
- printer.setPageTitle(o)
- end
- elseif i == "no" then
- printer.endPage()
- end
- sleep(1)
- write "your document is finished"
- term.clear()
- --parts of the code where the comment "print"
- --was a part of the printer tutorial made by"GopherAtl"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement