Advertisement
davidbtwo

My BOP echo function

Dec 17th, 2011
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function rainbow(a)
  2.     --ColourNote("cyan", "black", a)
  3.     --roygbiv
  4.     rainbow_chunk = string.format("%i", string.len("*** " .. a .. " ***")/7)
  5.     name_holder = "*** " .. a .. " ***"
  6.     rainbow_colour = 1
  7.     while name_holder ~= "" do
  8.         to_echo = string.format("%." .. rainbow_chunk .. "s", name_holder)
  9.         name_holder = string.gsub(name_holder, to_echo, "")
  10.         ColourTell(rainbow_colours[rainbow_colour], "black", to_echo)
  11.         if rainbow_colour < 7 then rainbow_colour = rainbow_colour + 1 end
  12.     end
  13.     Tell("\n")
  14. end
  15.  
  16. rainbow_colours = {"red", "orange", "yellow", "green", "blue", "indigo", "violet"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement