Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Random Text colors
- -- Set monitor
- mon=peripheral.wrap("right")
- -- Set main text color
- mon.setTextColor(colors.white)
- -- Wipe monitor
- mon.clear()
- -- Set cursor at top-left position
- mon.setCursorPos(1,1)
- -- Big!
- mon.setTextScale(3)
- mon.write("Bug's")
- -- Do the same with bottom line of text
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,3)
- mon.write("Shop")
- -- Local variable
- local color = 1
- -- Randomize the seed based on Operating System's time
- math.randomseed(os.time())
- -- Main loop
- while true do
- -- "D"
- -- Second line, first letter
- mon.setCursorPos(1,2)
- -- Get random number for our color
- -- Ignore if zero, we don't want white, and only go to 14 so we don't get black
- color=math.random(14)
- if color > 0 then
- mon.setTextColor(2^color)
- mon.write("D")
- end
- -- Do the same for last 2 letters
- -- "y"
- mon.setCursorPos(2,2)
- color=math.random(14)
- if color > 0 then
- mon.setTextColor(2^color)
- mon.write("y")
- end
- -- "e"
- mon.setCursorPos(3,2)
- color=math.random(14)
- if color > 0 then
- mon.setTextColor(2^color)
- mon.write("e")
- end
- -- Wait for 0.1 seconds before doing another set of colors
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement