Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oldPull = os.pullEvent;
- os.pullEvent = os.pullEventRaw;
- -- FrekSystem Computer
- -- pastebin get e99GHzb9 disk/startup
- -- pastebin get nW0L33Tp disk/ComputerSoftware
- function powerRedstone()
- local up = ""
- local down = ""
- local back = ""
- local front = ""
- local right = ""
- local left = ""
- file = io.open("FrekSystem/Redstone/left", "r")
- left = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/right", "r")
- right = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "r")
- down = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/top", "r")
- up = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/front", "r")
- front = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/back", "r")
- back = file:read()
- file:close()
- if left == "false" then
- redstone.setOutput("left", false)
- else
- redstone.setOutput("left", true)
- end
- if right == "false" then
- redstone.setOutput("right", false)
- else
- redstone.setOutput("right", true)
- end
- if down == "false" then
- redstone.setOutput("bottom", false)
- else
- redstone.setOutput("bottom", true)
- end
- if up == "false" then
- redstone.setOutput("top", false)
- else
- redstone.setOutput("top", true)
- end
- if back == "false" then
- redstone.setOutput("back", false)
- else
- redstone.setOutput("back", true)
- end
- if front == "false" then
- redstone.setOutput("front", false)
- else
- redstone.setOutput("front", true)
- end
- end
- function powered()
- if fs.exists("FrekSystem/Redstone/CurrentSide") == true then
- local variable = ""
- local selectedSide = ""
- file = io.open("FrekSystem/Redstone/CurrentSide", "r")
- selectedSide = file:read()
- file:close()
- local path = "FrekSystem/Redstone/" .. selectedSide
- file = io.open(path, "r")
- variable = file:read()
- file:close()
- if variable == "true" then
- if selectedSide == "left" then
- redstone.setOutput("left", true)
- end
- if selectedSide == "right" then
- redstone.setOutput("right", true)
- end
- if selectedSide == "top" then
- redstone.setOutput("top", true)
- end
- if selectedSide == "bottom" then
- redstone.setOutput("bottom", true)
- end
- if selectedSide == "back" then
- redstone.setOutput("back", true)
- end
- if selectedSide == "front" then
- redstone.setOutput("front", true)
- end
- else
- if selectedSide == "left" then
- redstone.setOutput("left", false)
- end
- if selectedSide == "right" then
- redstone.setOutput("right", false)
- end
- if selectedSide == "top" then
- redstone.setOutput("top", false)
- end
- if selectedSide == "bottom" then
- redstone.setOutput("bottom", false)
- end
- if selectedSide == "back" then
- redstone.setOutput("back", false)
- end
- if selectedSide == "front" then
- redstone.setOutput("front", false)
- end
- end
- end
- end
- function fixBugs()
- fs.makeDir("FrekSystem/UserData")
- fs.makeDir("FrekSystem/Redstone")
- if fs.exists("FrekSystem/Redstone/left") then
- else
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write(false)
- file:close()
- end
- if fs.exists("FrekSystem/Redstone/right") then
- else
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write(false)
- file:close()
- end
- if fs.exists("FrekSystem/Redstone/top") then
- else
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write(false)
- file:close()
- end
- if fs.exists("FrekSystem/Redstone/back") then
- else
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write(false)
- file:close()
- end
- if fs.exists("FrekSystem/Redstone/front") then
- else
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write(false)
- file:close()
- end
- if fs.exists("FrekSystem/Redstone/bottom") then
- else
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write(false)
- file:close()
- end
- end
- function redstones()
- local selectedSide = ""
- local variable = ""
- file = io.open("FrekSystem/Redstone/CurrentSide", "r")
- selectedSide = file:read()
- file:close()
- local path = "FrekSystem/Redstone/" .. selectedSide
- file = io.open(path, "r")
- variable = file:read()
- file:close()
- if fs.exists(path) == true then
- local variable = ""
- file = io.open(path, "r")
- variable = file:read()
- file:close()
- if variable == "false" then
- file = io.open(path, "w")
- file:write("true")
- file:close()
- else
- file = io.open(path, "w")
- file:write(false)
- file:close()
- end
- else
- fs.makeDir("FrekSystem/Redstone")
- file = io.open(path, "w")
- file:write(false)
- file:close()
- end
- file = io.open(path, "r")
- variable = file:read()
- file:close()
- print("Redstone side '" .. selectedSide .. "' is now set to: " .. variable)
- CommandHandler()
- end
- function CommandHandler()
- powerRedstone()
- local command = ""
- local usedCommand = ""
- write("Command: ")
- command = read()
- usedCommand = "Used Command: " .. command
- term.clear()
- term.setCursorPos(1,1)
- print("[-------------------------------------------------]")
- print("[- FrekSystem V.1.0.0 -]")
- print("[-------------------------------------------------]")
- if command == "help" then
- print("help - shows this")
- print("computer - shows a list of computer commands")
- print("return - returns you to normal computer")
- print("user - shows a list of user commands")
- print("programs - shows a list of all programs")
- print("redstone - shows a list of redstone commands")
- Screen()
- elseif command == "redstone.left" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("left")
- file:close()
- redstones()
- elseif command == "redstone.right" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("right")
- file:close()
- redstones()
- elseif command == "redstone.back" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("back")
- file:close()
- redstones()
- elseif command == "redstone.down" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("bottom")
- file:close()
- redstones()
- elseif command == "redstone.up" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("top")
- file:close()
- redstones()
- elseif command == "redstone.front" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("front")
- file:close()
- redstones()
- elseif command == "redstone.l" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("left")
- file:close()
- redstones()
- elseif command == "redstone.r" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("right")
- file:close()
- redstones()
- elseif command == "redstone.b" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("back")
- file:close()
- redstones()
- elseif command == "redstone.d" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("bottom")
- file:close()
- redstones()
- elseif command == "redstone.u" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("top")
- file:close()
- redstones()
- elseif command == "redstone.f" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("front")
- file:close()
- redstones()
- elseif command == "redstone.allon" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("true")
- file:close()
- redstone.setOutput("back", true)
- redstone.setOutput("front", true)
- redstone.setOutput("top", true)
- redstone.setOutput("bottom", true)
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- CommandHandler()
- elseif command == "redstone.alloff" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("false")
- file:close()
- redstone.setOutput("back", false)
- redstone.setOutput("front", false)
- redstone.setOutput("top", false)
- redstone.setOutput("bottom", false)
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- CommandHandler()
- elseif command == "redstone.online" then
- print("Online redstone outputs:")
- local up = ""
- local down = ""
- local back = ""
- local front = ""
- local right = ""
- local left = ""
- file = io.open("FrekSystem/Redstone/left", "r")
- left = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/right", "r")
- right = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "r")
- down = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/top", "r")
- up = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/front", "r")
- front = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/back", "r")
- back = file:read()
- file:close()
- if up == "true" then
- print("- Redstone output 'up' is powered")
- end
- if down == "true" then
- print("- Redstone output 'down' is powered")
- end
- if front == "true" then
- print("- Redstone output 'front' is powered")
- end
- if back == "true" then
- print("- Redstone output 'back' is powered")
- end
- if right == "true" then
- print("- Redstone output 'right' is powered")
- end
- if left == "true" then
- print("- Redstone output 'left' is powered")
- end
- if left == "false" and right == "false" and down == "false" and up == "false" and front == "false" and back == "false" then
- print("- No redstone outputs are powered!")
- end
- if left == "true" and right == "true" and down == "true" and up == "true" and front == "true" and back == "true" then
- print("- All the redstone outputs are powered!")
- end
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "redstone.an" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("true")
- file:close()
- redstone.setOutput("back", true)
- redstone.setOutput("front", true)
- redstone.setOutput("top", true)
- redstone.setOutput("bottom", true)
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- CommandHandler()
- elseif command == "redstone.af" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("false")
- file:close()
- redstone.setOutput("back", false)
- redstone.setOutput("front", false)
- redstone.setOutput("top", false)
- redstone.setOutput("bottom", false)
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- CommandHandler()
- elseif command == "redstone.o" then
- print("Online redstone outputs:")
- local up = ""
- local down = ""
- local back = ""
- local front = ""
- local right = ""
- local left = ""
- file = io.open("FrekSystem/Redstone/left", "r")
- left = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/right", "r")
- right = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "r")
- down = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/top", "r")
- up = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/front", "r")
- front = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/back", "r")
- back = file:read()
- file:close()
- if up == "true" then
- print("- Redstone output 'up' is powered")
- end
- if down == "true" then
- print("- Redstone output 'down' is powered")
- end
- if front == "true" then
- print("- Redstone output 'front' is powered")
- end
- if back == "true" then
- print("- Redstone output 'back' is powered")
- end
- if right == "true" then
- print("- Redstone output 'right' is powered")
- end
- if left == "true" then
- print("- Redstone output 'left' is powered")
- end
- if left == "false" and right == "false" and down == "false" and up == "false" and front == "false" and back == "false" then
- print("- No redstone outputs are powered!")
- end
- if left == "true" and right == "true" and down == "true" and up == "true" and front == "true" and back == "true" then
- print("- All the redstone outputs are powered!")
- end
- print("[-------------------------------------------------]")
- CommandHandler()
- -- copy
- elseif command == "rs.left" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("left")
- file:close()
- redstones()
- elseif command == "rs.right" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("right")
- file:close()
- redstones()
- elseif command == "rs.back" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("back")
- file:close()
- redstones()
- elseif command == "rs.down" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("bottom")
- file:close()
- redstones()
- elseif command == "rs.up" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("top")
- file:close()
- redstones()
- elseif command == "rs.front" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("front")
- file:close()
- redstones()
- elseif command == "rs.l" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("left")
- file:close()
- redstones()
- elseif command == "rs.r" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("right")
- file:close()
- redstones()
- elseif command == "rs.b" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("back")
- file:close()
- redstones()
- elseif command == "rs.d" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("bottom")
- file:close()
- redstones()
- elseif command == "rs.u" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("top")
- file:close()
- redstones()
- elseif command == "rs.f" then
- file = io.open("FrekSystem/Redstone/CurrentSide", "w")
- file:write("front")
- file:close()
- redstones()
- elseif command == "rs.allon" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("true")
- file:close()
- redstone.setOutput("back", true)
- redstone.setOutput("front", true)
- redstone.setOutput("top", true)
- redstone.setOutput("bottom", true)
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- CommandHandler()
- elseif command == "rs.alloff" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("false")
- file:close()
- redstone.setOutput("back", false)
- redstone.setOutput("front", false)
- redstone.setOutput("top", false)
- redstone.setOutput("bottom", false)
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- CommandHandler()
- elseif command == "rs.online" then
- print("Online redstone outputs:")
- local up = ""
- local down = ""
- local back = ""
- local front = ""
- local right = ""
- local left = ""
- file = io.open("FrekSystem/Redstone/left", "r")
- left = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/right", "r")
- right = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "r")
- down = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/top", "r")
- up = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/front", "r")
- front = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/back", "r")
- back = file:read()
- file:close()
- if up == "true" then
- print("- Redstone output 'up' is powered")
- end
- if down == "true" then
- print("- Redstone output 'down' is powered")
- end
- if front == "true" then
- print("- Redstone output 'front' is powered")
- end
- if back == "true" then
- print("- Redstone output 'back' is powered")
- end
- if right == "true" then
- print("- Redstone output 'right' is powered")
- end
- if left == "true" then
- print("- Redstone output 'left' is powered")
- end
- if left == "false" and right == "false" and down == "false" and up == "false" and front == "false" and back == "false" then
- print("- No redstone outputs are powered!")
- end
- if left == "true" and right == "true" and down == "true" and up == "true" and front == "true" and back == "true" then
- print("- All the redstone outputs are powered!")
- end
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "rs.an" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("true")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("true")
- file:close()
- redstone.setOutput("back", true)
- redstone.setOutput("front", true)
- redstone.setOutput("top", true)
- redstone.setOutput("bottom", true)
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- CommandHandler()
- elseif command == "rs.af" then
- file = io.open("FrekSystem/Redstone/left", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/right", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/top", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/front", "w")
- file:write("false")
- file:close()
- file = io.open("FrekSystem/Redstone/back", "w")
- file:write("false")
- file:close()
- redstone.setOutput("back", false)
- redstone.setOutput("front", false)
- redstone.setOutput("top", false)
- redstone.setOutput("bottom", false)
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- CommandHandler()
- elseif command == "rs.o" then
- print("Online redstone outputs:")
- local up = ""
- local down = ""
- local back = ""
- local front = ""
- local right = ""
- local left = ""
- file = io.open("FrekSystem/Redstone/left", "r")
- left = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/right", "r")
- right = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/bottom", "r")
- down = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/top", "r")
- up = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/front", "r")
- front = file:read()
- file:close()
- file = io.open("FrekSystem/Redstone/back", "r")
- back = file:read()
- file:close()
- if up == "true" then
- print("- Redstone output 'up' is powered")
- end
- if down == "true" then
- print("- Redstone output 'down' is powered")
- end
- if front == "true" then
- print("- Redstone output 'front' is powered")
- end
- if back == "true" then
- print("- Redstone output 'back' is powered")
- end
- if right == "true" then
- print("- Redstone output 'right' is powered")
- end
- if left == "true" then
- print("- Redstone output 'left' is powered")
- end
- if left == "false" and right == "false" and down == "false" and up == "false" and front == "false" and back == "false" then
- print("- No redstone outputs are powered!")
- end
- if left == "true" and right == "true" and down == "true" and up == "true" and front == "true" and back == "true" then
- print("- All the redstone outputs are powered!")
- end
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "rs.adv.clock" then
- print("It worked! :D")
- for i in string.gmatch(command, ".") do
- print(i)
- end
- CommandHandler()
- elseif command == "redstone3" then
- print("rs.adv.editcircut {Name} - Edit a redstone timer!")
- print("rs.adv.runcircut {Name} - Run a redstone timer!")
- print("rs.adv.clock {Seconds} {l/r} - Redstone clock")
- print("[-------------------------------------------------]")
- print("[- Page 3 of 3 -]")
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "redstone2" then
- print("rs.left / l - On/Off redstone output 'left'")
- print("rs.right / r - On/Off redstone output 'right'")
- print("rs.down / d- On/Off redstone output 'under'")
- print("rs.up / u - On/Off redstone output 'above'")
- print("rs.back / b - On/Off redstone output 'behind'")
- print("rs.front / f - On/Off redstone output 'front'")
- print("rs.allon / an - On/Off redstone outputs on")
- print("rs.alloff / af-turns all redstone outputs off")
- print("rs.online / o - shows all redstone outputs")
- print("[-------------------------------------------------]")
- print("[- Page 2 of 3 Type 'redstone3' to see next page -]")
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "redstone" then
- print("redstone.left / l - On/Off redstone output 'left'")
- print("redstone.right / r - On/Off redstone output 'right'")
- print("redstone.down / d- On/Off redstone output 'under'")
- print("redstone.up / u - On/Off redstone output 'above'")
- print("redstone.back / b - On/Off redstone output 'behind'")
- print("redstone.front / f - On/Off redstone output 'front'")
- print("redstone.allon / an - On/Off redstone outputs on")
- print("redstone.alloff / af-turns all redstone outputs off")
- print("redstone.online / o - shows all redstone outputs")
- print("[-------------------------------------------------]")
- print("[- Page 1 of 3 Type 'redstone2' to see next page -]")
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "notepad.sh" then
- term.clear()
- term.setCursorPos(1,1)
- shell.run("FrekSystem/Programs/Notepad")
- elseif command == "programs" then
- print("notepad.sh - opens the system notepad")
- CommandHandler()
- elseif command == "user.changeusername" then
- print("Please type your new Username: ")
- local Username = ""
- Username = read()
- if Username == "" then
- print("[Error] Username can't be blank!")
- else
- print("New Username: ", Username)
- end
- elseif command == "user" then
- print("user.changeusername - Changes the Username")
- print("user.changepassword - Changes the Password")
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "return" then
- term.clear()
- term.setCursorPos(1,1)
- print("To start the operating system again:")
- print("Use 'reboot' or 'startup'")
- print("[-------------------------------------------------]")
- elseif command == "computer" then
- print("computer.shutdown - turns off the computer")
- print("computer.restart - restarts computer")
- print("computer.lock - locks your computer")
- print("[-------------------------------------------------]")
- print("cp.shutdown - turns off the computer")
- print("cp.restart - restarts computer")
- print("cp.lock - locks your computer")
- print("[-------------------------------------------------]")
- CommandHandler()
- elseif command == "computer.shutdown" then
- os.shutdown()
- elseif command == "computer.restart" then
- os.reboot()
- elseif command == "computer.lock" then
- term.clear()
- term.setCursorPos(1,1)
- Login()
- elseif command == "cp.shutdown" then
- os.shutdown()
- elseif command == "cp.restart" then
- os.reboot()
- elseif command == "cp.lock" then
- term.clear()
- term.setCursorPos(1,1)
- Login()
- else
- print("Unknown Command: ", command)
- CommandHandler()
- end
- end
- function Screen()
- print("[-------------------------------------------------]")
- print("[- Type 'help' for commands -]")
- print("[-------------------------------------------------]")
- CommandHandler()
- end
- function giveGreeting()
- if fs.exists("FrekSystem/UserData/Username") then
- fs.makeDir("FrekSystem/Redstone")
- local Username = ""
- file = io.open("FrekSystem/UserData/Username", "r")
- Username = file:read()
- file:close()
- print("[-------------------------------------------------]")
- print("[- FrekSystem V.1.0.0 -]")
- print("[-------------------------------------------------]")
- print("[- Welcome back ", Username, "!")
- term.setCursorPos(50,4)
- print("-]")
- fixBugs()
- Screen()
- else
- print("[Error] Failed to load system!")
- end
- end
- function Login()
- if fs.exists("FrekSystem/UserData/Password") then
- local Password = ""
- local TypedPassword = ""
- file = io.open("FrekSystem/UserData/Password", "r")
- Password = file:read()
- file:close()
- print("[-------------------------------------------------]")
- print("[- Booting up FrekSystem v.1.0.0 -]")
- print("[-------------------------------------------------]")
- print("[- Please type your password -]")
- print("[-------------------------------------------------]")
- write("[- Passsword: ")
- TypedPassword = read("*")
- if TypedPassword == Password then
- term.clear()
- term.setCursorPos(1,1)
- giveGreeting()
- else
- print("[Error] Wrong Password!")
- sleep(2)
- os.reboot()
- end
- else
- print("[Error] Failed to load system!")
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- Login()
- os.pullEvent = oldPull
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement