Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MonitorSide = "left"
- Monitor = peripheral.wrap(MonitorSide)
- function DrawText(xPos, yPos, text, textColour, backgroundColour)
- Monitor.setBackgroundColor(backgroundColour)
- Monitor.setTextColor(textColour)
- Monitor.setCursorPos(xPos,yPos)
- Monitor.write(text)
- end
- function ClearMonitor()
- Monitor.setTextColor(colours.black)
- Monitor.setBackgroundColor(colours.black)
- Monitor.clear()
- Monitor.setCursorPos(1,1)
- end
- function GetRandomColour()
- local rand = math.random(1, 10)
- if (rand == 1) then return colours.brown end
- if (rand == 2) then return colours.white end
- if (rand == 3) then return colours.blue end
- if (rand == 4) then return colours.brown end
- if (rand == 5) then return colours.pink end
- if (rand == 6) then return colours.red end
- if (rand == 7) then return colours.orange end
- if (rand == 8) then return colours.cyan end
- if (rand == 9) then return colours.green end
- if (rand == 10) then return colours.yellow
- else return colours.white end;
- end
- text = "xdddddddddddddd"
- counter = 2
- textLength = string.len(text)
- function Main()
- while true do
- local monX, monY = Monitor.getSize()
- Monitor.setTextScale(3)
- ClearMonitor()
- counter = counter - 1
- DrawText(counter, 2, text, GetRandomColour(), colours.black)
- if (counter < (1 - textLength)) then
- counter = monX
- end
- sleep(0.2)
- end
- end
- Main()
Add Comment
Please, Sign In to add comment