-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfiles.lua
55 lines (39 loc) · 1.46 KB
/
files.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- just a simplistic file system mechanism
-- i only made this for very little purposes, but if you do end up deleting the folders ->
-- you will be asked to join the discord again!
-- so that's fun.
local cryMyselfToSleep = false
local api = loadstring(game:HttpGetAsync("https://raw.githubusercontent.com/hello-n-bye/starry/main/src/api.lua", true))()
local path = "Starry"
if (isfolder(path)) then
if (cryMyselfToSleep) then
delfolder(path)
api.log("Deleted parent folder!")
local timed = tick()
makefolder(path)
api.log("Created new folder in ~" .. string.format("%.2f", tick() - timed) .. " seconds.")
else
api.log("Found and saved parent folder.")
end
else
local timed = tick()
makefolder(path)
api.log("Created parent folder in " .. string.format("%.2f", tick() - timed) .. " seconds.")
end
local iHateLife = path .. "//info.json"
local contents = [[{"askedDiscord": false}]]
if (isfile(iHateLife)) then
api.log("Found info.cfg file.")
if (string.find(readfile(iHateLife), '{"askedDiscord": ')) then
api.log("Contents match -- all clear.")
else
delfile(iHateLife)
api.log("Deleted old configuration.")
writefile(iHateLife, contents)
api.log("Created new configuration profile -- all clear.")
end
else
api.log("Configuration not found!")
writefile(iHateLife, contents)
api.log("Created configuration profile -- all clear.")
end