Advertisement
illpastethat

Quote color + text cut wickednights

Jun 1st, 2014
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias qcolor {
  2.   return 10 $+ $replace($1-,$chr(32) $+ $chr(34),$chr(32) $+ 05 $+ $chr(34), $chr(34) $+ $chr(32),05 $+ $chr(34) $+ 10 $+ $chr(32))
  3. }
  4.  
  5. alias quote {
  6.   if (%quote.status = $null) { set %quote.status on | echo -a Quoting is 03 $+ enabled! | halt }
  7.   elseif (%quote.status = off) { set %quote.status on | echo -a Quoting is 03 $+ enabled! }
  8.   elseif (%quote.status = on) { set %quote.status off | echo -a Quoting is 04 $+ disabled!  }
  9.   else { halt }
  10. }
  11.  
  12. on *:INPUT:*:{
  13.   var %End 01...
  14.   var %New 01...
  15.   var %MaxLen $calc(400 - $len($nick))
  16.   if ($len($1-) < %MaxLen) {
  17.     if ((($left($1,1) != /) || ($1 == /me)) && (%quote.status = on)) {
  18.       if ($1 == /me) {
  19.         describe $target $qcolor($2-) | haltdef
  20.       }
  21.       else {
  22.         msg $target $qcolor($1-) | haltdef
  23.       }
  24.     }
  25.     return
  26.   }
  27.   var %x %MaxLen, %y, %1, %2, %3, %Prefix say
  28.   while ($asc($mid($1-,%x,1)) !== 32) { if (%x < $calc(%MaxLen - 50)) goto SpcFound | dec %x }
  29.   :SpcFound
  30.   %1 = $left($1-,%x) | %2 = $mid($1-,%x,$len($1-))
  31.   if ($len(%2) > %MaxLen) {
  32.     %x = %MaxLen
  33.     while ($asc($mid(%2,%x,1)) !== 32) { if (%x < $calc(%MaxLen - 50)) goto SpcFound3 | dec %x }
  34.     :SpcFound3
  35.     %3 = $mid(%2,%x,$len(%2))
  36.     %2 = $left(%2,%x)
  37.   }
  38.   if (($1 = /me) || ($1 = /action)) {
  39.     %Prefix = /me
  40.     if ($1 == /me) %1 = $right(%1,$calc($len(%1) - 3))
  41.     else %1 = $right(%1,$calc($len(%1) - 7))
  42.   }
  43.   %Prefix $iif(%quote.status = on,$qcolor(%1),%1) %End
  44.   if (%3 != $null) {
  45.     %2 = %2 %End
  46.     if (($isodd($count(%2,"))) && ($iseven($count(%1,"))) && (%quote.status = on))  {
  47.       %3 = 05 $+ %3
  48.     }
  49.     .timerCuttxt3 1 2 %Prefix %New $iif(%quote.status = on,$qcolor(%3),%3)
  50.   }
  51.   if (($isodd($count(%1,"))) && (%quote.status = on))  {
  52.     %2 = 05 $+ %2
  53.   }
  54.   .timerCuttxt2 1 1 %Prefix %New $iif(%quote.status = on,$qcolor(%2),%2)
  55.   halt
  56. }
  57. alias iseven return $iif(2 // $1,$true,$false)
  58. alias isodd return $iif(!$iseven($1),$true,$false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement