.
This commit is contained in:
parent
d358c7004d
commit
731e6d4b40
@ -7,14 +7,14 @@ local color = "off"
|
|||||||
os.pullEvent = os.pullEventRaw
|
os.pullEvent = os.pullEventRaw
|
||||||
|
|
||||||
--[[Menu Methods]]--
|
--[[Menu Methods]]--
|
||||||
function Choice1()
|
function Who()
|
||||||
term.clear()
|
term.clear()
|
||||||
term.setCursorPos(1,1)
|
term.setCursorPos(1,1)
|
||||||
term.write("chuj")
|
term.write("chuj")
|
||||||
sleep(3)
|
sleep(3)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Choice2()
|
function LightSystem()
|
||||||
selectedItem = 1
|
selectedItem = 1
|
||||||
inLightsMenu=true
|
inLightsMenu=true
|
||||||
while inLightsMenu do
|
while inLightsMenu do
|
||||||
@ -42,8 +42,7 @@ function LightsBack()
|
|||||||
selectedItem = 1
|
selectedItem = 1
|
||||||
end
|
end
|
||||||
function AllOff()
|
function AllOff()
|
||||||
lightSystem("off", "white")
|
lightSystem("off", "both")
|
||||||
lightSystem("off", "red")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Snake()
|
function Snake()
|
||||||
@ -74,8 +73,8 @@ end
|
|||||||
|
|
||||||
--[[Menu Definitions]]--
|
--[[Menu Definitions]]--
|
||||||
mainMenu = {
|
mainMenu = {
|
||||||
[1] = { text = "Who amI?",handler=Choice1 },
|
[1] = { text = "Who amI?",handler=Who },
|
||||||
[2] = { text = "Light Controls",handler=Choice2 },
|
[2] = { text = "Light Controls",handler=LightSystem },
|
||||||
[3] = { text = "Snake",handler=Snake },
|
[3] = { text = "Snake",handler=Snake },
|
||||||
[4] = { text = "Edit program",handler=Edit },
|
[4] = { text = "Edit program",handler=Edit },
|
||||||
[5] = { text = "Console",handler=Console },
|
[5] = { text = "Console",handler=Console },
|
||||||
@ -83,11 +82,11 @@ mainMenu = {
|
|||||||
[7] = { text = "Exit",handler=Exit }
|
[7] = { text = "Exit",handler=Exit }
|
||||||
}
|
}
|
||||||
lightsMenu={
|
lightsMenu={
|
||||||
[1]= { text="Lights On", handler=LightsOn},
|
[1]= { text="Lights On", handler=On},
|
||||||
[2]= { text="Alarm On", handler=AlarmOn},
|
[2]= { text="Alarm On", handler=On},
|
||||||
[3]= { text="Lights Off", handler=LOff},
|
[3]= { text="Lights Off", handler=Off},
|
||||||
[4]= { text="Alarm Off", handler=AOff},
|
[4]= { text="Alarm Off", handler=Off},
|
||||||
[5]= { text="All Off", handler=AllOff},
|
[5]= { text="All Off", handler=Off},
|
||||||
[6]= { text="Back", handler=LightsBack}
|
[6]= { text="Back", handler=LightsBack}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +180,9 @@ function lightSystem( op, type )
|
|||||||
redstone.setBundledOutput("top", colors.white)
|
redstone.setBundledOutput("top", colors.white)
|
||||||
color = "white"
|
color = "white"
|
||||||
end
|
end
|
||||||
|
elseif type == "both" then
|
||||||
|
rs.setBundledOutput("top", 0)
|
||||||
|
color = "off"
|
||||||
end
|
end
|
||||||
else error("Light system error you tried to: Turn " .. op .. " color " .. type .. " when the state of color in memory is: " .. color)
|
else error("Light system error you tried to: Turn " .. op .. " color " .. type .. " when the state of color in memory is: " .. color)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user