All pastes #983824 Raw Edit

FOR ORCPAT!

public text v1 · immutable
·published 2008-04-13 17:31 UTC
rendered paste body
menu nicklist {
  ^_OrCpAts_^ Colour Script ! 
  .on { set %colour $$?="Enter Colour" | set %colours on }
  .off { unset %colours | unset %random | unset %rainbow }
  .rainbow { set %rainbow on }
  .random { set %random on }
  .colour {
    .Options
    ..Bold
    ...$iif(%colorbold == on,$style(1)) $+ On: /set %colorbold on
    ...$iif(%colorbold == off,$style(1)) $+ Off: /set %colorbold off
    ..Color Type
    ...$iif(%colortype == light,$style(1)) $+ Light:  /set %colortype light
    ...$iif(%colortype == dark,$style(1)) $+ Dark: /set %colortype dark
    .$iif(%color == on,$style(1)) $+ On: /set %color on
    .$iif(%color == off,$style(1)) $+ Off: /set %color off
  }
  { set %colour on }
}
on *:INPUT:*: {
  if (%colours == on) { msg $active %colour $1- | halt }
  if (%rainbow == on) { && ($left($1,1) != ! && $left($1,1) != / && $left($1,1) != `) {
      say 4,0¦|0,4|¦7¦|4,7|¦8¦|7,8|¦9¦|8,9|¦11¦|9,11|¦13¦|11,13|¦6¦|13,6|¦12 $1- 12 13,6¦|6,13|¦11¦|13,11|¦9¦|11,9|¦8¦|9,8|¦7¦|8,7|¦4¦|7,4|¦0¦|4,0|¦
      haltdef
    }
  }
  if (%random == on) { 
    set %colorrand $rand(2,14) 
    if (/ isin $1-) { $1- | halt }
    if (%colorrand == 2) { msg $active 2 $1- | halt }
    if (%colorrand == 3) { msg $active 3 $1- | halt }
    if (%colorrand == 4) { msg $active 4 $1- | halt }
    if (%colorrand == 5) { msg $active 5 $1- | halt }
    if (%colorrand == 6) { msg $active 6 $1- | halt }
    if (%colorrand == 7) { msg $active 7 $1- | halt }
    if (%colorrand == 8) { msg $active 8 $1- | halt }
    if (%colorrand == 9) { msg $active 9 $1- | halt }
    if (%colorrand == 10) { msg $active 10 $1- | halt }
    if (%colorrand == 11) { msg $active 11 $1- | halt }
    if (%colorrand == 12) { msg $active 12 $1- | halt }
    if (%colorrand == 13) { msg $active 13 $1- | halt }
    if (%colorrand == 14) { msg $active 14 $1- | halt }
  }
  if (%colortype == $null) && ($mid($1,1,1) != /) { /echo -a 2Please specify a color type by typing /ctype light or /ctype dark.  You may also right click this window and select it in Rainbow Text->Options->Color Type. | /halt }
  if (%colorbold == $null) && ($mid($1,1,1) != /) { /echo -a 2Please specify bold by typing /cbold on or /cbold off.  You may also right click this window and select it in Rainbow Text->Options->Bold. | /halt }
  if (%color == on) && ($mid($1,1,1) != /) {
    /set %color.words $strip($1-)
    /set %color.wcounter 0
    if (%colorbold == on) { /set %color.final 0,1 }
    if (%colorbold == off) { /set %color.final 0,1 }
    if (%colortype == light) { /set %color.colors 4 7 8 9 11 13 | /set %color.colorsc 0 }
    if (%colortype == dark) { /set %color.ccolor 4 }
    while (%color.wcounter != $numtok(%color.words,32)) {
      /inc %color.wcounter
      /set %color.cletter 0
      while (%color.cletter != $len($gettok(%color.words,%color.wcounter,32))) {
        /inc %color.cletter
        if (%colortype == light) {
          /inc %color.colorsc
          if (%color.colorsc == 7) { /set %color.colorsc 1 }
          if ($mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) isnum) { /set %color.final %color.final $+  $+ $gettok(%color.colors,%color.colorsc,32) $mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) }
          else { /set %color.final %color.final $+  $+ $gettok(%color.colors,%color.colorsc,32) $+ $mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) }
        }       
        if (%colortype == dark) {
          if ($mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) isnum) { /set %color.final %color.final $+  $+ %color.ccolor $mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) }
          else { /set %color.final %color.final $+  $+ %color.ccolor $+ $mid($gettok(%color.words,%color.wcounter,32),%color.cletter,1) }
          /inc %color.ccolor
          if (%color.ccolor == 14) { /set %color.ccolor 4 }
        }
        if (%color.cletter == $len($gettok(%color.words,%color.wcounter,32))) { /break }
      }
      /set %color.final %color.final $+ $chr(32) $+ $chr(32)
      if (%color.wcounter == $numtok(%color.words,32)) { /break }
    }
    /msg $active %color.final
    /unset %color.*
    /halt
  }
}

alias /color {
  if ($1 == on) { /set %color on }
  if ($1 == off) { /set %color off }
}
alias /ctype {
  if ($1 == light) { /set %colortype light }
  if ($1 == dark) { /set %colortype dark }
}
alias /cbold {
  if ($1 == on) { /set %colorbold on }
  if ($1 == off) { /set %colorbold off }
}

menu nicklist {
  colour
  .Options
  ..Bold
  ...$iif(%colorbold == on,$style(1)) $+ On: /set %colorbold on
  ...$iif(%colorbold == off,$style(1)) $+ Off: /set %colorbold off
  ..Color Type
  ...$iif(%colortype == light,$style(1)) $+ Light:  /set %colortype light
  ...$iif(%colortype == dark,$style(1)) $+ Dark: /set %colortype dark
  .$iif(%color == on,$style(1)) $+ On: /set %color on
  .$iif(%color == off,$style(1)) $+ Off: /set %color off
}