Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sygnal()
- czyjest, blok=turtle.inspect()
- if blok["name"]=="minecraft:log" then
- znaleziono = "drewno"
- elseif blok["name"]=="minecraft:leaves" then
- znaleziono = "lisc"
- elseif blok["name"]=="minecraft:tallgrass" then
- znaleziono = "trawa"
- elseif blok["name"]=="minecraft:double_plant" then
- znaleziono = "kwiatek"
- elseif blok["name"]=="minecraft:yellow_flower" then
- znaleziono = "kwiatek"
- else
- znaleziono = "nic"
- end
- return znaleziono
- end
- function ruchpodstawowy()
- while turtle.detectDown()==false do
- turtle.down()
- end
- while (turtle.detect()==true) and (sygnal()=="nic") do
- turtle.up()
- end
- if turtle.detect()==false then
- turtle.forward()
- end
- end
- function ruchpelny()
- if sygnal()=="nic" then
- ruchpodstawowy()
- end
- if sygnal()=="lisc" then
- turtle.dig()
- end
- if sygnal()=="trawa" then
- turtle.dig()
- end
- if sygnal()=="kwiatek" then
- turtle.dig()
- end
- if sygnal()=="drewno" then
- while sygnal()=="drewno" do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- end
- end
- function obrotprawo()
- turtle.turnRight()
- ruchpelny()
- turtle.turnRight()
- end
- function obrotlewo()
- turtle.turnLeft()
- ruchpelny()
- turtle.turnLeft()
- end
- local arg1, arg2 = ...
- p=1
- zwr=0
- for p=1,arg2 do
- u=1
- for u=1,arg1 do
- ruchpelny()
- u=u+1
- end
- zwr=zwr+1
- if zwr==1 then
- obrotprawo()
- else
- obrotlewo()
- zwr=0
- end
- end
Add Comment
Please, Sign In to add comment