You are viewing our Forum Archives. To view or take place in current topics click here.
Need Lua Help/Computercraft
Posted:

Need Lua Help/ComputercraftPosted:

Majesticfalcon
  • Resident Elite
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
I have a small chunk of code that is messing my huge project up and i dont know why it is just this small piece. Here it is.
repeat
if turtle.detect() == true then
turtle.dig()
turtle.forward()
end
until
turtle.detect() ~= true
end

Im getting bios:206: [string "dig"]:7: '<eof>' expected
Idk what is going wrong. Please post solution, or what im doing wrong
#2. Posted:
RDCA
  • TTG Contender
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
Status: Offline
Joined: Jul 12, 201014Year Member
Posts: 3,612
Reputation Power: 173
I am not very experienced with LUA, but I am pretty sure you are missing an end keyword. As for where, I am not totally sure. Try this first:


repeat
if turtle.detect() == true then
turtle.dig()
turtle.forward()
end
until
turtle.detect() ~= true
end
end


As I don't think you ever ended the repeat statement.
#3. Posted:
Majesticfalcon
  • Resident Elite
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
Gah! i already tried that, it still wont work, and im getting very frustrated.
#4. Posted:
Majesticfalcon
  • Resident Elite
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
Status: Offline
Joined: Jan 02, 201213Year Member
Posts: 232
Reputation Power: 8
Finally, i got it. There is no need for the last end. Thanks for your input.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.