Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- function round()
- print("Doing a round")
- empty()
- checkFuel()
- checkSeeds()
- overBlock()
- while roundMove() == false do
- --print("lol")
- end
- empty()
- print("done")
- end
- function sow()
- for i=1,16,1 do
- turtle.select(i)
- local data = turtle.getItemDetail()
- if data then
- print(data.name)
- if data.name == "minecraft:wheat_seeds" then
- turtle.placeDown()
- return
- end
- end
- end
- end
- function overBlock()
- turtle.suckDown(64)
- local success, data = turtle.inspectDown()
- if success then
- print(data.name)
- print(data.metadata)
- if data.name == "minecraft:wheat" then
- if data.metadata == 7 then
- turtle.digDown()
- turtle.suckDown(64)
- os.sleep(0.1)
- turtle.suckDown(64)
- sow()
- end
- end
- else
- turtle.digDown()
- sow()
- end
- turtle.suckDown(64)
- end
- function roundMove()
- local success, data = turtle.inspect()
- if success then
- print(data.name)
- if data.name == args[1] then
- turtle.turnRight()
- if turtle.detect() == true then
- turtle.turnRight()
- turtle.turnRight()
- while turtle.detect() == false do
- turtle.forward()
- end
- turtle.turnLeft()
- while turtle.detect() == false do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- return true
- else
- turtle.forward()
- overBlock()
- turtle.turnRight()
- end
- elseif data.name == args[2] then
- turtle.turnLeft()
- turtle.forward()
- overBlock()
- turtle.turnLeft()
- else
- print("wtf")
- end
- else
- turtle.forward()
- overBlock()
- end
- return false
- end
- function checkFuel()
- while turtle.getFuelLevel() < 1000 do
- print("Gimme fuel boiii")
- print(turtle.getFuelLevel())
- turtle.select(1)
- turtle.turnLeft()
- turtle.suck(64)
- turtle.refuel(64)
- turtle.turnRight()
- end
- end
- function checkSeeds()
- for i=1,4,1 do
- turtle.select(i)
- turtle.suckUp(64)
- end
- end
- function empty()
- for i=1,16,1 do
- turtle.select(i)
- local data = turtle.getItemDetail()
- if data then
- print(data.name)
- if data.name == "minecraft:wheat_seeds" then
- turtle.dropUp(64)
- elseif data.name == "minecraft:wheat" then
- http.get("http://tools.cablepost.co.uk/cc/variables/altervariable.php?cmd=add&var=wheat&val="..tostring(turtle.getItemCount(i)))
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.drop(64)
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
- end
- print("Sup brethren, this program takes 2 arguments btw, first is border wall on back side, seconds is border wall on front side")
- round()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement