Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("left")
- local monx, mony = mon.getSize()
- term.clear()
- mon.clear()
- mon.setCursorPos(5,1)
- mon.setTextColor(colors.blue)
- mon.write("To Do List")
- mon.setTextColor(colors.orange)
- mon.setCursorPos(1,2)
- mon.write("Green Means Completed, Red Means Not")
- mon.setCursorPos(1,4)
- while true do
- monx, mony = mon.getSize()
- temp = mony
- mony = 4
- repeat
- numberx, numbery = mon.getCursorPos()
- mon.setCursorPos(monx - 6, mony)
- mon.setTextColor(colors.cyan)
- mon.write("Line " .. mony)
- numbery = numbery + 2
- mony = mony + 2
- until mony >= temp
- term.setTextColor(colors.blue)
- term.setCursorPos(11,1)
- term.write("Welcome to the To Do List")
- term.setTextColor(colors.red)
- term.setCursorPos(1,2)
- term.write("Note: All list items are limited to 7 characters")
- term.setCursorPos(1,3)
- term.write("before the end of the monitor.")
- term.setCursorPos(1,4)
- term.write("Add more monitors to increase length of items.")
- term.setCursorPos(1,5)
- term.write("Minimum Monitor Width is 4 Blocks Wide")
- term.setTextColor(colors.orange)
- term.setCursorPos(1,7)
- term.write("Follow the Below Prompts to Edit To Do List")
- term.setTextColor(colors.white)
- term.setCursorPos(1,8)
- mon.setTextColor(colors.red)
- mon.write("> ")
- mon.setTextColor(colors.white)
- term.write("Enter Line to Edit: ")
- line = read()
- line = tonumber(line)
- if line ~= nil then
- if (line % 2 ~= 0) or (line < 4) then
- term.write("Line Invalid")
- sleep(1)
- else
- term.write("Enter List Item or Type C for Completed,")
- term.setCursorPos(1,10)
- term.write("NC for Not Completed or DEL to Delete: ")
- term.setCursorPos(1,11)
- newline = read()
- mon.setCursorPos(1,line)
- if (newline == "C") or (newline == "c") then
- mon.setTextColor(colors.green)
- mon.write("> ")
- elseif (newline == "NC") or (newline == "nc") or (newline == "Nc") or (newline == "nC") then
- mon.setTextColor(colors.red)
- mon.write("> ")
- elseif (newline == "DEL") or (newline == "Del") or (newline == "DEl") or (newline == "DeL") or (newline == "dEl") or (newline == "dEL") or (newline == "deL") or (newline == "del") then
- mon.setTextColor(colors.red)
- mon.clearLine()
- else
- mon.clearLine()
- mon.setTextColor(colors.red)
- mon.write("> ")
- mon.setTextColor(colors.white)
- mon.write(newline)
- end
- end
- else
- term.setTextColor(colors.red)
- term.write("Invalid Line")
- sleep(1)
- end
- if line ~=nil then
- if (line % 2 == 0) and (line >= 4) then
- term.write("Todo List Updated")
- sleep(1)
- term.clear()
- else
- term.clear()
- end
- else
- term.clear()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement