Mariomarco

TaskMGR

Feb 4th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. rednet.open("back")
  2. local CurrentPath = ""
  3. local done = false
  4. local FirstInstance = true
  5. local Entry = ""
  6. local function newLine()
  7.     local CX, CY = term.getCursorPos()
  8.     term.setCursorPos(1,CY +1) 
  9. end
  10.  
  11. term.write("Welcome to")
  12. newLine()
  13. term.write("TaskMGR v1.0")
  14. newLine()
  15. newLine()
  16. sleep(1)
  17. while redstone.getInput("left") == false do
  18.     done = false
  19.     CurrentPath = ""
  20. while done == false do
  21.     term.clear()
  22.     term.setCursorPos(1,1)
  23.     term.write(CurrentPath)
  24.     newLine()
  25.     term.write("---------------")
  26.     newLine()
  27.     Entry = read()
  28.    
  29.     if string.match(Entry , "exit") or string.match(Entry , "Exit") then
  30.         return
  31.     end
  32.     if string.match(Entry , "done") or string.match(Entry , "Done") or string.match(Entry , "!") then
  33.         FirstInstance = true
  34.         done = true
  35.         rednet.broadcast(CurrentPath)
  36.         redstone.setOutput("top",true)
  37.         sleep(0.7)
  38.         redstone.setOutput("top",false)
  39.     end
  40.  
  41.     if FirstInstance == true then
  42.         CurrentPath = Entry
  43.         FirstInstance = false
  44.     else
  45.         CurrentPath = CurrentPath .. "." .. Entry
  46.     end
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment