Advertisement
AKopyl

sign

Mar 18th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. os.loadAPI("GIF")
  2. os.loadAPI("blittle")
  3.  
  4. args = {...}
  5.  
  6. local fileName, backgroundCol = args[1], colors.white
  7. local delay = 5
  8. local imgNum = 1
  9.  
  10. local mon = peripheral.wrap("back")
  11. mon.setTextScale(0.5)
  12. mon.setCursorPos(1, 1)
  13. mon.setBackgroundColour(backgroundCol)
  14. mon.clear()
  15.  
  16. local x, y = mon.getSize()
  17.  
  18. local image = {}
  19. image[1] = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)), backgroundCol)
  20. image[2] = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)), backgroundCol)
  21. image[3] = blittle.shrink(GIF.toPaintutils(GIF.loadGIF(fileName)), backgroundCol)
  22.  
  23. while true do
  24.     imgNum = imgNum + 1
  25.     if imgNum > 1 then
  26.         imgNum = 1
  27.     end
  28.  
  29.     blittle.draw(image[imgNum], math.floor((x-image[imgNum].width)/2)+1, math.floor((y-image[imgNum].height)/2)+1, mon)
  30.     blittle.draw(image[imgNum], math.floor((x-image[imgNum].width)/2)+1, math.floor((y-image[imgNum].height)/2)+1)
  31.  
  32.     sleep(delay)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement