Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if turtle == nil then
- term.clear();
- term.setCursorPos(1, 1);
- print("Auto-turtle-programmer v6.8")
- print("-programs------------------")
- shell.run("rom/programs/list", "disk/turtle")
- print("---------------------------")
- return
- end
- local tDir = "disk/turtle"
- if(fs.exists(tDir))then
- local tAll = fs.list( tDir )
- local tFiles = {}
- local tDirs = {}
- fsm.delete("startup")
- fs.copy(fs.combine( tDir, "startup"), "startup")
- for n, sItem in pairs( tAll) do
- local sPath = fs.combine( tDir, sItem );
- fs.delete(sItem)
- fs.copy(sPath, sItem);
- if string.sub(sItem, 1, 1) == "." then
- shell.run(sItem)
- end
- print("Got program: " .. sItem)
- end
- turtle.refuel()
- turtle.up()
- turtle.up()
- end
- rednet.open("right")
- rednet.send(155, "ayylmao:" .. os.getComputerLabel())
- function handleMessages()
- while true do
- local id, message = rednet.receive()
- if(id == 155) then
- x, y, z = gps.locate()
- if (message == "x") then
- rednet.send(id, x)
- elseif(message == "y") then
- rednet.send(id, y)
- elseif(message == "z") then
- rednet.send(id, z)
- end
- end
- end
- end
- function openShell()
- shell.run("shell")
- end
- parallel.waitForAll(handleMessages, openShell)
Advertisement
Add Comment
Please, Sign In to add comment