Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fileTableGet(path)
- if fs.exists(path) then
- local file = io.open(path, "r")
- local lines = {}
- local i = 1
- local line = file:read("*l")
- while line ~= nil do
- lines[i] = line
- line = file:read("*l")
- i = i + 1
- end
- file:close()
- return lines
- end
- return {}
- end
- function fileLineGet(path, line)
- if fs.exists(path) then
- local lines = fileTableGet(path)
- return lines[line]
- end
- return ""
- end
- function bg(bg)
- term.setBackgroundColour( colors.green )
- term.clear()
- term.setTextColour(colors.cyan)
- term.setCursorPos(2,2)
- print("PSAV - BETA")
- term.setCursorPos(51,1)
- term.setBackgroundColour( colors.red )
- print("x")
- term.setCursorPos(1,1)
- write("<-")
- term.setBackgroundColour( colors.green )
- term.setCursorPos(2,5)
- term.setTextColour( colors.cyan )
- end
- bg()
- fertig = false
- startup = false
- term.setCursorPos(1,5)
- write("Start PSAV on startup?")
- term.setCursorPos(25,5)
- term.setBackgroundColour( colors.white )
- write(" ")
- term.setTextColour( colors.red )
- while fertig == false do
- event, knopf, x, y = os.pullEvent("mouse_click")
- --Start PSAV on startup?
- if (x == 25) and (y == 5) then
- term.setCursorPos(25,5)
- if (startup == false) then
- print("x")
- startup = true
- else
- print(" ")
- startup = false
- end
- end
- --Pfeil
- if (x == 1) or (x == 2) and (y == 1) then
- fertig = true
- shell.run("/PSAV/psav")
- end
- --Klicken auf X / Beenden
- if (x == 51) and (y == 1) then
- fertig = true
- term.setBackgroundColour( colors.black )
- term.clear()
- term.setCursorPos(1,1)
- shell.run(fileLineGet("/PSAV/config/config.txt", 2))
- end
- end
- shell.run("/PSAV/psav")
Advertisement
Add Comment
Please, Sign In to add comment