Jump to content




help with turtle program


  • You cannot reply to this topic
7 replies to this topic

#1 tdog21

  • Members
  • 5 posts

Posted 26 July 2012 - 10:55 PM

my code:

while false do
if turtle.detect() then
turtle.forward()
turtle.drop(1)
turtle.forward()
turtle.drop(1)
turtle.forward
turtle.drop(1)
turtle.turnleft
end
end



and my error:

bios:206: [string "cookieparty"]:4: unexpected symbol --i got a fix for this now i have this error

bios:206 [string "cookieparty"]:8: '=' expected

same error as above accept the 8 is a 10


im trying tomake my turtle move forward and drop an item three times then turn left endlessly any help is apreciated and if i need to add anything to the code for it to work properly please let me know

#2 brett122798

  • Members
  • 300 posts
  • LocationIn the TARDIS at an unknown place in time.

Posted 26 July 2012 - 11:01 PM

I don't think you need brackets.

while false do
if turtle.detect then
turtle.forward()
turtle.drop(1)
turtle.forward()
turtle.drop(1)
turtle.forward
turtle.drop(1)
turtle.turnleft
end
end


#3 tdog21

  • Members
  • 5 posts

Posted 26 July 2012 - 11:06 PM

ok i'll try it thanks

EDIT

ok i just tried that code above and got this error i really don't understand the errors

bios:206 [string "cookieparty"]:8: '=' expected

#4 brett122798

  • Members
  • 300 posts
  • LocationIn the TARDIS at an unknown place in time.

Posted 26 July 2012 - 11:14 PM

View Posttdog21, on 26 July 2012 - 11:06 PM, said:

ok i'll try it thanks

EDIT

ok i just tried that code above and got this error i really don't understand the errors

bios:206 [string "cookieparty"]:8: '=' expected
I don't understand turtles very much, I have no clue why the error would be saying that. All I know is, you fixed your first problem. Better edit your post to explain this problem.

EDIT: WAIT! Found it. Here:

while false do
if turtle.detect then
turtle.forward()
turtle.drop(1)
turtle.forward()
turtle.drop(1)
turtle.forward()
turtle.drop(1)
turtle.turnleft()
end
end


#5 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 26 July 2012 - 11:15 PM

if turtle.detect() then

#6 brett122798

  • Members
  • 300 posts
  • LocationIn the TARDIS at an unknown place in time.

Posted 26 July 2012 - 11:17 PM

View PostNoodle, on 26 July 2012 - 11:15 PM, said:

if turtle.detect() then
I don't think that's the error, but I found 2 more errors, just edited my last post.

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 27 July 2012 - 12:11 AM

The L in turtle.turnLeft needs to be capitalized.

#8 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 27 July 2012 - 12:22 AM

To new coders: get used to camelCasing.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users