My code depository

The code I'm about to share isn't mine either, but I might as well share for those who think like me and think that bashing is rather boring to watch with the color always being the same.


Trigger:

You have scored a .* hit! - perl regex

deleteLine()
echo("\n")
rainbow(matches[1])


Script:

function rainbow(args)
local str = ""
local colours = { "|cFF0000", "|cFF6600", "|cFFEE00", "|c00FF00", "|c0099FF", "|c4400FF", "|c9900FF" }
local pass = math.random(7)

for char in args:gmatch"." do
if char == " " then
str = str .. char
else
str = str .. colours[pass] .. char
if pass == #colours then pass = 1 end
pass = pass + 1
end
end

return hecho(str)
end

--

Enjoy the rainbow crits! Hopefully I will have more stuff to share with you all in the future!

Here is what it looks like:

https://ada-young.com/pastebin/5QkU8EQY
DrystinMacavityMaira

Comments

  • As a side note, you can use that code to actually rainbow highlight anything. Just have to get the line and put it into a trigger and add the correct regex for it (if it's needed) and then add

    deleteLine()
    echo("\n")
    rainbow(matches[1])
Sign In or Register to comment.