From 8717798bd7d4b348c9600237767c67e3f19447b7 Mon Sep 17 00:00:00 2001 From: ZareMate Date: Wed, 1 Jun 2022 19:26:15 +0200 Subject: [PATCH] . --- main/startup.lua | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/main/startup.lua b/main/startup.lua index 5f50b41..69445c9 100644 --- a/main/startup.lua +++ b/main/startup.lua @@ -4,7 +4,7 @@ local selectedItem = 1 local inMainMenu = true local inLightsMenu = false local color = "off" - +os.pullEvent = os.pullEventRaw --[[Menu Methods]]-- function Choice1() @@ -52,6 +52,8 @@ end function Edit() inMainMenu = false + shell.run("edit "..shell.getRunningProgram()) + os.reboot() end function Reboot() @@ -131,7 +133,19 @@ function lightSystem( op, type ) elseif color == "red" and op == "on" and type == "white" then redstone.setBundledOutput("top", colors.white + colors.red) color = "both" ---[[Off functions]]-- + elseif color == "white" and op == "on" and type == "white" then + redstone.setBundledOutput("top", colors.white) + color = "white" + elseif color == "red" and op == "on" and type == "red" then + redstone.setBundledOutput("top", colors.red) + color = "red" + elseif color == "both" and op == "on" and type == "white" then + redstone.setBundledOutput("top", colors.white + colors.red) + color = "both" + elseif color == "both" and op == "on" and type == "red" then + redstone.setBundledOutput("top", colors.white + colors.red) + color = "both" + elseif color == "both" and op == "off" and type == "white" then redstone.setBundledOutput("top", colors.red) color = "red" @@ -144,7 +158,19 @@ function lightSystem( op, type ) elseif color == "red" and op == "off" and type == "red" then redstone.setBundledOutput("top", 0) color = "off" - else error("Light system error " .. op .. " " .. type .. " " .. color) + elseif color == "off" and op == "off" and type == "white" then + redstone.setBundledOutput("top", 0) + color = "off" + elseif color == "off" and op == "off" and type == "red" then + redstone.setBundledOutput("top", 0) + color = "off" + elseif color == "white" and op == "off" and type == "red" then + redstone.setBundledOutput("top", colors.white) + color = "white" + elseif color == "red" and op == "off" and type == "white" then + redstone.setBundledOutput("top", colors.red) + color = "red" + else error("Light system error you tried to: Turn " .. op .. " color " .. type .. " when the state of color in memory is: " .. color) end inLightsMenu = false selectedItem = 1