Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- --Lines to display are in file "signtext" without quotes
- local file = io.open("signtext", "r")
- local text = {}
- local textlength = 0
- local j = 1
- while true do
- line = file:read("*l")
- if line == nil then break
- else
- text[j] = line
- j = j + 1
- end
- end
- file:close()
- basePos = {mon.getSize()}
- local pos = {}
- for i=1,#text do
- pos[i] = text[i]:len()
- end
- function monwrite(color, x, y, text)
- if mon.isColor() then mon.setTextColor(color) end
- mon.setTextScale(2)
- mon.setCursorPos(x, y)
- mon.write(text)
- end
- while true do
- mon.clear()
- for i = 1,#text do
- len = text[i]:len()
- if pos[i]==-len then
- pos[i] = len
- end
- monwrite(1024, pos[i], i, text[i])
- pos[i] = pos[i] -1
- end
- os.sleep(0.15)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement