-- EMUi Slot Machine v0.1 shell.run("clear") monitor = peripheral.wrap("right") monitor.setTextScale(2.5) write("Welcome to EMUi-slots") --[[ colors: 4 = magenta 32 = lime 64 = pink 1024 = purple 2048 = blue --]] colors = { 4, 32, 64, 1024, 2048 } function roll() term.redirect(monitor) term.clear() term.setCursorPos(1,1) draw(1,randomColor()) draw(2,randomColor()) draw(3,randomColor()) draw(4,randomColor()) end function draw(pos, color) if pos == 1 then paintutils.drawFilledBox(1,1,4,5,color) elseif pos == 2 then paintutils.drawFilledBox(5,1,8,5,color) elseif pos == 3 then paintutils.drawFilledBox(9,1,12,5,color) elseif pos == 4 then paintutils.drawFilledBox(13,1,16,5,color) else write("Incorrect arguments on draw()") end term.setCursorPos(1,1) end function randomColor() return colors[math.random(1,5)] end roll()