oh and i made comments in the program that should help you to try to figure it out. p.s. thank you for helping if you did
[attachment=680:notepad (minecraft version).txt]
or read this
—————————————————————————————————————————————————————————————————————–
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©
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"
(ORINGINAL)
———————————————————————————————————————————————————————————————–
this it fixed mostly (NEWEST)
———————————————————————————————————————————————————————————————–
write "Welcome to Notepad"
sleep(1)
term.setCursorPos(1,1)
term.clear()
--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"
term.setCursorPos(1,3)
write "keys: [
[ ] to finish, [=] to move down a line"
term.setCursorPos
(1,4)
print
"---------------------------------------------------"
term.setCursorPos(1,6)
function notepad()
end
function note
()
local e, t=term.getCursorPos()
k=1,#str
term.setCUrsorPos(1,t)
local str="Vertical"
u=1,#str
term.setCursorPos(k,u + k)
end
x = io.read()
--now
this is going to get the users keyboard button press p.s.
i wanted it to be the end key
event, param1, param2 =
os.pullEvent()
if event == "char" and param2 == "=" then
note()
end
if event == "char" and param1 == "["
then
sleep(1)
find()
print "which side is your printer on"
c
= io.read()
local printer=perhipheral.wrap(c)
sleep(.2)
if printer==nil then
term.setTextColor(colors.red)
print "No Printer Detected! please try again"
term.setTestColor(colors.white)
function find()
end
elseif printer==true then
print "printer found!"
end
end
--print start
-- this is to see if the printer is
out of ink or paper
local printer
if printer.getInkLevel()
== "0" then
write "No Ink! Add Some More To Print"
while printer.getInkLevel() == "0" do
os.sleep(.5)
end
end
if printer.getPaperLevel() == "0"
then
write "No Paper! add some more please"
while printer.getPaperLevel() == "0" do
os.sleep
(.5)
end
end
--print end
-- this is where the printer
starts the print
--print start
printer.newPage()
sleep(1)
write "would you like to print?"
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))
end
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)
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"
———————————————————————————————————————————————————————————————–i fixed most of my code by myself but on the part where you are typing i can't figure out how to make it where the cursor will go down a line when you push enter.
when i pushed enter it said "notepad:24: attempt to index ? (a nil value)
but i cant figure out how to tell it to go down a line. please help me!!!OH and i would like the next line key to be ENTER, and the finich key to be the END key. thankyou