Posted 06 April 2012 - 03:18 AM
Hey there.
So, yesterday I decided to take up CC and lua, though as I'm still new to it all, I have a hard time googling everything, as I dont even know what to google for :/
Anyway, I'm building a tiny test system to evolve my skill base on.
Basicly, I've added 2 levers, and 4 lights, 1 lever pr 2 lights. on/off.
However, the lights are flashing, and I do not know how to "lock" each light and keep 2 active at the same time.
Heres my code:
pastebin
event, param = os.pullEvent()
if event == "redstone" and rs.testBundledInput("front", colors.white) == true then
rs.setBundledOutput("back", colors.green)
term.clear()
term.setCursorPos(1,1)
print("..Green light on - Lever on (white index)")
elseif rs.testBundledInput("front", colors.white) == false then
rs.setBundledOutput("back", colors.lime)
term.clear()
term.setCursorPos(1,1)
print("..Lime light on - Lever off")
end
event, param = os.pullEvent()
if event == "redstone" and rs.testBundledInput("front", colors.blue) == true then
rs.setBundledOutput("back", colors.red)
term.clear()
term.setCursorPos(1,1)
print("..Red light on - Lever on (blue index)")
elseif rs.testBundledInput("front", colors.blue) == false then
rs.setBundledOutput("back", colors.gray)
term.clear()
term.setCursorPos(1,1)
print("..Gray light on - Lever off")
end
end
Hope you guys can help me :)/>/>
best regard
kaffe
So, yesterday I decided to take up CC and lua, though as I'm still new to it all, I have a hard time googling everything, as I dont even know what to google for :/
Anyway, I'm building a tiny test system to evolve my skill base on.
Basicly, I've added 2 levers, and 4 lights, 1 lever pr 2 lights. on/off.
However, the lights are flashing, and I do not know how to "lock" each light and keep 2 active at the same time.
Heres my code:
pastebin
Spoiler
while true doevent, param = os.pullEvent()
if event == "redstone" and rs.testBundledInput("front", colors.white) == true then
rs.setBundledOutput("back", colors.green)
term.clear()
term.setCursorPos(1,1)
print("..Green light on - Lever on (white index)")
elseif rs.testBundledInput("front", colors.white) == false then
rs.setBundledOutput("back", colors.lime)
term.clear()
term.setCursorPos(1,1)
print("..Lime light on - Lever off")
end
event, param = os.pullEvent()
if event == "redstone" and rs.testBundledInput("front", colors.blue) == true then
rs.setBundledOutput("back", colors.red)
term.clear()
term.setCursorPos(1,1)
print("..Red light on - Lever on (blue index)")
elseif rs.testBundledInput("front", colors.blue) == false then
rs.setBundledOutput("back", colors.gray)
term.clear()
term.setCursorPos(1,1)
print("..Gray light on - Lever off")
end
end
Hope you guys can help me :)/>/>
best regard
kaffe