Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- function Pastebin( sCode, sPath )
- local response = http.get("http://pastebin.com/raw/"..sCode)
- if response then
- local sResponse = response.readAll()
- response.close()
- local file = fs.open( sPath, "w" )
- file.write( sResponse )
- file.close()
- end
- end
- scripts = {}
- tmpScript = {}
- tmpScript1 = {}
- tmpScript2 = {}
- tmpScript3 = {}
- tmpScript4 = {}
- tmpScript5 = {}
- tmpScript6 = {}
- tmpScript["script"] = "settings.lua"
- tmpScript["code"] = "x3AGVmrE"
- table.insert(scripts, tmpScript)
- tmpScript1["script"] = "buttons.lua"
- tmpScript1["code"] = "n0TCr7i3"
- table.insert(scripts, tmpScript1)
- tmpScript2["script"] = "notifications.lua"
- tmpScript2["code"] = "Zpk9s7Zz"
- table.insert(scripts, tmpScript2)
- tmpScript3["script"] = "redstone.lua"
- tmpScript3["code"] = "gZuRAVWi"
- table.insert(scripts, tmpScript3)
- tmpScript4["script"] = "power.lua"
- tmpScript4["code"] = "1u9eqabU"
- table.insert(scripts, tmpScript4)
- tmpScript5["script"] = "machines.lua"
- tmpScript5["code"] = "TNYbB6P2"
- table.insert(scripts, tmpScript5)
- tmpScript6["script"] = "startup.lua"
- tmpScript6["code"] = "Mpqk3Tvi"
- table.insert(scripts, tmpScript6)
- if not fs.exists("graphics.lua") then
- Pastebin("ecz1XjZa","graphics.lua")
- end
- if not fs.exists("sliders.lua") then
- Pastebin("xduvSaJ4","sliders.lua")
- end
- os.loadAPI("graphics.lua")
- os.loadAPI("sliders.lua")
- w,h = term.getSize()
- length = tablelength(scripts)
- sliders.createSlider("installSlider", 2, 8, w-2, 1, colors.lime, colors.red)
- installing = true
- while installing do
- for k,v in pairs(scripts) do
- graphics.fillScreen(colors.green)
- term.setCursorPos(2,7)
- term.setBackgroundColor( colors.green )
- term.clearLine()
- notification = graphics.label:new()
- notification.text = "Installing " .. v.script
- len = string.len(notification.text)
- notification.x = (w/2) - (len/2) + 1
- notification.y = 7
- notification.bkgColor = colors.green
- notification.draw(notification)
- installPercentage = (k / length) * 100
- sliders.updateSlider("installSlider", installPercentage)
- sliders.draw()
- if not fs.exists(v.script) then
- Pastebin(v.code,v.script)
- end
- end
- os.reboot()
- end
Add Comment
Please, Sign In to add comment