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

little lost on program

Started by polarbeefy, 16 August 2014 - 11:27 PM
polarbeefy #1
Posted 17 August 2014 - 01:27 AM
So I'm a little lost… My first effort in trying to play with computercraft and the turtle is not working with me.

The pastebin i am working with is 7bjsWxtR

line specificly is line 8 stating

data = a.getAspects()

I have set up the aspectalizer and chest correlating with the turtle but comes up with error
catalogue:8: attempt to index ? (a nil value)

I then attempt to put direction and it comes up with same error… please help !!

:)/>

—–Polarbeefy—-
hilburn #2
Posted 17 August 2014 - 02:17 AM
Basically it's just saying that the aspectalyzer doesn't have that method, try calling listMethods() or getMethods() to see what is available, it might be something silly like it's getAspect() rather than getAspects()
Lyqyd #3
Posted 17 August 2014 - 03:31 AM
The correct call is peripheral.getMethods("side"), replacing side with the correct side/peripheral name. Easiest to view with a one-liner like this in the Lua prompt:


textutils.pagedTabulate(peripheral.getMethods("side"))

The listMethods function shouldn't even exist. It only serves to encourage bad practices.
Bomb Bloke #4
Posted 17 August 2014 - 03:36 AM
Basically it's just saying that the aspectalyzer doesn't have that method,

That'd produce an "attempt to call nil" error. The indexing error means that the peripheral wasn't wrapped correctly in the first place. This probably means that whatever version of OpenPeripheral is active doesn't support the "aspectalizer", but it could also mean it isn't below the computer.