Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --LOAD SIMPLE FUNCTIONS
- local function centerPrint(text,y,distance)
- if text == nil then text = "Hello World!" end
- if y == nil then y = 1 end
- if distance == nil then distance = 0 end
- local dx, dy = term.getSize()
- term.setCursorPos(dx/2-#text/2-distance,y)
- print(text)
- end
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function bg(color)
- term.setBackgroundColor(color)
- end
- local function text(color)
- term.setTextColor(color)
- end
- local function dl(path,dest)
- local resp = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(path))
- if resp then
- f = fs.open(dest,"w")
- f.write(resp.readAll())
- f.close()
- return true
- else
- return false
- end
- end
- --DONE LOADING SIMPLE FUNCTIONS
- local version = "Service Pack 7"
- if term.isColor() then
- local isclicking = true
- while isclicking do
- bg(colors.gray)
- text(colors.white)
- clear()
- centerPrint("You do not have LimeFyre installed",7)
- text(colors.cyan)
- centerPrint("Would you like to install the current version?",8)
- term.setCursorPos(15,10)
- bg(colors.lime)
- text(colors.white)
- write(" Yes ")
- term.setCursorPos(32,10)
- bg(colors.red)
- write(" No ")
- bg(colors.gray)
- local event,button,x,y = os.pullEvent("mouse_click")
- if x >= 15 and x <= 20 and y == 10 then
- isclicking = false
- if fs.exists("LimeFyre/") then
- fs.delete("LimeFyre/")
- if fs.exists("startup") then
- local f = fs.open("startup","r")
- local check = f.readLine()
- f.close()
- if check == 'shell.run("LimeFyre/bios.lua")' then
- fs.delete("startup")
- end
- end
- end
- bg(colors.gray)
- text(colors.orange)
- clear()
- centerPrint("Creating directories",10)
- fs.makeDir("LimeFyre")
- fs.makeDir("LimeFyre/APIs")
- fs.makeDir("LimeFyre/User")
- fs.makeDir("LimeFyre/Assets")
- clear()
- centerPrint("Downloading APIs from Pastebin",10)
- dl("bJAZpzaP","LimeFyre/APIs/fdialog")
- dl("jZDYw5y7","LimeFyre/APIs/hashlib")
- sleep(0.2)
- print("Creating system configuration files")
- local t = {}
- t.bgColor = colors.gray
- t.info = "Be careful! If you mess some of the settings up, the OS may crash or not run properly!"
- t.lightColor = colors.lightBlue
- t.darkColor = colors.blue
- local f = fs.open("LimeFyre/conf.lf","w")
- f.write(textutils.serialize(t))
- f.close()
- clear()
- centerPrint("Getting system files from pastebin...",10)
- dl("QCdLIDRU","LimeFyre/Assets/logo")
- dl("cnfymbK4","LimeFyre/bios.lua")
- dl("HpP53PCt","LimeFyre/Assets/files")
- dl("vyAZc6tJ","LimeFyre/Assets/luaide")
- dl("pzWSRqNF","LimeFyre/Assets/npaint")
- dl("Fxb7C0Mk","LimeFyre/Assets/paste")
- local f = fs.open("LimeFyre/User/tiles","w")
- f.write([[{
- {
- color = 1024,
- page = 1,
- funct = "LimeFyre/Assets/paste",
- height = 9,
- text = " Paste ",
- y = 7,
- x = 2,
- width = 10,
- },
- {
- color = 2048,
- page = 1,
- funct = "LimeFyre/Assets/luaide",
- height = 9,
- text = " LuaIDE ",
- y = 7,
- x = 12,
- width = 21,
- },
- {
- color = 32,
- page = 1,
- funct = "LimeFyre/Assets/npaint",
- height = 9,
- text = " Paint ",
- y = 7,
- x = 23,
- width = 31,
- },
- {
- color = 16384,
- page = 1,
- funct = "LimeFyre/Assets/files",
- height = 9,
- text = " FileX ",
- y = 7,
- x = 33,
- width = 41,
- }
- }]])
- f.close()
- local f = fs.open("LimeFyre/User/config","w")
- f.write([[{
- darkColor = 8192,
- lightColor = 32,
- info = "Be careful! If you mess some of the settings up, the OS may crash or not run properly!",
- bgColor = 128,
- }]])
- f.close()
- local yn = true
- while yn do
- bg(colors.gray)
- text(colors.white)
- clear()
- centerPrint("Would you like to run LimeFyre on startup?",8)
- bg(colors.cyan)
- term.setCursorPos(15,10)
- print(" Yes ")
- term.setCursorPos(30,10)
- print(" No ")
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= 15 and x <= 20 then
- f = fs.open("startup","w")
- f.write('shell.run("LimeFyre/bios.lua")')
- f.close()
- yn = false
- break
- elseif x >= 30 and x <= 34 then
- yn = false
- break
- end
- end
- bg(colors.gray)
- clear()
- text(colors.cyan)
- centerPrint("Starting...",10)
- sleep(0.2)
- shell.run("LimeFyre/bios.lua")
- elseif x >= 32 and x <= 36 and y == 10 then
- bg(colors.gray)
- text(colors.orange)
- centerPrint("LimeFyre install cancelled.",15)
- centerPrint("Returning to CraftOS",16)
- sleep(2)
- bg(colors.black)
- text(colors.white)
- clear()
- isclicking = false
- break
- end
- end
- else
- print("Your computer is not advanced. This version")
- print("of LimeFyre requires an Advanced Computer")
- print("Please wait until the basic version is released")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement