Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this loads the varible
- local iConfig = nil
- local sName = "config"
- local sBundelSide = "back"
- local function save(sInput)
- local file = io.open(sName,"w")
- file:write(tostring(sInput))
- file:close()
- end
- local function AddOutput(sSide, ...)
- local c = colors.combine(rs.getBundledOutput(sSide), ...)
- rs.setBundledOutput(sSide, c)
- save(c)
- end
- local function RemoveOutput(sSide, ...)
- local c = colors.subtract(rs.getBundledOutput(sSide), ...)
- rs.setBundledOutput(sSide, c)
- save(c)
- end
- if fs.exists(sName) then
- print("Loading config")
- file = io.open(sName,"r")
- iConfig = tonumber(file:read())
- print(iConfig)
- file:close()
- print("Config loaded")
- else
- print("No config")
- iConfig = 0
- end
- print(iConfig)
- rs.setBundledOutput(sBundelSide,iConfig) -- this sets it as the output
- sleep(1) -- gives time for output to change
- -- end
- local x1 = nil -- resets x1
- while x1 ~= "consol" do
- save(rs.getBundledOutput(sBundelSide)) -- saves eveery tiem you return to main menu
- term.clear()
- print("-------------------------------------------")
- print("----------------Main menu:-----------------")
- print("-------------------------------------------")
- print("Options:")
- print("-------------------------------------------")
- print("Querry")
- if rs.testBundledInput("back", colors.lime ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("OilPump")
- if rs.testBundledInput("back", colors.pink ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("Cooling")
- if rs.testBundledInput("back", colors.gray ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("Security")
- if rs.testBundledInput("back", colors.lightGray ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("MobFarm")
- if rs.testBundledInput("back", colors.cyan ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("Consol")
- print("-------------------------------------------")
- write("Enter menu command: ")
- x1 = io.read()
- x2 = nil -- these reset the system
- x3 = nil
- x4 = nil
- x5 = nil
- x6 = nil
- if x1 == "querry" then
- while x2 ~= "back" do
- term.clear()
- print("-------------------------------------------")
- print("----------------Querry menu:---------------")
- print("-------------------------------------------")
- if rs.testBundledInput("back", colors.lime ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("To turn Querry on, type on.")
- print("To turn Querry off, type off.")
- print("To get back to the main menu, type back.")
- print("-------------------------------------------")
- write("Enter querry command: ")
- x2 = io.read()
- if x2 == "on" then
- AddOutput("back", colors.white )
- term.clear()
- print("------------------------------------------")
- print("The querry is now on.")
- print("------------------------------------------")
- sleep(1)
- elseif x2 == "off" then
- RemoveOutput("back", colors.white )
- print("------------------------------------------")
- print("The querry is now off.")
- print("------------------------------------------")
- sleep(1)
- end -- if x2 = on/off
- end -- while x2
- end -- if Querry
- if x1 == "oilpump" then
- while x3 ~= "back" do
- term.clear()
- print("-------------------------------------------")
- print("---------------Oilpump menu:---------------")
- print("-------------------------------------------")
- if rs.testBundledInput("back", colors.pink ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("To turn on the oilpumps, type on.")
- print("To turn off the oilpumps, type off.")
- print("To get back to the main menu, type back.")
- print("-------------------------------------------")
- write("Enter oilpump command: ")
- x3 = io.read()
- if x3 == "on" then
- AddOutput("back", colors.orange )
- term.clear()
- print("------------------------------------------")
- print("The oilpumps are now on.")
- print("------------------------------------------")
- sleep(1)
- elseif x3 == "off" then
- RemoveOutput("back", colors.orange )
- term.clear()
- print("------------------------------------------")
- print("The oilpumps are now off.")
- print("------------------------------------------")
- sleep(1)
- end -- if x3 = on/off
- end -- while x3
- end -- if oilpumps
- if x1 == "cooling" then
- while x4 ~= "back" do
- term.clear()
- print("-------------------------------------------")
- print("---------------Cooling menu:---------------")
- print("-------------------------------------------")
- if rs.testBundledInput("back", colors.gray ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("To turn on the Cooling, type on.")
- print("To turn off the Cooling, type off.")
- print("To get back to the main menu, type back.")
- print("-------------------------------------------")
- write("Enter Cooling command: ")
- x4 = io.read()
- if x4 == "on" then
- AddOutput("back", colors.magenta )
- term.clear()
- print("------------------------------------------")
- print("The cooling is now on.")
- print("------------------------------------------")
- sleep(1)
- elseif x4 == "off" then
- RemoveOutput("back", colors.magenta )
- term.clear()
- print("------------------------------------------")
- print("The Cooling is now off.")
- print("------------------------------------------")
- sleep(1)
- end -- if x4 = on/off
- end -- while x4
- end -- if Cooling
- if x1 == "security" then
- while x5 ~= "back" do
- term.clear()
- print("-------------------------------------------")
- print("---------------Security menu:--------------")
- print("-------------------------------------------")
- if rs.testBundledInput("back", colors.lightGray ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("To turn security on, type on.")
- print("To turn security off, type off.")
- print("To get back to the main menu, type back.")
- print("-------------------------------------------")
- write("Enter security command: ")
- x5 = io.read()
- if x5 == "on" then
- AddOutput("back", colors.lightBlue )
- term.clear()
- print("------------------------------------------")
- print("The security is now on.")
- print("------------------------------------------")
- sleep(1)
- elseif x5 == "off" then
- RemoveOutput("back", colors.lightBlue )
- term.clear()
- print("------------------------------------------")
- print("The security is now off.")
- print("------------------------------------------")
- sleep(1)
- end -- if x5 = on/off
- end -- while x5
- end -- if security
- if x1 == "mobfarm" then
- while x6 ~= "back" do
- term.clear()
- print("-------------------------------------------")
- print("---------------MobFarm menu:---------------")
- print("-------------------------------------------")
- if rs.testBundledInput("back", colors.cyan ) == true then
- print("Status: Online")
- else
- print("Status: Offline")
- end
- print("To turn on the Mob farm, type on.")
- print("To turn off the Mob farm, type off.")
- print("To get back to the main menu, type back.")
- print("-------------------------------------------")
- write("Enter command: ")
- x6 = io.read()
- if x6 == "on" then
- AddOutput("back", colors.yellow )
- term.clear()
- print("------------------------------------------")
- print("The Mob farm is now on.")
- print("------------------------------------------")
- sleep(1)
- elseif x6 == "off" then
- RemoveOutput("back", colors.yellow )
- term.clear()
- print("------------------------------------------")
- print("The Mob farm is now off.")
- print("------------------------------------------")
- sleep(1)
- end -- if x6 = on/off
- end -- while x6
- end -- if modfarm
- end -- Main end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement