theMCcm

theMCcm's Custom Startup

May 9th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. -----------------------------------------------
  2. --Define Variables
  3. -----------------------------------------------
  4. computerName = os.getComputerLabel()
  5. local loop = true
  6. -----------------------------------------------
  7. --Checking To Make Sure Computer Has Name
  8. -----------------------------------------------
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. if computerName == nil then
  12. print("Please select a name for your computer.")
  13. term.write("Name: ")
  14. local name = read()
  15. os.setComputerLabel(tostring(name))
  16. computerName = os.getComputerLabel()
  17. end
  18. -----------------------------------------------
  19. --Checking And Opening Rednet
  20. -----------------------------------------------
  21. for _,v in pairs( rs.getSides() ) do
  22. if peripheral.getType( v ) == "modem" then
  23. rednet.open( v )
  24. end
  25. end
  26. -----------------------------------------------
  27. --Loading theMCcm's API
  28. local file = fs.exists("themccm")
  29. if file == false then
  30. fs.makeDir("themccm")
  31. end
  32. local file = fs.exists("themccm/mc")
  33. if file == false then
  34. shell.run("pastebin", "get", "5ww6Pb8i", "themccm/mc")
  35. end
  36. os.unloadAPI("themccm/mc")
  37. os.loadAPI("themccm/mc")
  38. -----------------------------------------------
  39. --Program
  40. -----------------------------------------------
  41. mc.clear()
  42. print("Hello. I'm "..computerName..", at your service.")
  43. while loop == true do
  44. term.write(computerName..": ")
  45. input = read()
  46. shell.run(tostring(input))
  47. end
Advertisement
Add Comment
Please, Sign In to add comment