Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initScreen = function(width,height,side)
- local screen = {}
- setmetatable(screen,{__index=Screen})
- screen.width = width
- screen.height = height
- local modem = peripheral.wrap(side)
- local periplist = modem.getNamesRemote()
- local min_id = 1000000000000
- for _,name in pairs(periplist) do
- if name:find("thermalexpansion_light") then
- local id = tonumber(name:sub(24,#name))
- if id < min_id then
- min_id = id
- end
- end
- end
- local illuminators = {}
- for i = min_id,min_id+height*width-1 do
- local l = peripheral.wrap("thermalexpansion_light_"..tostring(i))
- table.insert(illuminators,l)
- end
- screen.illuminators = illuminators
- return screen
- end
- local creen = initScreen(9, 7, "back")
- local pic = {{12,13,14,16,23,25,30,31,32,33,34,39,41,48,50,51,52}}
- local picnum = {}
- picnum[1] = {14,23,24,32,41,50,51,49}
- picnum[2] = {15,14,13,22,31,32,33,42,51,50,49}
- picnum[3] = {15,14,13,22,31,32,33,40,49,50,51}
- picnum[4] = {15,13,24,22,33,32,31,40,49}
- picnum[5] = {13,14,15,24,33,32,31,40,49,50,51}
- picnum[6] = {13,14,15,24,33,32,31,40,42,49,50,51}
- picnum[7] = {15,14,13,22,31,40,49}
- picnum[8] = {13,14,15,22,24,31,32,33,40,42,49,50,51}
- picnum[9] = {13,14,15,22,24,31,32,33,40,49,50,51}
- picnum[10] = {16,26,25,34,43,52,53,51,13,12,11,22,20,31,29,40,38,49,48,47}
- picnum[11] = {16,25,26,34,43,51,52,53,22,12,21,30,39,48,49,47}
- picnum[12] = {26,16,25,34,43,52,51,53,13,12,11,20,29,30,31,40,49,48,47}
- picnum[13] = {16,25,26,34,43,51,52,53,13,12,11,20,29,30,31,38,47,48,49}
- picnum[14] = {16,25,26,34,43,51,52,53,13,11,20,22,29,30,31,38,47}
- picnum[15] = {16,25,26,34,43,51,52,53,11,12,13,22,31,30,29,38,47,48,49}
- picnum[16] = {16,25,26,34,43,51,52,53,11,12,13,22,31,30,29,38,40,49,48,47}
- picnum[17] = {16,25,26,34,43,51,52,53,13,12,11,20,29,38,47}
- picnum[18] = {16,25,26,34,43,51,52,53,13,12,11,22,20,31,30,29,40,38,49,48,47}
- picnum[19] = {16,25,26,34,43,51,52,53,13,12,11,22,20,31,30,29,38,47,48,49}
- picnum[20] = {15,16,17,24,33,34,35,44,53,52,51,13,12,11,22,20,31,29,40,38,49,48,47}
- picnum[21] = {15,16,17,24,33,34,35,44,53,52,51,22,12,21,30,39,48,49,47}
- picnum[22] = {15,16,17,24,33,34,35,44,53,52,51,13,12,11,20,29,30,31,40,49,48,47}
- picnum[23] = {15,16,17,24,33,34,35,44,53,52,51,13,12,11,20,31,30,29,38,49,48,47}
- picnum[0] = {17,16,15,26,24,35,33,44,42,53,52,51,13,12,11,22,20,31,29,40,38,49,48,47}
- fill = function(screen, color)
- for i,v in pairs(creen.illuminators) do
- v.setColor(color)
- end
- end
- printimg = function(screen, pic)
- local color = 0xFF0000
- for i,v in ipairs(pic) do
- screen.illuminators[v].setColor(color)
- color = color + 0x000900
- end
- end
- local time = -1
- while true do
- sleep(0)
- local oldtime = time
- time = math.floor(os.time())
- if oldtime ~= time then
- fill(creen, 0x000000)
- printimg(creen, picnum[time])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement