Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ------------------------------------ --
- -- build core | crafty | modem | v1 --
- -- builds a modem --
- -- based on vertical array --
- -- ------------------------------------ --
- stone,redstone,glass,iron=shell.run("recipe") -- modem recipe pastebin.com/HjaP1eYm
- ingredients={stone,{nil},glass,iron}
- -- resets the robot
- shell.run("resetBuild") -- pastebin.com/jHBga2nu
- -- weird exception. modem needs a torch crafted.
- -- assumes robot is at top
- shell.run("go down 2") --skip to redstone
- turtle.suck() --from redstone
- turtle.transferTo(11,1)
- turtle.drop()
- shell.run("turn left 2") --does 180
- turtle.suck() --from sticks
- turtle.transferTo(15,1)
- turtle.drop()
- turtle.craft() --just made 1 torch
- turtle.transferTo(11) --torch goes to slot 11
- shell.run("turn left 2") --does 180 back to normal
- shell.run("go up 2") --back to start except with a torch in slot 11
- -- runs through ingredients
- for i=1,getn(ingredients) do
- turtle.down()
- if getn(ingredients[i])>0 then
- turtle.select(1)
- turtle.suck()
- for j=1,getn(ingredients[i]) do
- turtle.transferTo(ingredients[i][j],1)
- end
- turtle.drop()
- end
- end
- --actually creates the modem
- turtle.craft()
- --go to bottom level to dropoff product
- while turtle.detectDown() do
- turtle.down()
- end
- turtle.drop()
- -- check fuel levels
- shell.run("refuelBuild") -- pastebin.com/n9KMVt9x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement