SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Colors, Reverse, Rainbow, and Massive Text.
  2. ; For colors --- /colors <text here>
  3. ; For reversed text --- /reverse <text here>
  4. ; For reversed text as a /me --- /mereverse <text here>
  5. ; For a rainbow of colors --- /rainbow <text here>
  6. ; For massively huge text --- /mt <text here>
  7. ; For a rainbow of massively huge text --- /mtrainbow <text here>
  8.  
  9. alias colors {
  10.   var %length = $len($1-)
  11.   var %letter = 1
  12.   while (%letter <= %length) {
  13.     if ($mid($1-,%letter,1) == $chr(32)) {
  14.       var %output = %output $+ &
  15.       goto xxx
  16.     }
  17.     var %output = %output $+  $+ $rand(03,013) $+ $mid($1-,%letter,1)
  18.     :xxx
  19.     inc %letter
  20.   }
  21.   var %output = $replace(%output,$chr(38),$chr(32))
  22.   msg $active %output
  23. }
  24.  
  25.  
  26.  
  27. alias rev {
  28.   var %len = $len($1-)
  29.   var %return = $null
  30.   while (%len > 0) {
  31.     var %return = %return $+ $mid($1-,%len,1) $+ $chr(32)
  32.     dec %len
  33.   }
  34.   return %return
  35. }
  36. alias reverse //say $rev( $1- )
  37. alias mereverse //me $rev( $1- )
  38.  
  39.  
  40.  
  41.  
  42. alias rainbow {
  43.   var %pos = 1, %color = 04, %result = $chr(3)
  44.   while (%pos <= $len($1-)) {
  45.     %result = %result $+ %color $+ $mid($1-,%pos,1) $+ $chr(3)
  46.     inc %pos
  47.     %color = $nextcolor(%color)
  48.   }
  49.   if ($isid) return %result
  50.   else say %result
  51. }
  52.  
  53. alias -l nextcolor {
  54.   if ($$1 == 04) return 07
  55.   elseif ($$1 == 07) return 08
  56.   elseif ($$1 == 08) return 09
  57.   elseif ($$1 == 09) return 11
  58.   elseif ($$1 == 11) return 12
  59.   elseif ($$1 == 12) return 02
  60.   elseif ($$1 == 02) return 06
  61.   elseif ($$1 == 06) return 13
  62.   elseif ($$1 == 13) return 04
  63. }
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. alias mt {
  71.   if ($bigtext.unsupp($1-)) {
  72.     echo -ac info * Characters not supported by Big Text present in your message: $bigtext.unsupp($1-)
  73.     return
  74.   }
  75.   var %lia, %lib, %lic, %lid, %lie, %i 1, %text $strip($1-, bur), %colregex /^(\d\d?(?:,\d\d?)?)/
  76.  
  77.   var %regex = /(?<= $+ $chr(3) $+ [0-9]| $+ $chr(3) $+ [0-9][0-9]) $+ $chr(44) $+ \d\d?/g, %res, %dummy = $regsub(%text, %regex, $null, %text)
  78.  
  79.   while (%i <= $len(%text)) {
  80.     if ($mid(%text, %i, 1) == $chr(3)) {
  81.       var %lia $+(%lia, $chr(3)), %lib $+(%lib, $chr(3)), %lic $+(%lic, $chr(3)), %lid $+(%lid, $chr(3)), %lie $+(%lie, $chr(3))
  82.       if ($mid(%text, $calc(%i + 1), 1) != $chr(32)) && ($regex(mtcol, $mid(%text, $calc(%i + 1), $mid(%text, $calc(%i + 1), 0)), %colregex)) {
  83.         var %m $regml(mtcol, 1)
  84.         var %lia %lia $+ %m, %lib %lib $+ %m, %lic %lic $+ %m, %lid %lid $+ %m, %lie %lie $+ %m
  85.         inc %i $len(%m)
  86.       }
  87.     }
  88.     else {
  89.       tokenize 32 $bigtext.char($mid(%text, %i, 1))
  90.       var %lia $+(%lia, $1), %lib $+(%lib, $2), %lic $+(%lic, $3), %lid $+(%lid, $4), %lie $+(%lie, $5)
  91.       ; if ($bigtext.kern($mid(%text, %i, 2))) {
  92.       var %lia $+(%lia, .), %lib $+(%lib, .), %lic $+(%lic, .), %lid $+(%lid, .), %lie $+(%lie, .)
  93.       ; }
  94.     }
  95.     inc %i
  96.   }
  97.   say $bigtext.format(%lia)
  98.   say $bigtext.format(%lib)
  99.   say $bigtext.format(%lic)
  100.   say $bigtext.format(%lid)
  101.   say $bigtext.format(%lie)
  102. }
  103.  
  104. ; You may customize this alias however you want to.
  105. ; It is Big Text's font, used above.
  106. ; The return value consists of dots and X's, to denote
  107. ;   unlit and lit points in the font, respectively;
  108. ;   there are 5 tokens of the same length, each
  109. ;   corresponding to a line in the 5-line output.
  110. ; Note how the . and X's look like the characters;
  111. ;   you can use this to your advantage!
  112. alias -l bigtext.char {
  113.   if ($1 === $chr(32)) || ($1 === $null) return $&
  114.     ... $&
  115.     ... $&
  116.     ... $&
  117.     ... $&
  118.     ...
  119.   if ($1 === $chr(160)) return $&
  120.     ..... $&
  121.     ..... $&
  122.     ..... $&
  123.     ..... $&
  124.     .....
  125.   elseif ($1 == 0) return $&
  126.     .XXXX. $&
  127.     XX..XX $&
  128.     XX.XXX $&
  129.     XXX.XX $&
  130.     .XXXX.
  131.   elseif ($1 == 1) return $&
  132.     .XXXX $&
  133.     XX.XX $&
  134.     ...XX $&
  135.     ...XX $&
  136.     ...XX
  137.   elseif ($1 == 2) return $&
  138.     XXXXX. $&
  139.     ....XX $&
  140.     ..XX.. $&
  141.     XX.... $&
  142.     XXXXXX
  143.   elseif ($1 == 3) return $&
  144.     XXXXX. $&
  145.     ....XX $&
  146.     .XXXX. $&
  147.     ....XX $&
  148.     XXXXX.
  149.   elseif ($1 == 4) return $&
  150.     .....XXX. $&
  151.     ...XX.XX. $&
  152.     .XX...XX. $&
  153.     XXXXXXXXX $&
  154.     ......XX.
  155.   elseif ($1 == 5) return $&
  156.     XXXXX $&
  157.     XX... $&
  158.     XXXX. $&
  159.     ...XX $&
  160.     XXXX.
  161.   elseif ($1 == 6) return $&
  162.     .XXXX. $&
  163.     XX.... $&
  164.     XXXXX. $&
  165.     XX..XX $&
  166.     .XXXX.
  167.   elseif ($1 == 7) return $&
  168.     XXXXXX $&
  169.     ...XX. $&
  170.     ..XX.. $&
  171.     .XX... $&
  172.     XX....
  173.   elseif ($1 == 8) return $&
  174.     .XXXX. $&
  175.     XX..XX $&
  176.     .XXXX. $&
  177.     XX..XX $&
  178.     .XXXX.
  179.   elseif ($1 == 9) return $&
  180.     .XXXX. $&
  181.     XX..XX $&
  182.     .XXXXX $&
  183.     ....XX $&
  184.     .XXXX.
  185.   elseif ($1 == A) return $&
  186.     .XXXX. $&
  187.     XX..XX $&
  188.     XXXXXX $&
  189.     XX..XX $&
  190.     XX..XX
  191.   elseif ($1 == B) return $&
  192.     XXXXX. $&
  193.     XX..XX $&
  194.     XXXXX. $&
  195.     XX..XX $&
  196.     XXXXX.
  197.   elseif ($1 == C) return $&
  198.     .XXXX. $&
  199.     XX..XX $&
  200.     XX.... $&
  201.     XX..XX $&
  202.     .XXXX.
  203.   elseif ($1 == D) return $&
  204.     XXXX.. $&
  205.     XX.XX. $&
  206.     XX..XX $&
  207.     XX..XX $&
  208.     XXXXX.
  209.   elseif ($1 == E) return $&
  210.     XXXXX $&
  211.     XX... $&
  212.     XXXX. $&
  213.     XX... $&
  214.     XXXXX
  215.   elseif ($1 == F) return $&
  216.     XXXXX $&
  217.     XX... $&
  218.     XXXX. $&
  219.     XX... $&
  220.     XX...
  221.   elseif ($1 == G) return $&
  222.     .XXXX. $&
  223.     XX.... $&
  224.     XX.XXX $&
  225.     XX..XX $&
  226.     .XXXXX
  227.   elseif ($1 == H) return $&
  228.     XX...XX $&
  229.     XX...XX $&
  230.     XXXXXXX $&
  231.     XX...XX $&
  232.     XX...XX
  233.   elseif ($1 == I) return $&
  234.     XXXX $&
  235.     .XX. $&
  236.     .XX. $&
  237.     .XX. $&
  238.     XXXX
  239.   elseif ($1 == J) return $&
  240.     ....XX $&
  241.     ....XX $&
  242.     ....XX $&
  243.     XX..XX $&
  244.     .XXXX.
  245.   elseif ($1 == K) return $&
  246.     XX..XX $&
  247.     XX.XX. $&
  248.     XXXX.. $&
  249.     XX.XX. $&
  250.     XX..XX
  251.   elseif ($1 == L) return $&
  252.     XX... $&
  253.     XX... $&
  254.     XX... $&
  255.     XX... $&
  256.     XXXXX
  257.   elseif ($1 == M) return $&
  258.     XX....XX $&
  259.     XXX..XXX $&
  260.     XXXXXXXX $&
  261.     XX.XX.XX $&
  262.     XX....XX
  263.   elseif ($1 == N) return $&
  264.     XX..XX $&
  265.     XXX.XX $&
  266.     XXXXXX $&
  267.     XX.XXX $&
  268.     XX..XX
  269.   elseif ($1 == O) return $&
  270.     .XXXX. $&
  271.     XX..XX $&
  272.     XX..XX $&
  273.     XX..XX $&
  274.     .XXXX.
  275.   elseif ($1 == P) return $&
  276.     XXXXX. $&
  277.     XX..XX $&
  278.     XXXXX. $&
  279.     XX.... $&
  280.     XX....
  281.   elseif ($1 == Q) return $&
  282.     .XXXX.. $&
  283.     XX..XX. $&
  284.     XX..XX. $&
  285.     XX..XX. $&
  286.     .XXXXXX
  287.   elseif ($1 == R) return $&
  288.     XXXXX. $&
  289.     XX..XX $&
  290.     XXXXX. $&
  291.     XX..XX $&
  292.     XX..XX
  293.   elseif ($1 == S) return $&
  294.     .XXXX. $&
  295.     XX.... $&
  296.     .XXXX. $&
  297.     ....XX $&
  298.     XXXXX.
  299.   elseif ($1 == T) return $&
  300.     XXXXXX $&
  301.     ..XX.. $&
  302.     ..XX.. $&
  303.     ..XX.. $&
  304.     ..XX..
  305.   elseif ($1 == U) return $&
  306.     XX..XX $&
  307.     XX..XX $&
  308.     XX..XX $&
  309.     XX..XX $&
  310.     .XXXX.
  311.   elseif ($1 == V) return $&
  312.     XX....XX $&
  313.     XX....XX $&
  314.     .XX..XX. $&
  315.     ..XXXX.. $&
  316.     ...XX...
  317.   elseif ($1 == W) return $&
  318.     XX...XX $&
  319.     XX...XX $&
  320.     XX.X.XX $&
  321.     XXXXXXX $&
  322.     .XX.XX.
  323.   elseif ($1 == X) return $&
  324.     XX...XX $&
  325.     .XX.XX. $&
  326.     ..XXX.. $&
  327.     .XX.XX. $&
  328.     XX...XX
  329.   elseif ($1 == Y) return $&
  330.     XX..XX $&
  331.     XX..XX $&
  332.     .XXXX. $&
  333.     ..XX.. $&
  334.     ..XX..
  335.   elseif ($1 == Z) return $&
  336.     XXXXXX $&
  337.     ...XX. $&
  338.     ..XX.. $&
  339.     .XX... $&
  340.     XXXXXX
  341.   elseif ($1 == $chr(35)) return $&
  342.     .XX..XX. $&
  343.     XXXXXXXX $&
  344.     .XX..XX. $&
  345.     XXXXXXXX $&
  346.     .XX..XX.
  347.   elseif ($1 == ') return $&
  348.     .XX $&
  349.     XX. $&
  350.     ... $&
  351.     ... $&
  352.     ...
  353.   elseif ($1 == ") return $&
  354.     XX..XX $&
  355.     XX..XX $&
  356.     ...... $&
  357.     ...... $&
  358.     ......
  359.   elseif ($1 == +) return $&
  360.     ...... $&
  361.     ..XX.. $&
  362.     XXXXXX $&
  363.     ..XX.. $&
  364.     ......
  365.   elseif ($1 == =) return $&
  366.     ...... $&
  367.     XXXXXX $&
  368.     ...... $&
  369.     XXXXXX $&
  370.     ......
  371.   elseif ($1 == -) return $&
  372.     ...... $&
  373.     ...... $&
  374.     XXXXXX $&
  375.     ...... $&
  376.     ......
  377.   elseif ($1 == _) return $&
  378.     ...... $&
  379.     ...... $&
  380.     ...... $&
  381.     ...... $&
  382.     XXXXXX
  383.   elseif ($1 == ?) return $&
  384.     XXXXXX $&
  385.     ...... $&
  386.     ...... $&
  387.     ...... $&
  388.     ......
  389.   elseif ($1 == ?) return $&
  390.     .XXX. $&
  391.     XX.XX $&
  392.     .XXX. $&
  393.     ..... $&
  394.     .....
  395.   elseif ($1 == :) return $&
  396.     .. $&
  397.     XX $&
  398.     .. $&
  399.     XX $&
  400.     ..
  401.   elseif ($1 == !) return $&
  402.     XX $&
  403.     XX $&
  404.     XX $&
  405.     .. $&
  406.     XX
  407.   elseif ($1 == ?) return $&
  408.     XXX. $&
  409.     ..XX $&
  410.     .XX. $&
  411.     .... $&
  412.     .XX.
  413.   elseif ($1 == .) return $&
  414.     .. $&
  415.     .. $&
  416.     .. $&
  417.     .. $&
  418.     XX
  419.   elseif ($1 == /) return $&
  420.     ....XX $&
  421.     ...XX. $&
  422.     ..XX.. $&
  423.     .XX... $&
  424.     XX....
  425.   elseif ($1 == \) return $&
  426.     XX.... $&
  427.     .XX... $&
  428.     ..XX.. $&
  429.     ...XX. $&
  430.     ....XX
  431.   elseif ($1 == $chr(40)) return $&
  432.     ...XX $&
  433.     .XX.. $&
  434.     XX... $&
  435.     .XX.. $&
  436.     ...XX
  437.   elseif ($1 == $chr(41)) return $&
  438.     XX... $&
  439.     ..XX. $&
  440.     ...XX $&
  441.     ..XX. $&
  442.     XX...
  443.   elseif ($1 == $chr(37)) return $&
  444.     XX..XX $&
  445.     ...XX. $&
  446.     ..XX.. $&
  447.     .XX... $&
  448.     XX..XX
  449.   elseif ($1 == [) return $&
  450.     XXXXX $&
  451.     XX... $&
  452.     XX... $&
  453.     XX... $&
  454.     XXXXX
  455.   elseif ($1 == ]) return $&
  456.     XXXXX $&
  457.     ...XX $&
  458.     ...XX $&
  459.     ...XX $&
  460.     XXXXX
  461.   elseif ($1 == |) return $&
  462.     .XX. $&
  463.     .XX. $&
  464.     .XX. $&
  465.     .XX. $&
  466.     .XX.
  467.   elseif ($1 == <) return $&
  468.     ....XX $&
  469.     ..XX.. $&
  470.     XX.... $&
  471.     ..XX.. $&
  472.     ....XX
  473.   elseif ($1 == >) return $&
  474.     XX.... $&
  475.     ..XX.. $&
  476.     ....XX $&
  477.     ..XX.. $&
  478.     XX....
  479.   elseif ($1 == ?) return $&
  480.     .... $&
  481.     .... $&
  482.     .XX. $&
  483.     ..XX $&
  484.     XXX.
  485.   elseif ($1 == ,) return $&
  486.     ... $&
  487.     ... $&
  488.     XXX $&
  489.     .XX $&
  490.     XX.
  491. }
  492.  
  493.  
  494. ; Returns all unsupported characters within a Big Text message
  495. ; Supported characters are a-z, space, digits, #'"+=?:!?./\()%-[]<>|?,
  496. alias bigtext.unsupp {
  497.   var %res, %dummy = $regsub($1-, /[]a-z  0-9# $+ $chr(44) $+ '+=?:!?./\\()%[|<>_?"?-]/igS, $null, %res)
  498.   return %res
  499. }
  500.  
  501. ; Returns $true if a space should be added between two characters,
  502. ;   or $false if not.
  503. ; Note: This is here only for aesthetic purposes. :)
  504. alias bigtext.kern {
  505.   var %res $true
  506.   if ($regex($1-, /^(.|[_GDSQL-]T|[TPFVY7/"]J|T\.|L[1Y\\"]|[LTK<[]-|-[]>%\\]|S1|T4|\?\.|\.\?|[467L\\]?|?[J/]|L'|\/\/|\\\\|?J|[_?]?|[?T_]_|>\.|\.<)$/i)) %res = $false
  507.   return %res
  508. }
  509.  
  510. ; Takes an input string of the form:
  511. ; .XX..XX....XX.XX.XXXXX
  512. ; And formats it for display.
  513. alias bigtext.format {
  514.   var %res, %i 1, %previous 0, %current, %curcolor, %colregex /^(\d\d?(?:,\d\d?)?)/
  515.   while (%i <= $len($1-)) {
  516.     if ($mid($1-, %i, 1) == $chr(3)) {
  517.       if ($regex(mtcol, $mid($1-, $calc(%i + 1), $mid($1-, $calc(%i + 1), 0)), %colregex)) {
  518.         if ($gettok($regml(mtcol, 1), 1, 44) != %curcolor) {
  519.           %curcolor = $gettok($regml(mtcol, 1), 1, 44)
  520.           if (%i != 1) && ($mid($1-, $calc(%i - 1), 1) == X) %res = %res $+ $chr(15)
  521.         }
  522.         inc %i $len($regml(mtcol, 1))
  523.       }
  524.       elseif (%curcolor) {
  525.         %curcolor =
  526.         if (%i != 1) && ($mid($1-, $calc(%i - 1), 1) == X) %res = %res $+ $chr(15)
  527.       }
  528.     }
  529.     else {
  530.       %current = $iif($mid($1-, %i, 1) == ., 0, 1)
  531.       if (%previous != %current) {
  532.         %previous = %current
  533.         if (%curcolor) {
  534.           if (%current) %res = %res $+ $chr(3) $+ %curcolor $+ , $+ %curcolor
  535.           else %res = %res $+ $chr(3)
  536.         }
  537.         else %res = %res $+ $chr(22)
  538.       }
  539.       %res = %res $+ $chr(160)
  540.     }
  541.     inc %i
  542.   }
  543.   return %res
  544. }
  545.  
  546. alias mtrainbow //mt $rainbow( $+ $1- $+ )
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top