Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Auto detects monitor
- tSides = {"left","right","bottom","top","front","back"}
- for i = 1, #tSides do
- monitor = peripheral.wrap(tSides[i])
- if monitor then
- side = tSides[i]
- break
- end
- end
- mon = peripheral.wrap(side)
- -- number of signs
- signs = 3
- --color variable
- c = 0
- -- Randomizes text color
- function raincol()
- c = math.random(1,15)
- --Converts the random number into a valid color value
- if c == 3 then
- c = 4
- elseif c == 4 then
- c = 8
- elseif c == 5 then
- c = 16
- elseif c == 6 then
- c = 32
- elseif c == 7 then
- c = 64
- elseif c == 8 then
- c = 128
- elseif c == 9 then
- c = 256
- elseif c == 10 then
- c = 512
- elseif c == 11 then
- c = 1024
- elseif c == 12 then
- c = 2048
- elseif c == 13 then
- c = 4096
- elseif c == 14 then
- c = 8192
- elseif c == 15 then
- c = 16384
- end
- mon.setTextColor(c)
- end
- -- Beginning position of scrolling text
- local pos = 18
- pos2 = 24
- -- Initial Setup
- mon.clear()
- raincol()
- mon.setTextScale(5)
- sign = 1
- -- Main Program
- while true do
- -- Sign Toggle and reset
- if pos == -pos2 then
- pos = 18
- raincol()
- if sign == signs then
- sign = 1
- else
- sign = sign + 1
- end
- end
- --clears monitor and adjusts cursor position
- mon.clear()
- mon.setCursorPos(pos,1)
- --Displays Signs
- if sign == 1 then
- mon.setTextColor(colors.orange)
- pos2 = 24
- mon.write("Welcome to Rolcam's Shop")
- elseif sign == 2 then
- pos2 = 50
- mon.write("Eat at Crazy Betty's Canned Bread Emporium!!!")
- elseif sign == 3 then
- raincol()
- pos2 = 15
- mon.write("Your Ad Here")
- end
- --Adjusts Cursor position variable
- pos = pos - 1
- --Prevents overflow errors (Keep this)
- os.sleep(0.1)
- end
Add Comment
Please, Sign In to add comment