CaptainSpaceCat

Child Transfer

May 26th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. function transferChildProgram()
  2.   getInvoItem("CC%-Peripheral")
  3.   up()
  4.   turtle.place()
  5.   getInvoItem("disk")
  6.   turtle.drop()
  7.   local h = fs.open("disk/startup", "w")
  8.   local currentLabel = os.getComputerLabel()
  9.   currentLabel = currentLabel:gsub("%-", "_")
  10.   h.writeLine([[
  11.     turtle.left()
  12.     turtle.left()
  13.     shell.run("pastebin get 7a4sZAXm run")
  14.     local h = fs.open("startup", "w")
  15.     h.writeLine("shell.run(\"run\")")
  16.     h.close()
  17.     os.setComputerLabel("]]..currentLabel.."-"..version..[[")
  18.   ]])
  19.   h.close()
  20.   version = version + 1
  21.   down()
  22.   getInvoItem("CC%-Turtle")
  23.   turtle.place()
  24.   peripheral.wrap("front").turnOn()
  25.   sleep(2)
  26.   up()
  27.   turtle.suck()
  28.   turtle.dig()
  29.   down()
  30.   peripheral.wrap("front").reboot()
  31.   back()
  32. end
  33.  
  34. transferChildProgram()
Add Comment
Please, Sign In to add comment