I'm very new to Lua. Could someone with knowledge of basic programs and the arguments for Computronics' Light Board rack component tell me how to make a simple program?
The program should be able to:
Set the color of the lights (with the light.setColor function)
Set the activity state of the lights (with the light.setActive function)
Specify which of the four racks to adjust these values in (unsure of function name)
Do all of this from the command line, with a set of arguments after the lua script's name (ideally in the format of, for example "light (1) (0xCCFF00) (3)"
I'm not sure of how to view the various functions associated with component.light_board as the Computronics documentation is apparently offline (wiki.vex.tty.sh has not been responding for at least the last few days).
This is the code I was using-- understandably, not working, as it's Frankensteined from my little knowledge and a different script I found and very little knowledge of how to make a program take arguments. (When I used ColorSet(3,0x33333), it did work-- essentially setting the input manually and re-compiling the script again and again)
component = require("component")
event = require("event")
term = require("term")
serialization = require("serialization")
local shell = require("shell")
local args, options = shell.parse(...)
gpu = component.gpu
light = component.light_board
function ColorSet (index,color)
light.setColor(index,color)
light.setActive(index,true)
end
ColorSet((arg1),(arg2))
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
I'm very new to Lua. Could someone with knowledge of basic programs and the arguments for Computronics' Light Board rack component tell me how to make a simple program?
The program should be able to:
I'm not sure of how to view the various functions associated with component.light_board as the Computronics documentation is apparently offline (wiki.vex.tty.sh has not been responding for at least the last few days).
This is the code I was using-- understandably, not working, as it's Frankensteined from my little knowledge and a different script I found and very little knowledge of how to make a program take arguments. (When I used ColorSet(3,0x33333), it did work-- essentially setting the input manually and re-compiling the script again and again)
component = require("component") event = require("event") term = require("term") serialization = require("serialization") local shell = require("shell") local args, options = shell.parse(...) gpu = component.gpu light = component.light_board function ColorSet (index,color) light.setColor(index,color) light.setActive(index,true) end ColorSet((arg1),(arg2))
Link to post
Share on other sites