Advertisement
Marlingaming

Monitor image Drawer

Jun 14th, 2023 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. local arg = {...}
  2.  
  3.  
  4. local w =7
  5. local h = 5
  6.  
  7.  
  8. local function Draw(Monitor)
  9. local X = 1
  10. local Y = 1
  11. local file = fs.open(arg[1],"r")
  12. local STRING = file.readAll()
  13. file.close()
  14. for i = 1, string.len(STRING) do
  15. Monitor.setCursorPos(X,Y)
  16. Monitor.blit("X",string.sub(STRING,i,i), string.sub(STRING,i,i))
  17. if X < w then X = X + 1 else Y = Y + 1 X = 1 end
  18. end
  19. end
  20.  
  21. local function GetTargets()
  22. local Targets = {peripheral.find("monitors",function(name,monitor) W,H= monitor.getSize() return( if W == 7) end)}
  23.  
  24. for i = 1, #Targets do
  25. Draw(Targets[i])
  26. end
  27. end
  28.  
  29. GetTargets()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement