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

portal:17: attempt to index ? (a nil value)

Started by MiTurner, 19 August 2013 - 06:45 PM
MiTurner #1
Posted 19 August 2013 - 08:45 PM
I am using the Direwolf20 1.5 pack and trying to recreate a computerized NEXUS portal that he made in his season 5 SMP. I have set up the pipes and turtles and everything correctly and made sure my peripherals were correct in his coding but when I go to run the program, it says, "File Not Found" and then right under it, "portal:17: attempt to index ? (a nil value)". I am bit of an amateur when it comes to lua. Line 17 has the command "button.clearTable()" which I'm understanding is correct. I will give you links to a pastebin with the turtle's coding, and the computer's coding along with the button API he made. If you could help me, I would greatly appreciate it! The Portal Program: http://www.pastebin.com/7qABHUpv The Button API: http://www.pastebin.com/DsRxJLt1 The Turtle Program: http://www.pastebin.com/UnCJE27P The Video where Direwolf20 made the NEXUS Portal: [media]http://www.youtube.com/watch?v=wmDiRLv3H4o[/media]
Lyqyd #2
Posted 20 August 2013 - 01:08 AM
Split into new topic.

Looks like you don't load up the API. Try using os.loadAPI("button") at the beginning of your script.

Also, it's tangentially related, but if you run into trouble with the DW20 button API, you might take a look at touchpoint. It's designed a bit better, and the DW20 button API is somewhat frowned upon around here.
LBPHacker #3
Posted 20 August 2013 - 03:39 AM
File not found: because on line 1, os.loadAPI tries to load a file named "bottom", which should be "button".
Attempt to index ?: because button is nil (since os.loadAPI didn't load the button API)
Last1Here #4
Posted 20 August 2013 - 09:51 PM
the API you are trying to load is here: pastebin or run


pastebin get 1iwuzsh8 button