- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
TheWildDefender
-
Content Count
2 -
Joined
-
Last visited
Posts posted by TheWildDefender
-
-
I was trying to make a computer program to control a BigReactor turbine (I'll use a microcontroller after I figure this out). I know that the computer port acts as a component, so first of all, to increase the convenience of access of the computer port, I wrote
local turbine = component.proxy(component.get("5e7"))
That was the very first line of the program; 5e7 is the shortened address of the computer port. There is a bunch more code at the bottom that does the actual regulating, but when I run the program, it spits out this error message:
/home/turbine_control:1: attempt to index global 'component' (a nil value): stack traceback: /home/turbine_control:1: in main chunk: (...tail calls...) [C]: in function 'xpcall' machine:751: in function 'xpcall' /lib/process.lua:94: in function </lib/process.lua:90>
Greatly confused, I read the message. I interpreted it as in line one of my program, turbine_control, I am accessing the undefined variable 'component'. I don't know what this completely means, and I even checked the process.lua function and coming out with no idea what was going on. I can call the function in the interactive lua prompt with no problem, but in a program, it doesn't let me.
What's going on, and how can I fix this?
Can't access components
in Programming
Posted
Thank
you
so
much.
It worked. Also, thanks for the quick answer.