Jump to content




Bug with my program

turtle lua command

9 replies to this topic

#1 tutedutsch

  • New Members
  • 2 posts

Posted 30 November 2015 - 06:48 PM

Hello,

I have a problem with my own written program.
I always get the message:" Tute:1: attempt to index ? (a nil value) " but I can´t find a mistake.

Here is the pastebin program link: http://pastebin.com/UxSXS3Ra

Thanks for your help

#2 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 30 November 2015 - 07:20 PM

so, from what i can see, there is nothing wrong :/ what i'd do in this situation is just remove it, then run the code, and then to attempt to put it in afterwards.

I don't think that this is a verson error as i could use turtle.select back in tekkit classic.

#3 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 30 November 2015 - 07:30 PM

If the program you show is Tute (shouldn't in be turtle?), then it means that turtle is actually nil. (strange)

#4 RoD

  • Members
  • 313 posts

Posted 30 November 2015 - 07:32 PM

Are you sure you are using a turtle? Or are you just coding on a normal pc?

#5 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 30 November 2015 - 07:34 PM

are you running on a turtle? the turtle API is only available on turtles.

edit: :ph34r:

Edited by Lupus590, 30 November 2015 - 07:35 PM.


#6 tutedutsch

  • New Members
  • 2 posts

Posted 30 November 2015 - 07:37 PM

View PostRoD, on 30 November 2015 - 07:32 PM, said:

Are you sure you are using a turtle? Or are you just coding on a normal pc?

That was the mistake I use a normal pc, now it work.
Thank you

#7 RoD

  • Members
  • 313 posts

Posted 01 December 2015 - 06:08 PM

View PostCreator, on 30 November 2015 - 07:30 PM, said:

If the program you show is Tute (shouldn't in be turtle?), then it means that turtle is actually nil. (strange)

The program name has nothing to do with the turtle api.

#8 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 01 December 2015 - 10:26 PM

View PostRoD, on 01 December 2015 - 06:08 PM, said:

The program name has nothing to do with the turtle api.

It does when the first line of the posted script attempts to index into the turtle table, and the error calls that impossible. Creator was suggesting tutedutsch had the wrong file, as it's not often people make the mistake of trying to run turtle code on a non-turtle.

Edited by Bomb Bloke, 01 December 2015 - 10:26 PM.


#9 RoD

  • Members
  • 313 posts

Posted 02 December 2015 - 03:38 AM

How so it does? I am really not getting how a program name and an api can have anything to do with each other, other than if the api name was renamed to "tute" in this case.

#10 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 December 2015 - 03:46 AM

Error:

Tute:1: attempt to index ? (a nil value)

Line 1 of posted script:

turtle.select(1)

Therefore, if the posted script is "Tute", then "turtle" is nil... which turned out to be exactly the case.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users