This is the LUA code, its sloppy but decent for my second script I'd say… http://pastebin.com/1gM9akVj
If you need anything cleared up please ask, its hard to explain/it makes sense to me.
Thanks!
PS. I messed up the topic, my apologies.
C1 -> [bundle]
C2 -> [bundle]
...
C5 -> [bundle]
F1 <- [bundle]
F2 <- [bundle]
...
F5 <- [bundle]
function menu()
...
user=io.read()
...
end
function menuselect()
...
if user == "1" then
...
end
2) Using globals everywhere (this doesn't make it hard to read, but makes it more likely to introduce bugs)
local event, par1, par2 = os.pullEvent("rednet_message")
if par2 == "harvest1on" then
c = colors.combine(c, colors.red )
rs.setBundledOutput(sSide, c )
sleep (0.25)
rednet.broadcast( "harvest1on" )
elseif par2 == "harvest1off" then
c = colors.subtract(c, colors.red )
rs.setBundledOutput(sSide, c )
sleep (0.25)
rednet.broadcast( "harvest1off" )
end
local event, k1, k2 = os.pullEvent()
if event == "key" then
if k1 == 2 or k1 == 79 then
term.clear()
term.setCursorPos(1,7)
textutils.slowPrint "Turning Tunnel #1 Harvester On..."
sleep (1)
rednet.send( 14 , "harvest1on" )
elseif k1 == 3 or k1 == 80 then
term.clear()
term.setCursorPos(1,7)
textutils.slowPrint "Turning Tunnel #1 Harvester Off..."
sleep (2)
rednet.send( 14 , "harvest1off" )
end
elseif event == "rednet_message" then
if k2 == "harvest1on" then
harv1 = ("true") -- used in the status display in my menu
elseif k2 == "harvest1off" then
harv1 = ("false") -- used in the status display in my menu
end
end