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****",
- "*******ABBCCB***"
- }
- local pixelA = 0X2C8000
- local pixelB = 0X2A7C00
- local pixelC = 0X3FC100
- local width, height = 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(0X2A7C00)
- gpu.fill(x, y, 1, 1, " ")
- elseif color == "C" then
- gpu.setBackground(0X3FC100)
- gpu.fill(x, y, 1, 1, " ")
- end
- end
- function drawIngot()
- for index, line in pairs(ingotMapping) do
- for j = 1, string.len(line) do
- currentPixel = string.sub(line, j, j + 1)
- 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 == "*" then
- drawPixel(j, index, "*")
- end
- end
- end
- end
- function touchEventHandler(_, _, x, y)
- end
- drawIngot()
- --[[while true do
- touchEventHandler(event.pull("touch"))
- end]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement