Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function drawVertLine(x, sy, ey)
- local incr = (sy > ey and -1 or 1) -- direction to loop
- for i = sy, ey, incr do
- term.setTextColor(cl3)
- term.setCursorPos(x, i)
- write('I')
- sleep(spd/2)
- term.setTextColor(cl2)
- term.setCursorPos(x, i)
- write('|')
- sleep(spd/2)
- end
- end
- local function drawHorizLine(sx, ex, y)
- local incr = (sx > ex and -1 or 1)
- for i = sx, ex, incr do
- term.setTextColor(cl3)
- term.setCursorPos(i, y)
- write('=')
- sleep(spd/2)
- term.setTextColor(cl2)
- term.setCursorPos(i, y)
- write('-')
- sleep(spd/2)
- end
- end
- local function centerText(msg, y)
- term.setCursorPos( math.floor((totalx - #msg)/2) + (#msg % 2 == 0 and 1 or 0) , y)
- write(msg)
- end
- local function advert() -- you don't need the params, you have them defined up the top of the script, just use those
- while true do -- since you have parallel.waitForAny, just put a loop, it will stop this when the other function stops
- -- clear the screen
- term.setBackgroundColor(cl4)
- term.clear()
- -- draw the lines
- term.setBackgroundColor(cl1)
- drawHorizLine(2, totalx - 1, 1)
- drawVertLine(totalx, 1, totaly)
- drawHorizLine(totalx - 1, 2, totaly)
- drawVertLine(1, totaly, 1)
- -- draw the text
- term.setBackgroundColor( colors.orange )
- centerText("Casino", totaly / 2)
- sleep(1)
- -- draw the center line
- drawHorizLine(2, totalx - 1, totaly / 2 + 1)
- -- draw the rest of the text
- centerText("Slots", totaly / 2 + 2)
- sleep(2)
- end
- term.clear()
- term.restore()
- end
- term.redirect( mon ) -- redirect to the monitor so we can just use term calls
- parallel.waitForAny(advert, function() coined(pside) end)
- term.restore() -- restore the terminal from the monitor to the computer
Advertisement
Add Comment
Please, Sign In to add comment