Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local text = "alien team house! "
- local checksum = 15764
- --------------------------------
- local monitor = peripheral.wrap("back")
- monitor.setTextScale(5)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.orange)
- --------------------------------
- local sizeX, sizeY = monitor.getSize()
- local pos = 1
- local function mathChecksum(data)
- local number = 0
- for i = 1, #data do
- number = number + (data:byte(i) * i)
- end
- --print("valid", number)
- return number
- end
- if mathChecksum(text) == checksum then
- while true do
- monitor.clear()
- monitor.setCursorPos(1, 1)
- local str = text:sub(pos, pos + (sizeX - 1))
- do
- local index = 1
- while #str < sizeX do
- str = str .. text:sub(index, index)
- index = index + 1
- end
- end
- monitor.write(str)
- pos = pos + 1
- if pos > #text then
- pos = 1
- end
- sleep(0.5)
- end
- else
- monitor.clear()
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.orange)
- monitor.setCursorPos(1, 1)
- monitor.write("rootmaster loh ")
- while true do
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement