Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local things = {}
- local dates = {}
- local players = {}
- local slc = 0
- --API Methods
- function screen()
- term.clear()
- term.setCursorPos(1,1)
- end
- function todo( date, index, player,section )
- table.insert(things, section, index)
- table.insert(dates, section, date)
- table.insert(players, section, player)
- end
- function add()
- screen()
- print("New Todo section!")
- print("What is the new mission? ")
- mission = read()
- screen()
- print("What is the time this mission is added? ")
- day = read()
- screen()
- print("Who is making this mission? ")
- human = read()
- screen()
- number = slc
- todo(day,mission,human,number)
- end
- function gadets()
- term.setCursorPos(34,18)
- term.setTextColor(colors.red)
- term.write("Press 'h' for help")
- term.setTextColor(1)
- term.setCursorPos(1,1)
- end
- function helpScreen()
- screen()
- print("Press 'a'to add new mission")
- print(c)
- print("Press 'c' to remove all missions")
- print(c)
- print("Press 't' to stop the program")
- term.setCursorPos(1,18)
- term.write("Press eny key to continue..")
- term.setCursorPos(1,1)
- end
- --Main Methods
- function printScreen()
- gadets()
- if slc == 0 then
- print("There is none mission's setup!")
- end
- for i = 1, #things do
- term.write("Number ")
- term.setTextColor(colors.red)
- print(i)
- term.setTextColor(1)
- term.write(" Todo = ")
- term.setTextColor(colors.red)
- print(things[i])
- term.setTextColor(1)
- term.write(" Time: ")
- term.setTextColor(colors.red)
- term.write(dates[i])
- term.setTextColor(1)
- term.write(" Made by ")
- term.setTextColor(colors.red)
- term.write(players[i])
- term.setTextColor(1)
- print(c)
- print(c)
- end
- end
- --Main Program
- screen()
- gadets()
- print("There is none mission's setup!")
- while true do
- event,button = os.pullEvent("key")
- if button == keys.a then
- slc = slc + 1
- if slc < 5 then
- add()
- else
- screen()
- print("You can not make more than 4 missions until next update!")
- print(c)
- end
- printScreen()
- elseif button == keys.c then
- things = {}
- dates = {}
- players = {}
- slc = 0
- screen()
- print("Deleting..")
- sleep(2)
- print("Deliting Complete!")
- sleep(1)
- screen()
- print("There is none mission's setup!")
- gadets()
- elseif button == keys.h then
- helpScreen()
- eventtwo,buttontwo = os.pullEvent("key")
- if buttontwo ~= 0 then
- screen()
- printScreen()
- end
- elseif button == keys.t then
- break
- else
- end
- sleep(.5)
- end
- screen()
- print("Program Ended!")
- sleep(1)
- screen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement