Compare commits
4 Commits
7c1e0de4ff
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a2494b11b0 | |||
| 10a2cd4880 | |||
| 95734536f9 | |||
| 5a9fa01cd7 |
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
perms = {
|
|
||||||
repo = false,
|
|
||||||
network = false,
|
|
||||||
app = false,
|
|
||||||
http = false,
|
|
||||||
peripheral = false
|
|
||||||
},
|
|
||||||
author = "CadenCoaster",
|
|
||||||
name = "Bad Clicker",
|
|
||||||
appid = "com.ruffles.clicker",
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<EFBFBD><EFBFBD>?O<>0<10>w<77>Ó#<23>*u<>+<2B>B<EFBFBD><17>38<33>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD>JC<4A><EFBFBD>%Ed<45><64><EFBFBD>=<3D><><EFBFBD>;<10>W<EFBFBD><57>·<>TA<>
|
|
||||||
<EFBFBD>@<40><>BC&*<2A>}<7D>w<EFBFBD><11>C<EFBFBD>i<EFBFBD>m&t<><74>%NN8<19><>=<3D>-B)<29><><EFBFBD>%klpP+<2B><>:<3A><><EFBFBD><EFBFBD><06>&N<>BgX<67>Pi<50>~<1D><>6<EFBFBD>ES[]T<>WB<57>
|
|
||||||
Binary file not shown.
BIN
apps/org.ruffles.launcher
Normal file
BIN
apps/org.ruffles.launcher
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
37
install.lua
Normal file
37
install.lua
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
local expect = require "cc.expect".expect
|
||||||
|
local base_url = "https://git.cadencoaster.com/Rivulet/ccphone/raw/branch/main/"
|
||||||
|
local function download_to(path)
|
||||||
|
expect(2, path, "string")
|
||||||
|
term.write(path)
|
||||||
|
if not http.checkURL(base_url..path) then error("URL is not valid" ,2) end
|
||||||
|
local data = http.get(base_url..path).readAll()
|
||||||
|
fs.makeDir(fs.getDir(path))
|
||||||
|
local file = fs.open(path,"w")
|
||||||
|
if not file then error("Failed to open file", 2) end
|
||||||
|
file.write(data)
|
||||||
|
file.close()
|
||||||
|
print(" OK")
|
||||||
|
end
|
||||||
|
|
||||||
|
local filesystem = {
|
||||||
|
files = {
|
||||||
|
"startup/00_entrypointclient.lua",
|
||||||
|
"startup/99_phoneOS.lua",
|
||||||
|
"startup/01_repo.lua",
|
||||||
|
"libs/containers.lua",
|
||||||
|
"libs/windows.lua",
|
||||||
|
"apps/com.ruffles.launcher",
|
||||||
|
},
|
||||||
|
dirs = {
|
||||||
|
"global-libraries",
|
||||||
|
"apps-meta",
|
||||||
|
},
|
||||||
|
}for _,i in ipairs(filesystem.dirs) do
|
||||||
|
print("making dir",i)
|
||||||
|
fs.makeDir(i)
|
||||||
|
end
|
||||||
|
for _,i in ipairs(filesystem.files) do
|
||||||
|
download_to(i)
|
||||||
|
end
|
||||||
|
|
||||||
|
shell.run("wget run https://raw.githubusercontent.com/Pyroxenium/Basalt2/main/install.lua -f /global-libraries/basalt.lua")
|
||||||
File diff suppressed because one or more lines are too long
3605
libs/deflate.lua
Normal file
3605
libs/deflate.lua
Normal file
File diff suppressed because it is too large
Load Diff
22
libs/persistent-storage.lua
Normal file
22
libs/persistent-storage.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
local id = ...
|
||||||
|
local deflate = dofile("libs/deflate.lua")
|
||||||
|
local filepath = fs.combine("/persisted-data",id)
|
||||||
|
local expect = dofile("rom/modules/main/cc/expect.lua")
|
||||||
|
local expect, field = expect.expect, expect.field
|
||||||
|
local lib={}
|
||||||
|
function lib.load()
|
||||||
|
if fs.exists(filepath) then
|
||||||
|
local file = fs.open(filepath,"r")
|
||||||
|
local data = textutils.unserialise(deflate:DecompressDeflate(file.readAll()))
|
||||||
|
file.close()
|
||||||
|
return data
|
||||||
|
else
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function lib.save(data)
|
||||||
|
expect(1,data,"table")
|
||||||
|
local file = fs.open(filepath,"w")
|
||||||
|
file.write(deflate:CompressDeflate(textutils.serialise(data),{level=8}))
|
||||||
|
end
|
||||||
|
return lib
|
||||||
82
scan.lua
Normal file
82
scan.lua
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
local exceptions = {
|
||||||
|
["/scan.lua"] = true,
|
||||||
|
["/install.lua"] = true,
|
||||||
|
["scan.lua"] = true,
|
||||||
|
["install.lua"] = true,
|
||||||
|
["/.settings"] = true,
|
||||||
|
[".settings"] = true,
|
||||||
|
["/.git"] = true,
|
||||||
|
[".git"] = true,
|
||||||
|
["/rom"] = true,
|
||||||
|
["rom"] = true,
|
||||||
|
["/scan.dat"] = true,
|
||||||
|
["scan.dat"] = true
|
||||||
|
}
|
||||||
|
local function scan(dir)
|
||||||
|
local out = {}
|
||||||
|
for _,i in ipairs(fs.list(dir)) do
|
||||||
|
local path = fs.combine(dir,i)
|
||||||
|
if exceptions[path] == nil then
|
||||||
|
if fs.isDir(path) then
|
||||||
|
out[i] = scan(path)
|
||||||
|
else
|
||||||
|
local file = fs.open(path,"r")
|
||||||
|
out[i] = file.readAll()
|
||||||
|
file.close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
local function format(scandata)
|
||||||
|
local format_data = {
|
||||||
|
files = {},
|
||||||
|
dirs = {}
|
||||||
|
}
|
||||||
|
local function scan_format(dir,data)
|
||||||
|
if type(data) == "table" then
|
||||||
|
local has_scanned = false
|
||||||
|
for k,v in pairs(data) do
|
||||||
|
has_scanned = true
|
||||||
|
scan_format(fs.combine(dir,k),v)
|
||||||
|
end
|
||||||
|
if not has_scanned then
|
||||||
|
format_data.dirs[#format_data.dirs+1] = dir
|
||||||
|
end
|
||||||
|
else
|
||||||
|
format_data.files[#format_data.files+1] = dir
|
||||||
|
end
|
||||||
|
end
|
||||||
|
scan_format("/",scandata)
|
||||||
|
return format_data
|
||||||
|
end
|
||||||
|
local textdata = textutils.serialise(format(scan("/")))
|
||||||
|
local firstpart = [[local expect = require "cc.expect".expect
|
||||||
|
local base_url = "https://git.cadencoaster.com/Rivulet/ccphone/raw/branch/main/"
|
||||||
|
local function download_to(path)
|
||||||
|
expect(2, path, "string")
|
||||||
|
term.write(path)
|
||||||
|
if not http.checkURL(base_url..path) then error("URL is not valid" ,2) end
|
||||||
|
local data = http.get(base_url..path).readAll()
|
||||||
|
fs.makeDir(fs.getDir(path))
|
||||||
|
local file = fs.open(path,"w")
|
||||||
|
if not file then error("Failed to open file", 2) end
|
||||||
|
file.write(data)
|
||||||
|
file.close()
|
||||||
|
print(" OK")
|
||||||
|
end
|
||||||
|
|
||||||
|
local filesystem = ]]
|
||||||
|
local secondpart = [[
|
||||||
|
for _,i in ipairs(filesystem.dirs) do
|
||||||
|
print("making dir",i)
|
||||||
|
fs.makeDir(i)
|
||||||
|
end
|
||||||
|
for _,i in ipairs(filesystem.files) do
|
||||||
|
download_to(i)
|
||||||
|
end
|
||||||
|
|
||||||
|
shell.run("wget run https://raw.githubusercontent.com/Pyroxenium/Basalt2/main/install.lua -f /global-libraries/basalt.lua")]]
|
||||||
|
local outfile = fs.open("install.lua","w")
|
||||||
|
outfile.write(firstpart..textdata..secondpart)
|
||||||
|
outfile.close()
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
local basalt = require("globals.basalt")
|
|
||||||
|
|
||||||
-- Get the main frame (your window)
|
|
||||||
local count = 0
|
|
||||||
local main = basalt.getMainFrame()
|
|
||||||
main:setBackground(colors.gray)
|
|
||||||
local w,h = term.getSize()
|
|
||||||
main:addLabel({
|
|
||||||
x = w/2-(7/2)+1,
|
|
||||||
y = 2,
|
|
||||||
text = "Welcome!",
|
|
||||||
foreground = colors.yellow
|
|
||||||
})
|
|
||||||
local countLabel = main:addLabel({
|
|
||||||
x = w/2-(7/2)+1,
|
|
||||||
y = 5,
|
|
||||||
text = "0",
|
|
||||||
foreground = colors.white
|
|
||||||
})
|
|
||||||
|
|
||||||
local button = main:addButton({
|
|
||||||
x = w/2-(7/2)+1,
|
|
||||||
y = 10,
|
|
||||||
text = "Click Me!",
|
|
||||||
foreground = colors.white
|
|
||||||
}):center():onClick(function () count = count + 1 countLabel:setText(tostring(count)) end)
|
|
||||||
|
|
||||||
|
|
||||||
basalt.run()
|
|
||||||
Reference in New Issue
Block a user