Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /uptopic {
- var %string = $strip($channel($active).topic)
- if ($stripped != 0) { echo -a [topic] no changes necessary; return }
- var %color = $rand(2,15)
- var %len = $len(%string)
- var %count = 1
- var %out = $+ %color
- while (%len) {
- if (%color == 16) { %color = 2 }
- if ($mid(%string,%count,1) == $chr(124)) {
- inc %color
- %out = $+(%out,,%color,|)
- }
- else {
- %out = $+(%out,$mid(%string,%count,1),$chr(32))
- }
- inc %count
- dec %len
- }
- /topic $active %out
- }
Advertisement