Jump to content




Attempt to call nil error


3 replies to this topic

#1 xebryus

  • New Members
  • 2 posts

Posted 29 June 2016 - 12:51 AM

Hey Guys,

I'm trying to use code I found off of an imgur page. All I'm really trying to do is make lights in my house illuminate when I walk down the stairs.

Here is the pastebin where the code is: http://pastebin.com/N5TgZh0x

After booting it up, I'm getting the "'program':17: attempt to call nil"

I'm trying to find the issue, but can't seem to for the life of me. Any help is appreciated. Thanks!

#2 eniallator

  • Members
  • 56 posts

Posted 29 June 2016 - 09:47 AM

it seems like it needs an open peripheral's sensor block to the left of the computer, do you have one there?

#3 xebryus

  • New Members
  • 2 posts

Posted 29 June 2016 - 02:02 PM

View Posteniallator, on 29 June 2016 - 09:47 AM, said:

it seems like it needs an open peripheral's sensor block to the left of the computer, do you have one there?

Yeah I messed with the config to suite where I have the sensor. Sensor I set to right and red stone conduit bottom. What's odd is that when I get the error, the red stone signal stays on permanently no matter my player location as well.

#4 Bomb Bloke

    Hobbyist Coder

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

Posted 30 June 2016 - 02:22 AM

View Postxebryus, on 29 June 2016 - 02:02 PM, said:

What's odd is that when I get the error, the red stone signal stays on permanently no matter my player location as well.

That suggests you meant line 27, not 17.

Either way you're trying to call a function that doesn't actually exist. All your ComputerCraft calls check out as ok, so it'll be one of the OpenPeripheral sensor functions that isn't present (likely because the function names tend to change depending on the version of OpenPeripheral you're using).

You can probably use this to help you confirm the correct usage of your sensor.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users