Posted 08 November 2016 - 01:15 AM
Well I just made this basic code to chop stuff (wood , well it doesnt verifies , but I'm so noob at the moment). and I get this error
bios:14: [string "chopWood"]:12: '=' expected
SET_STEP = 5;
point = 1; -- position poiting to
stepDoneFW = 0; -- step done forward
stepDoneUP = 0; -- step done up
choppedNb = 0; -- number of stuff digged
chopped = false;
function chopTree()
repeat
turtle.up();
turtle.dig();
choppedNb++;
stepDoneUP++;
until !(turtle.detect())
return stepDoneUP;
end
function move(step,direction)
stepAccomplish = 0;
for i=0;step do
if direction == 'front' then
if !(turtle.detect()) then
stepAccomplish++;
turtle.forward();
else
return stepAccomplish;
end
else
turtle.back();
end
end
return stepAccomplish + 1;
end
function Main()
stepDoneFW = move(SET_STEP,'front');
if (stepDone <= SET_STEP) then
stepDoneUP = chopTree();
for goDown = 0,stepDoneUP do
turtle.down();
end
end
move(stepDoneFW,'backward');
turtle.turnRight();
end
while point != 1 do
point++;
if point > 4 then
point = 1;
end
turtle.turnRight();
end
repeat
Main();
until chopped
print("Buddy I found:" .. choppedNb .. " logs.There ya go chumps!");