Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- min=1000
- max=0
- args={...}
- if args[1]==nil then
- file="bild"
- else
- file=args[1]
- end
- shell.run(file)
- names=peripheral.getNames()
- illuminator={}
- for i=1, #names do
- if string.find(names[i],"glowstone_illuminator_") then
- illId=tonumber(string.sub(names[i],#"glowstone_illuminator_"+1))
- if illId<=min then
- min=illId
- end
- if illId>=max then
- max=illId
- end
- illuminator[illId]=names[i]
- end
- end
- for i=1, max-min+1 do
- illuminator[i]=illuminator[min+i-1]
- end
- function fileToTable(file)
- if fs.exists(file)~=true then
- print("file"..file.." not found")
- return(false)
- end
- fp=fs.open(file,"r")
- line={}
- i=1
- line[i]=fp.readLine()
- if line[i]==nil then return(false) end
- while line[i]~=nil do
- i=i+1
- line[i]=fp.readLine()
- end
- return(line)
- end
- img=fileToTable(file)
- i=1
- i2=1
- i3=1
- chars={}
- while img[i]~=nil do
- for i2=1, #img[i] do
- chars[i3]=string.sub(img[1],i2,i2)
- i3=i3+1
- end
- i=i+1
- end
- onechar=""
- for i=1, #img do
- onechar=onechar..img[i]
- end
- max=#color[1]
- i=1
- for y=1,max do
- for x=1,max do
- if illuminator[i]~=nil then
- peripheral.wrap(illuminator[i]).setColor(color[x][y])
- end
- i=i+1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement