Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- SpeakerSide = "left"
- if fs.exists("beep.dfpwm") then
- shell.run("speaker play beep.dfpwm")
- end
- term.setTextColor(colors.blue)
- term.setBackgroundColor(colors.cyan)
- term.clear()
- if #args == 0 then
- print("RUN execcutes? [F/B/I]")
- while true do
- RunMethod = read()
- RunMethod = string.upper(RunMethod)
- if RunMethod == "F" or RunMethod == "B" or RunMethod == "I" or RunMethod == "" then
- if RunMethod == "" then
- RunMethod = "I"
- end
- break
- else
- print("[F/B/I]")
- end
- end
- end
- if #args == 0 then
- print("Use emulator exceptions? [Y]")
- Exceptions = read()
- term.clear()
- if Exceptions == "y" or Exceptions == "Y" or Exceptions == "" then
- Exceptions = true
- else
- Exceptions = false
- end
- else
- if args[2] == "y" then
- Exceptions = true
- end
- end
- function RUN(AutoMode,COMMAND)
- local beepable = false
- if fs.exists("beep.dfpwm") and AutoMode == false then
- shell.run("speaker play beep.dfpwm")
- term.clear()
- term.setCursorPos(1,1)
- beepable = true
- end
- if AutoMode == false then
- print((fs.getCapacity(".")/1000).." kb capacity")
- print((fs.getFreeSpace(".")/100).." hb avaible")
- term.setCursorPos(1,3)
- else
- term.setCursorPos(1,1)
- end
- local PL = {}
- while true do
- sleep(0)
- print("READY")
- if AutoMode == false then
- OgCOMMAND = read()
- COMMAND = OgCOMMAND
- else
- print(COMMAND)
- sleep(1)
- end
- if string.upper(COMMAND) == "LIST" then
- for i=1,#PL do
- print(PL[i])
- end
- elseif string.upper(COMMAND) == "SHELL" then
- break
- elseif string.upper(COMMAND) == "LOAD" then
- print("Name? ")
- shell.run("disk/"..read())
- elseif string.upper(COMMAND) == "CLEAR" then
- term.clear()
- term.setCursorPos(1,1)
- elseif string.upper(COMMAND) == "RUN" then
- print("SLOW? [Y]")
- Slow = read()
- if Slow == "y" or Slow == "Y" then
- Slow = true
- else
- Slow = false
- end
- for i=1,#PL do
- if RunMethod == "B" then
- RunMethod = "bg "
- elseif RunMethod == "F" then
- RunMethod = "fg "
- else
- RunMethod = ""
- end
- if Exceptions then
- shell.run("startup",PL[i],"y")
- else
- shell.run("startup",PL[i],"n")
- end
- if Slow then
- sleep(1)
- end
- i = i + 1
- end
- elseif string.upper(COMMAND) == "DEL" then
- PL = {}
- else
- temp = string.sub(COMMAND, 1, 3)
- temp2 = 3
- if tonumber(temp) == nil then
- temp = string.sub(COMMAND, 1, 2)
- temp2 = 2
- --if tonumber(temp) == nil then
- --temp = string.sub(COMMMAND, 1, 1)
- --temp2 = 1
- --end
- end
- if tonumber(temp) == nil then
- if Exceptions then
- shell.run(OgCOMMAND)
- else
- print("BAD SYNTAX")
- end
- else
- RESULT = string.sub(COMMAND, (temp2 + 1), string.len(COMMAND))
- PL[tonumber(temp)] = RESULT
- end
- end
- if AutoMode then
- break
- end
- end
- end
- if #args == 0 then
- RUN(false,nil)
- else
- RUN(true,args[1])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement