Advertisement
kd2bwzgen

CraftOS Debian

Aug 5th, 2015
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1, 1)
  3. print("CraftOS Debian")
  4. local trueV = true
  5. local computerID = os.getComputerID()
  6. local greetingR = "user@computer"..tostring(computerID)..":"
  7. local greeting = greetingR.."-$ "
  8. local greetingS = greeting
  9. repeat
  10. write(greeting)
  11. input = read()
  12. if input == "cd" then
  13. print("Which directory do you wish to change to?")
  14. input2 = read()
  15. end
  16. if input2 == "/" then shell.run("cd /") greeting = greetingS else shell.run("cd /"..input2) greeting = greetingR.."-/"..input2.."$ " end
  17. -- if input == "dev" then
  18. -- print("Editing CraftOS Debian...")
  19. -- sleep(3)
  20. -- shell.run("edit startup")
  21. -- end
  22. if input == "reboot" then
  23. term.clear()
  24. term.setCursorPos(1, 1)
  25. write("Going down for reboot now!")
  26. sleep(3)
  27. os.reboot()
  28. end
  29. if input == "execute" or input == "exec" then
  30. print("Path to script you wish to execute?")
  31. write(">")
  32. input2 = read()
  33. shell.run(input2)
  34. end
  35. if input == "edit" or input == "nano" then
  36. write("Name of program?:")
  37. input2 = read()
  38. if input2 == "startup" then print("Unable to edit OS.") else shell.run("edit "..input2) end
  39. end
  40. if input == "chat" then
  41. write("Name: ")
  42. input2 = read()
  43. write("Server: ")
  44. input3 = read()
  45. shell.run("chat join "..input3.." "..input2)
  46. end
  47. if input == exit then
  48. print("Exiting...")
  49. os.sleep(3)
  50. trueV = false
  51. end
  52. until trueV == false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement