Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require "component"
- local event = require "event"
- local term = require "term"
- local transoser = component.transposer
- local redstone = component.redstone
- local gpu = component.gpu
- local ingotMapping =
- {
- "**********AB****",
- "*******AAABBA***",
- "****AAABCCCCBA**",
- "*AAABDDCCCCCCBA*",
- "ABDDDCCCCCBAAABA",
- "ADBCCCCBAAABAAAA",
- "ADCABAAABBBBBBBA",
- "ACBBABBBBBBBBBBA",
- "ABBBABBBBBBBAAA*",
- "*ABBBBBBAAA*****",
- "**ABABAAA*******",
- "***AAA**********"
- }
- local pixelA = 0X2C8000
- local pixelB = 0X3FC100
- local pixelC = 0X56FF0A
- local pixelD = 0X9FFF57
- local w, h = gpu.getResolution()
- ----------------------------------------------------------------
- function drawPixel(x, y, color)
- if color == "A" then
- gpu.setBackground(0X2C8000)
- gpu.fill(x, y, 1, 1, " ")
- elseif color == "B" then
- gpu.setBackground(0X3FC100)
- gpu.fill(x, y, x, 1, " ")
- elseif color == "C" then
- gpu.setBackground(0X56FF0A)
- gpu.fill(x, y, 1, 1, " ")
- elseif color == "D" then
- gpu.setBackground(0X9FFF57)
- end
- end
- function drawIngot()
- for index, line in pairs(ingotMapping) do
- for j = 1, string.len(line) do
- currentPixel = string.sub(line, j, j)
- if currentPixel == "A" then
- drawPixel(j, index, "A")
- elseif currentPixel == "B" then
- drawPixel(j, index, "B")
- elseif currentPixel == "C" then
- drawPixel(j, index, "C")
- elseif currentPixel == "D" then
- drawPixel(j, index, "D")
- end
- end
- end
- end
- function touchEventHandler(_, _, x, y)
- end
- term.clear()
- drawIngot()
- --[[while true do
- touchEventHandler(event.pull("touch"))
- end]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement