Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event = require("event")
- local component = require("component")
- local sides = require("sides")
- local term = require("term")
- local gpu = component.gpu
- local redstone = component.redstone
- local colors = require("colors")
- local w, h = gpu.getResolution()
- dofile("tde-apis")
- rlogo = loadImage("tde-red")
- gpu.setBackground(0xFFFFFF)
- gpu.setForeground(0xFF0000)
- gpu.fill(1, 1, w, h, " ")
- term.setCursor(1, 1)
- io.write("[X] TDE-REDSTONE 1.2 OC Edition")
- redstone_on = false
- drawImage(rlogo)
- while true do
- if redstone_on then
- gpu.setBackground(0xFFFF00)
- gpu.setForeground(0xFFFFFF)
- gpu.fill((w / 2 / 2) - 10, h / 2 - 10, (w / 2 / 2) + 10, h / 2 + 10, " ")
- gpu.setBackground(0xFF0000)
- gpu.setForeground(0xFFFFFF)
- fakel1 = ((w/ 2 /2 )) / 2 + 10
- fakel2 = h /2 - 9
- fakel3 = ((w / 2 / 2) - 10) / 2 + 4
- fakel4 = h / 2 - 5
- gpu.fill(fakel1, fakel2, fakel3, fakel4, " ")
- gpu.setBackground(0xFFCC00)
- fakel1 = ((w / 2 / 2) / 2 + 10)
- fakel2 = h / 2 - 5 + 1
- fakel3 = ((w / 4) - 10) / 2 + 4
- fakel4 = h / 2 + 3
- gpu.fill(fakel1, fakel2, fakel3, fakel4, " ")
- else
- gpu.setBackground(0xFF0000)
- gpu.setForeground(0xFFFFFF)
- gpu.fill((w / 2 / 2) - 10, h / 2 - 10, (w / 2 / 2) + 10, h / 2 + 10, " ")
- gpu.setBackground(0xFFFF00)
- gpu.setForeground(0xFFFFFF)
- fakel1 = ((w/ 2 /2 )) / 2 + 10
- fakel2 = h /2 - 9
- fakel3 = ((w / 2 / 2) - 10) / 2 + 4
- fakel4 = h / 2 - 5
- gpu.fill(fakel1, fakel2, fakel3, fakel4, " ")
- gpu.setBackground(0xFFCC00)
- fakel1 = ((w / 2 / 2) / 2 + 10)
- fakel2 = h / 2 - 5 + 1
- fakel3 = ((w / 4) - 10) / 2 + 4
- fakel4 = h / 2 + 3
- gpu.fill(fakel1, fakel2, fakel3, fakel4, " ")
- end
- local event, adress, arg1, arg2, arg3 = event.pull()
- if event == "touch" then
- X = arg1
- Y = arg2
- if X >= (w / 2 / 2) - 10 and X <= (w / 2 / 2) + 10 and Y >= h / 2 - 10 and Y <= h / 2 + 10 and redstone_on then
- redstone_on = false
- redstone.setOutput(sides.back, 0)
- elseif X >= (w / 2 / 2) - 10 and X <= (w / 2 / 2) + 10 and Y >= h / 2 - 10 and Y <= h / 2 + 10 and not redstone_on then
- redstone_on = true
- redstone.setOutput(sides.back, 100)
- elseif X >= 1 and X <= 3 and Y == 1 then
- break
- end
- end
- end
- redstone.setOutput(sides.back, 0)
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- gpu.fill(1, 1, w, h, " ")
- term.setCursor(1, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement