Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- init()
- while true do
- local new_text = ""
- local spacers = ""
- for i = #text, 1, -1 do
- sleep(speed)
- new_text = text:sub(i, i) .. new_text
- display(new_text)
- end
- for i = 0, length do
- sleep(speed)
- spacers = spacers .. " "
- local result = spacers .. text
- display(result)
- end
- end
- end
- function init()
- monitor.setTextScale(size)
- end
- function display(result)
- monitor.setBackgroundColor(color[1])
- monitor.setTextColor(color[2])
- monitor.clear()
- monitor.setCursorPos(1,row)
- monitor.write(result)
- end
- args = { ... }
- text = args[1]
- size = tonumber(args[2])
- length = tonumber(args[3])
- speed = tonumber(args[4])
- monitor = nil
- if(peripheral.isPresent(args[5])) then
- monitor = peripheral.wrap(args[5])
- else
- print("No monitor present on the " .. args[5] .. " side!")
- return
- end
- color = { tonumber(args[6]), tonumber(args[7]) }
- row = tonumber(args[8])
- main()
Advertisement
Comments
-
Comment was deleted
-
Comment was deleted
-
- 1. Text (String)
- 2. Size (Double or Integer)
- 3. Length (Integer)
- 4. Speed in seconds (Double or Integer)
- 5. Monitor side (String)
- 6. Background-Color in decimal (Integer)
- 7. Foreground-Color in decimal (Integer)
- 8. Row (Integer)
- Colors in decimal are listed here: https://computercraft.info/wiki/Colors_(API)
Add Comment
Please, Sign In to add comment
Advertisement