MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 431 forks source link

cannot use component.redstone.setOutput(sides.front, 15) in a program #2144

Closed mojo123410 closed 7 years ago

mojo123410 commented 7 years ago

when in the lua interrupter it works fine and I can even set a variable to it but when using it inside of a program it gives me the response

error

Vexatos commented 7 years ago

Looks like you forgot to load the component library.

local component = require("component")
local sides = require("sides")
component.redstone.setOutput(sides.front, 15)

This is being done automatically in the lua interpreter, so it's not necessary there.

mojo123410 commented 7 years ago

thank you I am new to lua programing and I was completely stumped because I have not found much documentation on coding in open computers

Vexatos commented 7 years ago

This is more or less standard Lua behaviour. Check out the manual (or the Lua 5.3 version).

mojo123410 commented 7 years ago

thank you I will