The Code:
-- Variables --
local w, h = term.getSize()
local Name = "Untitled"
local text
local textString = {}
local textNum = 0
local Line = 2
-- Functions --
-- Main Code --
for i=1, w do
paintutils.drawPixel(i, 1, colors.white)
paintutils.drawPixel(i, h, colors.white)
end
for i=1, h do
paintutils.drawPixel(1, i, colors.white)
paintutils.drawPixel(w, i, colors.white)
end
term.setCursorPos(math.floor(w-string.len(Name)) / 2, 1)
term.setTextColor(colors.blue)
term.write(Name)
term.setCursorPos(2, 1)
term.write("File")
term.setCursorPos(2, h)
term.write("Current Line: "..Line-2)
term.setCursorPos(2, 2)
term.setBackgroundColor(colors.black)
text = read()
while true do
local event, button, xPos, yPos = os.pullEvent()
if event == "key" and button == keys.enter then
textString[Line - 2] = text
Line = Line + 1
term.setBackgroundColor(colors.white)
term.setTextColor(colors.blue)
term.setCursorPos(2, w)
term.write("Current Line: "..Line-2)
term.setBackgroundColor(colors.black)
term.setCursorPos(Line, 2)
text = read()
elseif event == "mouse_click" then
end
end
It crashes when I press enter, I don't get an error, but the cursor goes away, and also, how would I scroll?