_Jacques

mcImage.lua

Jul 7th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. arg = {...}
  2. assert(#arg == 1, 'usage: imageDisplay <image name>')
  3.  
  4. local mon = screenAPI.wrapMon()
  5. local image = fs.open('mcPaintFolder/images/'..arg[1], 'r')
  6. local imageString = image.readAll()
  7. local imageTable = textutils.unserialise(imageString)
  8.  
  9. for i = 1, #imageTable do
  10.     for k = 1, #imageTable[i] do
  11.         screenAPI.drawDot(i, k, imageTable[i][k])
  12.     end
  13. end
Add Comment
Please, Sign In to add comment