Advertisement
illpastethat

Big Text Script for l3eta

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