computercraft turtle not working

El_Diablo256

New Member
Jul 29, 2019
28
0
0

tra95

New Member
Jul 29, 2019
8
0
0
On line 86:
Code:
if turtle.getFuelLevel < 50 then

Should be
Code:
if turtle.getFuelLevel() < 50 then

As its a function. On a semi related node, for loops can shorten your code considerably. For example:
Code:
turtle.up()
turtle.up()
turtle.up()

can be shortened to
Code:
for variable = 1,3 do
turtle.up()
end

To apply this to line 53-66 of your script, you could do
Code:
for variable = 2,7 do
turtle.select(variable)
turtle.dropDown()
end
 

El_Diablo256

New Member
Jul 29, 2019
28
0
0
On line 86:
Code:
if turtle.getFuelLevel < 50 then

Should be
Code:
if turtle.getFuelLevel() < 50 then

ty, hmm i stared for about 20 mins o that spot and i didn't see it ..
:O

As its a function. On a semi related node, for loops can shorten your code considerably. For example:
Code:
turtle.up()
turtle.up()
turtle.up()

can be shortened to
Code:
for variable = 1,3 do
turtle.up()
end

To apply this to line 53-66 of your script, you could do
Code:
for variable = 2,7 do
turtle.select(variable)
turtle.dropDown()
end

but does it then go from 2 to 3 to 4 to 5 etc..?
 

El_Diablo256

New Member
Jul 29, 2019
28
0
0
Yep. The code is executed with variable having the value 2,3,4,5,6,7
i finished it and it is working perfect :), now im doing exactly the same, but now for wheat this is the code: http://pastebin.com/ZpfHunNb
but what it says when i want to run it is bios:338: [string:40: '=' expected

i have encountered this many times, and normaly i was able to fix it, but now i dont know what the problem is..
if you could help me again, great!
if not, well no problem
 

tra95

New Member
Jul 29, 2019
8
0
0
Great to hear its working :)
Line 40:
Code:
fuction whole()

Should be
Code:
function whole()