Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Funktionen
- -- Turtle Setup: (w Emtyp,c colored wool, s Setzlinge)
- -- wwww
- -- wwww
- -- wwww
- -- wwsc
- -- Welt: links Wolle,Hinten truhe,Unten truhe setzlinge, rechts setzlinge-farm Reihe,
- function checkFuel()
- if(turtle.getFuelLevel()<250) then
- turtle.select(2);
- turtle.refuel(10);
- end
- end
- function checkRotation()
- for i = 0,4,1 do
- turtle.turnLeft();
- turtle.select(16);
- if turtle.compare() then
- turtle.turnRight();
- return true;
- end
- end
- return fales;
- end
- function searchRotation()
- for i = 0,4,1 do
- turtle.turnLeft();
- turtle.forward();
- if checkRotation() then
- return true;
- end
- turtle.back();
- end
- end
- function pickupSetzlinge()
- turtle.select(15);
- turtle.turnRight();
- turtle.suck();
- turtle.forward();
- for i=1,4,1 do
- turtle.turnRight();
- turtle.suck();
- end
- turtle.back();
- turtle.turnLeft();
- end
- function dumpInventory()
- for i = 3,14,1 do
- turtle.select(i);
- turtle.drop();
- end
- end
- function Resupply()
- turtle.turnLeft();
- turtle.turnLeft();
- dumpInventory();
- turtle.select(15);
- turtle.suckDown();
- turtle.turnLeft();
- turtle.turnLeft();
- end
- function CheckTree()
- turtle.turnRight();
- turtle.select(1);
- if turtle.compare() then
- FarmTree();
- end
- turtle.select(15);
- turtle.place();
- turtle.turnLeft();
- end
- function FarmTree()
- turtle.select(1);
- for i = 0,10,1 do
- if turtle.compare() then
- turtle.dig();
- turtle.digUp();
- turtle.up();
- end
- if turtle.compare()==false then
- break;
- end
- end
- for i = 0,10,1 do
- turtle.down();
- end
- end
- -- Program Start
- while(turtle.down()) do
- end
- searchRotation();
- turtle.select(2);
- checkFuel();
- while(turtle.back()) do
- turtle.refuel();
- end
- Resupply();
- while(true) do
- turtle.select(2);
- while(turtle.forward()) do
- turtle.select(15);
- pickupSetzlinge();
- turtle.forward();
- turtle.select(2);
- checkFuel();
- CheckTree();
- turtle.forward();
- sleep(20);
- end
- while(turtle.back()) do
- turtle.select(2);
- checkFuel();
- end
- Resupply();
- print("sleeping");
- for i =0,100,1 do
- print(".");
- sleep(10);
- end
- end
Add Comment
Please, Sign In to add comment