Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GithubRepo = "https://github.com/Grexxity/GifProjector/tree/main"
- local sSavename = "GCC1.gif"
- -----------------------------------------------------------
- local tbl = {}
- local args = {...}
- if not fs.exists("bbpack") then
- shell.run("pastebin","get","cUYTGbpb","bbpack")
- term.clear()
- end
- if not fs.exists("GIF") then
- shell.run("pastebin","get","5uk9uRjC","GIF")
- term.clear()
- end
- function APICheck(t, api)
- for list,_ in pairs(t) do
- if list == api then
- return true
- end
- end
- return false
- end
- if not (APICheck(_G,"GIF")) then
- os.loadAPI("GIF")
- end
- if not (APICheck(_G,"bbpack")) then
- os.loadAPI("bbpack")
- end
- for a,v in pairs(peripheral.getNames()) do
- if (peripheral.getType(v) == "monitor" ) then
- tbl[#tbl + 1] = peripheral.wrap(v)
- end
- end
- function display(i)
- local mon = tbl[tonumber(i)]
- mon.setTextScale(0.5)
- term.redirect(mon)
- local x,y = term.getSize()
- local Stored = x.."x"..y..sSavename
- if not fs.exists("GIFs/"..Stored) then
- bbpack.fileSys(GithubRepo, "pain/")
- local image = GIF.loadGIF("pain/"..sSavename)
- local image = GIF.resizeGIF(image, x,y)
- GIF.saveGIF(image,"GIFs/"..Stored)
- end
- local image = GIF.loadGIF("GIFs/"..Stored)
- while true do
- term.setBackgroundColour(image.backgroundCol)
- term.clear()
- parallel.waitForAny(
- function()
- for i = 1,#tbl do
- GIF.animateGIF(image, math.floor((x - image.width) / 2) + 1, math.floor((y - image.height) / 2) + 1)
- end
- end)
- end
- end
- local PrgmName = shell.getRunningProgram()
- if args[1] == nil then if(#tbl >= 1) then for i = 1,#tbl do shell.openTab(PrgmName,i) end end elseif (tonumber(args[1]) >= 1) then display(args[1]) end
- shell.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement