Advertisement
Marlingaming

Display Color ApI

Nov 30th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local function CheckColor()
  2. return term.isColour()
  3. end
  4.  
  5. local function ColorError(file,x,y)
  6. local T = term.getTextColour()
  7. local B = term.getBackgroundColour()
  8. term.setBackgroundColour(colors.white)
  9. term.setTextColor(colors.white)
  10. local F = fs.open(F,"r")
  11. local Line
  12. term.setCursorPos(x,y)
  13. repeat
  14. term.setCursorPos(x,y)
  15. Line = F.readLine()
  16. if Line ~= nil then term.write(Line) y = y + 1 end
  17. until Line == nil
  18. F.close()
  19. term.setCursorPos(x,y - 1)
  20. term.setTextColor(colors.black)
  21. term.write("color not supported")
  22. end
  23.  
  24. function PlayVideo(file,x,y)
  25. if CheckColor() == true then
  26.  
  27. else
  28. ColorError(file,x,y)
  29. end
  30. end
  31.  
  32. function LoadPicture(file,x,y)
  33. if CheckColor() == true then
  34. local Image = paintutils.loadImage(file)
  35. paintutils.drawImage(Image,x,y)
  36. else
  37. ColorError(file,x,y)
  38. end
  39. end
  40.  
  41. function DisplayToMonitor(file,m)
  42.  
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement