Start of cleanup

This commit is contained in:
Alessandro Proto 2024-08-20 18:19:07 +02:00
parent df43059cd2
commit c75639eb2d
11 changed files with 348 additions and 334 deletions

View file

@ -1 +0,0 @@
setfenv(loadstring(http.get("https://raw.githubusercontent.com/SertexTeam/sPhone/master/src/installer.lua").readAll()),getfenv())()

17
install.lua Normal file
View file

@ -0,0 +1,17 @@
local h, err = http.get("https://git.alexdevs.me/Legacy-CC/sPhone/raw/branch/master/src/installer.lua")
if not h then
error(err, 0)
end
local content = h.readAll()
h.close()
local func, err = load(content, "@installer.lua", "t", _ENV)
if not func then
error(err, 0)
end
local ok, err = pcall(func)
if not ok then
error(err, 0)
end

View file

@ -13,5 +13,6 @@ if not peripheral.isPresent("back") or not peripheral.getType("back") == "modem"
return
end
write("Host: ")
local h = read() term.setCursorPos(2,6)
local h = read()
term.setCursorPos(2, 6)
shell.run("/rom/programs/rednet/chat", "join", h, sPhone.user)

View file

@ -1,5 +1,3 @@
local buttonsInHome = {
{ "sPhone.header", 23, 1, 25, 1, sPhone.theme["header"], sPhone.theme["headerText"], "vvv" },
{ "sPhone.appsButton", 12, 20, 14, 20, sPhone.theme["backgroundColor"], sPhone.theme["header"], "===" },
@ -61,6 +59,7 @@
term.setCursorPos(2, 3)
write("Shutdown")
end
while true do
term.redirect(sPhone.mainTerm)
drawHome()
@ -110,7 +109,6 @@
end
sPhone.inHome = false
end
local function updateClock()

View file

@ -97,7 +97,8 @@ local function readMsg()
if msg ~= "" then
local pos = 1
local update = os.startTimer(0.15)
http.request(server.."send.php","user="..user.."&password="..pass.."&message="..msg.."&to="..sendTo.."&hashed=true")
http.request(server .. "send.php",
"user=" .. user .. "&password=" .. pass .. "&message=" .. msg .. "&to=" .. sendTo .. "&hashed=true")
while true do
term.clear()
term.setCursorPos(1, 1)

View file

@ -120,7 +120,8 @@ local function readMsg()
if msg ~= "" then
local pos = 1
local update = os.startTimer(0.15)
http.request(server.."send.php","user="..user.."&password="..pass.."&message="..msg.."&to="..sendTo.."&hashed=true")
http.request(server .. "send.php",
"user=" .. user .. "&password=" .. pass .. "&message=" .. msg .. "&to=" .. sendTo .. "&hashed=true")
while true do
term.clear()
term.setCursorPos(1, 1)

View file

@ -1,5 +1,3 @@
if not pocket or not term.isColor() then
print("sPhone is only for Advanced Pocket Computers!")
return
@ -12,7 +10,7 @@ local files = {
["src/init.lua"] = "/.sPhone/init",
["src/sPhone.lua"] = "/.sPhone/sPhone",
["install"] = "/.sPhone/update",
["install.lua"] = "/.sPhone/update",
["LICENSE"] = "/.sPhone/LICENSE",
@ -47,11 +45,10 @@ local files = {
["src/interfaces/login"] = "/.sPhone/interfaces/login",
["src/interfaces/bootImage"] = "/.sPhone/interfaces/bootImage",
["src/startup"] = "/startup",
["src/startup"] = "/.sPhone/startup",
["src/startup.lua"] = "/startup.lua",
}
local githubUser = "SertexTeam"
local githubUser = "CC-Legacy"
local githubRepo = "sPhone"
local githubBranch = "master"
@ -108,7 +105,7 @@ local function get(user, repo, bran, path, save)
if not user or not repo or not bran or not path then
error("not enough arguments, expected 4 or 5", 2)
end
local url = "https://raw.github.com/"..user.."/"..repo.."/"..bran.."/"..path
local url = "https://git.alexdevs.me/"..user.."/"..repo.."/raw/branch/"..bran.."/"..path
local remote = http.get(url)
if not remote then
return false
@ -148,7 +145,7 @@ gui()
term.setCursorPos(2,3)
print("License\n")
printError("You must accept the license to install sPhone\n")
print("The MIT License (MIT)\nCopyright (c) 2017 Sertex\n\nRead full license here:\nhttps://raw.github.com/SertexTeam/sPhone/master/LICENSE")
print("The MIT License (MIT)\nCopyright (c) 2024 AlexDevs\n\nRead full license here:\nhttps://git.alexdevs.me/Legacy-CC/sPhone/src/branch/master/LICENSE")
paintutils.drawFilledBox(2,17,9,19,colors.lime)
term.setCursorPos(3,18)
term.setTextColor(colors.white)