This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
m_bence's profile picture

cocoa:20: attempt to call nil

Started by m_bence, 27 September 2013 - 02:33 PM
m_bence #1
Posted 27 September 2013 - 04:33 PM
I'm new to CC2 and i don't really know whats wrog with it. Every time i run it I get a cocoa:20: attempt to call nill error.


while true do
  turtle.select(1)
  turtle.place(1)
  sleep(1)
  turtle.select(2)
  turtle.place(2)
  sleep(1)
  turtle.dig()
  turtle.select(3)
  turtle.transferTo(1)
  turtle.select(3)
  turtle.turnRight()
  turtle.drop()
  turtle.turnLeft()
  turtle.turnLeft()
  turtle.select(2)
  turtle.suck(1)
  turtle.select(3)
  turtle.drop()
  turtle.turnRigh(1)
end

I know it's ugly and it can be more compact:D but I don't know how to do it:D.

Thanks in forward!
Lyqyd #2
Posted 27 September 2013 - 09:06 PM
Split into new topic.

turtle.turnRigh() doesn't exist. Use turtle.turnRight() instead.
m_bence #3
Posted 28 September 2013 - 02:35 AM
Only the missing "t" was the problem?
Zudo #4
Posted 28 September 2013 - 03:14 AM
Only the missing "t" was the problem?

Yes.
m_bence #5
Posted 28 September 2013 - 03:20 AM
Only the missing "t" was the problem?

Yes.

Thanks!