Advertisement
mrkarp

Todo List

Apr 1st, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. -- ToDoList
  2. -- MrKarp 4/1/2016 "April Fools"
  3. -- Pop on and off items in a table to represent a editable todo list
  4.  
  5. Table = {}
  6. Sides ={"top","bottom","right","left","front","back"}
  7. itemNum = 0
  8.  
  9.  
  10. -- Find Monitor
  11. for side=0, 5 do
  12.  
  13.     whatSide = peripheral.isPresent(Sides[side])
  14.     if(whatSide=true) then
  15.     monitor = peripheral.wrap(whatSide)
  16.     write("Monitor Connected: "..whatSide)
  17.     end
  18.  
  19. end
  20.  
  21.  
  22.  
  23. function ClearMon()
  24.     monitor.clear()
  25. end
  26.  
  27. function GetInput()
  28.     write("Enter Item: ")
  29.     input = read()
  30.     table.insert(Table, input)
  31.     itemNum = itemNUm + 1
  32.     --monitor.write(itemNUm..": "..input)
  33. end
  34.  
  35. function ClearItem()
  36.     monitor.write("Delete Which Item #?: ")
  37.     delInput = read()
  38.     table.delete(Table, delInput)
  39. end
  40.  
  41. function Display()
  42.     for i=0, #Table do
  43.         monitor.write(Table[i])
  44.     end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement