Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tbl = {}
- local function findMonitors()
- local monitors = {}
- for _, name in pairs(peripheral.getNames()) do
- if string.match(name, "^monitor_") then
- local monitor = peripheral.wrap(name)
- table.insert(monitors, monitor)
- end
- end
- return monitors
- end
- local monitors = findMonitors()
- local monitor = monitors[1]
- local modem = peripheral.wrap("back")
- modem.open(11)
- local function initializeLamps()
- local lampNames = peripheral.getNames()
- table.sort(lampNames)
- for _, v in ipairs(lampNames) do
- if peripheral.getType(v) == "colorful_lamp" then
- sleep(0.1)
- tbl[#tbl + 1] = peripheral.wrap(v)
- end
- end
- end
- initializeLamps()
- while true do
- for i = 1, #tbl do
- tbl[i].setLampColor(32767) -- Lambalar her zaman beyaz olur
- end
- term.redirect(monitor)
- monitor.clear()
- paintutils.drawFilledBox(1, 1, 20, 5, colors.blue)
- paintutils.drawFilledBox(5,2,16,4,colors.white)
- paintutils.drawLine(1,6,20,6,colors.black)
- paintutils.drawLine(1,6,1,14,colors.black)
- paintutils.drawLine(20,6,20,20,colors.black)
- paintutils.drawLine(1,10,20,10,colors.black)
- monitor.setBackgroundColor(colors.white)
- monitor.setTextScale(2)
- monitor.setCursorPos(5, 3)
- monitor.setTextColor(colors.blue)
- monitor.write("{ ROULETTE }")
- monitor.setBackgroundColor(colors.lightGray)
- local redstoneInput = redstone.getInput("bottom")
- sleep(0.1)
- if redstoneInput then
- local random = math.random(1, 22)
- for i = 1, random do
- tbl[i].setLampColor(30499) -- Sarı
- sleep(0.3)
- tbl[i].setLampColor(32767) -- Beyaz
- if i == random then
- tbl[i].setLampColor(30499) -- Sarı
- if random == 1 or random == 3 or random == 5 or random == 7 or random == 9 or random == 12 or random == 14 or random == 16 or random == 18 or random == 20 then
- monitor.setTextScale(2)
- monitor.setBackgroundColor(colors.red)
- monitor.setCursorPos(8, 8)
- monitor.setTextColor(colors.white)
- monitor.write("[RED]")
- sleep(5)
- elseif random == 2 or random == 4 or random == 6 or random == 8 or random == 10 or random == 13 or random == 15 or random == 17 or random == 19 or random == 22 then
- monitor.setTextScale(2)
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(7, 8)
- monitor.setTextColor(colors.white)
- monitor.write("[BLACK]")
- sleep(5)
- elseif random == 11 or random == 21 then
- monitor.setTextScale(2)
- monitor.setBackgroundColor(colors.lime)
- monitor.setCursorPos(7, 8)
- monitor.setTextColor(colors.white)
- monitor.write("[GREEN]")
- sleep(5)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement