About half a year I began writing a little mIRC script which would make fancy big-lettered text of specified input, and today I want to present my 'masterpiece' to the public :D
I've seen a few 'fancy text' or 'rainbow text' scrips on this site and I've decided to put those together.
The idea was simple: I saw this fancy text thing on some websites and quickly ported it into a mIRC script and added rainbow colors.
Included features:
A screenshot can be viewed at:
http://pasteboard.co/1yNpbY8n.bmp
Please let me know if you have any suggestions as to what features you would like to be added or if you experience any bugs.
;;;;;;;;;;;;;;;;;;;;
;;;;**MADE**BY**;;;;
;;;;****SARA****;;;;
;;;;;;;;;;;;;;;;;;;;
menu query,nicklist,channel {
-
Big Letters
.Adjust Settings
..Size
...$iif(%bl.size == large || %bl.size == $null,$style(1)) Large:{ set %bl.size large | echo Size was set to %bl.size }
...$iif(%bl.size == small,$style(1)) Small:{ set %bl.size small | echo Size was set to %bl.size }
..Border
...$iif(%bl.border == single || %bl.border == $null, $style(1)) Single:{ set %bl.border single | echo Border was set to %bl.border }
...$iif(%bl.border == double,$style(1)) Double:{ set %bl.border double | echo Border was set to %bl.border }
...$iif(%bl.border == thin,$style(1)) Thin: { set %bl.border thin | echo Border was set to %bl.border }
...$iif(%bl.border == round,$style(1)) Round:{ set %bl.border round | echo Border was set to %bl.border }
..Style
...$iif(%bl.margin == regular || %bl.margin == $null,$style(1)) Regular:{ set %bl.margin regular | echo Letters will be displayed normally }
...$iif(%bl.margin == close,$style(1)) Close:{ set %bl.margin close | echo Letters will be pushed close together }
..Colors
...$iif(%bl.color == black || %bl.color == $null, $style(1)) Black: { set %bl.color black | echo Letters will be displayed in black }
...$iif(%bl.color == rainbowv, $style(1)) Rainbow V: { set %bl.color rainbowv | echo Letters will be displayed in rainbow colors vertically }
...$iif(%bl.color == rainbowh, $style(1)) Rainbow H: { set %bl.color rainbowh | echo Letters will be displayed in rainbow colors horizontally }
...-
...$iif(%bl.white || %bl.white == $null, $style(1)) White Spacers: { set %bl.white $iif(%bl.white || %bl.white == $null, 0, 1) | echo Letters will be displayed with $iif(%bl.white, white, visible) spacers }
.-
.Make Big Letters:{
if (%bl.size == $null) set %bl.size large
if (%bl.border == $null) set %bl.border single
if (%bl.margin == $null) set %bl.margin regular
if (%bl.white == $null) set %bl.white 1
$makebig($$?="Enter Text for Big Letters:") }
}
alias makebig {
var %x = $len($1-),%y = 1, %letters
while (%y <= %x) {
if (%bl.size == large) %letters = %letters $+ $makeletter($mid($1, %y, 1)) $+ $chr(44)
if (%bl.size == small) %letters = %letters $+ $makesmallletter($mid($1, %y, 1)) $+ $chr(44)
inc %y
}
if (%bl.margin == close) {
var %lcnt = 1
:loop
if ($numtok(%letters, 44) <= 1) goto out
var %itl = $len(%letters), %itc = 1, %itt = 1
:itloop
var %itch = $mid(%letters, %itc, 1)
if (%itch == $chr(44)) {
if ($numtok(%letters, 44) == 2) %letters = $makecloser($gettok(%letters, 1, 44), $gettok(%letters, 2, 44))
else if (%itt == 2) %letters = $makecloser($gettok(%letters, 1, 44), $gettok(%letters, 2, 44)) $+ $mid(%letters, %itc)
inc %itt
}
inc %itc
if (%itc <= %itl) goto itloop
if ($numtok(%letters, 44) > 1) goto loop
:out
}
var %out = $mid($gettok(%letters, 1, 44), 2)
var %height = $numtok(%out, $asc(v)), %count = $numtok(%letters, 44)
var %i = 1, %ii = 1, %new
:iloop
var %line, %o = 1
:oloop
var %item = $makeboxes($gettok(%letters, %o, 44))
var %subitem = $gettok(%item, %i, $asc(v))
if (%subitem == n) %subitem = y $+ %subitem
%line = %line $+ %subitem
inc %o
if (%o <= %count) goto oloop
var %cc = $len(%line) , %ci = 1, %cs
:cloop
var %cn = $mid(%line, %ci, 1)
%cs = $addtok(%cs, %cn, 44)
inc %ci
if (%ci <= %cc) goto cloop
if ($len(%cs) <= 1 ) dec %ii
else {
var %iii = %ii - 1, %cc = %iii + 2, %col = $gettok((0,4,13,6,12,10,11,9,8,7), %cc, 44)
%line = $trimend(%line)
if (%bl.color == rainbowh ) %line = $makerainbow(%line)
if (%bl.white) %line = $whitespacers(%line, $iif(%bl.color == rainbowv, %col, -1))
.timer 1 %iii say $iif(%bl.color == rainbowv, $+ %col) $+ %line
}
inc %i
inc %ii
if (%i <= $calc(%height + 1)) goto iloop
}
alias makesmallletter {
var %letters
if ($1 === A) %letters = 7--9v+79+v+46+v1313vnvn
if ($1 === a) %letters = nv7-9xv+519v1--3vnvn
if ($1 === B) %letters = 7--9v+79+v+79+v1--3vnvn
if ($1 === b) %letters = 79xv+19v+5+v1-3vnvn
if ($1 === C) %letters = 7-9v+73v+19v1-3vnvn
if ($1 === c) %letters = nv7-9v+-6v1-3vnvn
if ($1 === D) %letters = 7--9v199+v723+v1--3vnvn
if ($1 === d) %letters = x79v73+v+5+v1-3vnvn
if ($1 === E) %letters = 7-9v+83v+29v1-3vnvn
if ($1 === e) %letters = nv7-9v+26v1-3vnvn
if ($1 === F) %letters = 7--9v+-83v+73xv13xxvnvn
if ($1 === f) %letters = 7-9v+-6v+73v13xvnvn
if ($1 === G) %letters = 7--9v+7-6v+19+v1--3vnvn
if ($1 === g) %letters = nv7-9v+5+v49+v1-3vn
if ($1 === H) %letters = 7979v+13+v+79+v1313vnvn
if ($1 === h) %letters = 79xv+19v+++v123vnvn
if ($1 === I) %letters = 7--9v1643v7649v1--3vnvn
if ($1 === i) %letters = 79v46v++v13vnvn
if ($1 === J) %letters = x79vx++v76+v1-3vnvn
if ($1 === j) %letters = nvx79vx46v73+v1-3vn
if ($1 === K) %letters = 789v+73v+19v123vnvn
if ($1 === k) %letters = 79xv+49v4-6v123vnvn
if ($1 === L) %letters = 79xv++xv+19v1-3vnvn
if ($1 === l) %letters = nv79xv+19v1-3vnvn
if ($1 === M) %letters = 7-8-9v+++++v+++++v12-23vnvn
if ($1 === m) %letters = nv7--9v++++v1223vnvn
if ($1 === N) %letters = 7-89v++++v++++v12-3vnvn
if ($1 === n) %letters = nv7-89v++++v12-3vnvn
if ($1 === O) %letters = 7-9v+++v+++v1-3vnvn
if ($1 === o) %letters = nv7-9v+5+v1-3vnvn
if ($1 === P) %letters = 7-9v+5+v+73v13xvnvn
if ($1 === p) %letters = nv7-9v+5+v+73v13xvn
if ($1 === Q) %letters = 7--9v+79+v+13+v1-9+vxx13vn
if ($1 === q) %letters = nv7-9v+5+v19+vx13vn
if ($1 === R) %letters = 7-9v+5+v+96v123vnvn
if ($1 === r) %letters = nv789v+73v13xvnvn
if ($1 === S) %letters = 7--9v+--6v4--+v1--3vnvn
if ($1 === s) %letters = 7-9v+-6v4-+v1-3vnvn
if ($1 === T) %letters = 7--9v1973vx++xvx13xvnvn
if ($1 === t) %letters = 79xv+19v+76v1-3vnvn
if ($1 === U) %letters = 789v+++v+++v1-3vnvn
if ($1 === u) %letters = nv789v+++v1-3vnvn
if ($1 === V) %letters = 79x79v+183+v19+73vx1-3xvnvn
if ($1 === v) %letters = nv7-8-9v19+73vx1-3xvnvn
if ($1 === W) %letters = 78-89v+++++v+++++v1-2-3vnvn
if ($1 === w) %letters = nv7889v++++v1--3vnvn
if ($1 === X) %letters = 7979v1973v7319v1313vnvn
if ($1 === x) %letters = nv789v4+6v123vnvn
if ($1 === Y) %letters = 7-89v19++v729+v1--3vnvn
if ($1 === y) %letters = nv789v+++v49+v1-3vn
if ($1 === Z) %letters = 7--9v4--+v+--6v1--3vnvn
if ($1 === z) %letters = 7-9v4-+v+-6v1-3vnvn
if ($1 == 1) %letters = x79xv73+xv19+xvx++xv7319v1--3
if ($1 == 2) %letters = 7---9v+7-9+v1373+v7-373v++1-9v1---3
if ($1 == 3) %letters = 7---9v+7-9+v1373+v7919+v+1-3+v1---3
if ($1 == 4) %letters = 79x79v++x++v+1-3+v1--9+vxxx++vxxx13
if ($1 == 5) %letters = 7---9v+7--3v+1--9v1--9+v7--3+v1---3
if ($1 == 6) %letters = 7---9v+7--3v+1--9v+7-9+v+1-3+v1---3
if ($1 == 7) %letters = 7---9v+7-9+v1373+vxx+73vxx++xvxx13x
if ($1 == 8) %letters = 7---9v+7-9+v+1-3+v+7-9+v+1-3+v1---3
if ($1 == 9) %letters = 7---9v+7-9+v+1-3+v1--9+v7--3+v1---3
if ($1 == 0) %letters = 7---9v+7-9+v+++++v+++++v+1-3+v1---3
;punctuation: !, ?, ., ,, :, ;, ', ", +, -, =, (, ), /, \, space
if ($1 == $chr(33)) %letters = 79v++v++v46v13vn
if ($1 == $chr(63)) %letters = 7--9v1-9+vx773vx46xvx13xvn
if ($1 == $chr(46)) %letters = nvnv79v13vnvn
if ($1 == $chr(44)) %letters = nvnv79v16vx3vn
if ($1 == $chr(58)) %letters = nv79v46v13vnvn
if ($1 == $chr(59)) %letters = nv79v46v16vx3vn
if ($1 == $chr(39)) %letters = 79v++v13vnvnvnvn
if ($1 == $chr(34)) %letters = 789v+++v123vnvnvnvn
if ($1 == $chr(43)) %letters = x79xv7319v1973vx13xvnvnvn
if ($1 == $chr(45)) %letters = nv7--9v1--3vnvnvnvn
if ($1 == $chr(61)) %letters = nv7--9v4--6v1--3vnvnvn
if ($1 == $chr(40)) %letters = 7-9v+73v++xv+19v1-3vn
if ($1 == $chr(41)) %letters = 7-9v19+vx++v73+v1-3vn
if ($1 == $chr(47)) %letters = xx79vx73+v7373v+73xv13xxvn
if ($1 == $chr(92)) %letters = 79xxv+19xv1919vx19+vxx13vn
if ($1 == $chr(32)) %letters = nvnvxxvxxvnvn
;62 = ">", 60 = "<", 124 = "|" -> happy, sad, unsure smiley faces
if ($1 == $chr(62)) %letters = x789xvx123xv79x79v+1-3+v1---3vn
if ($1 == $chr(60)) %letters = x789xvx123xv7---9v+7-9+v13x13vn
if ($1 == $chr(124)) %letters = x789xvx123xv7---9v1---3vnvn
return %letters
}
alias makeletter {
var %letters
if ($1 === A) %letters = 7---9v+7-9+v++x++v+1-3+v+7-9+v13x13vnvn
if ($1 === a) %letters = nvnv7--9v+79+v+79+v1313vnvn
if ($1 === B) %letters = 7--9xv+79+xv+1319v+7-9+v+1-3+v1---3vnvn
if ($1 === b) %letters = 79xxv++xxv+1-9v+79+v+13+v1--3vnvn
if ($1 === C) %letters = 7---9v+7-9+v++x13v++x79v+1-3+v1---3vnvn
if ($1 === c) %letters = nvnv7--9v+7-3v+1-9v1--3vnvn
if ($1 === D) %letters = 7---9v1979+vx++++vx++++v7313+v1---3vnvn
if ($1 === d) %letters = xx79vxx++v7-3+v+79+v+13+v1--3vnvn
if ($1 === E) %letters = 7---9v+7--3v+1-9xv+7-3xv+1--9v1---3vnvn
if ($1 === e) %letters = nvnv7--9v+4-6v+4-6v1--3vnvn
if ($1 === F) %letters = 7---9v+7--3v+1-9xv+7-3xv++xxxv13xxxvnvn
if ($1 === f) %letters = x7-9vx+73v7319v1973vx++xvx13xvnvn
if ($1 === G) %letters = 7---9v+7-9+v++x13v++7-9v+12-+v1---3vnvn
if ($1 === g) %letters = nvnv7--9v+79+v+13+v1-9+v7-3+v1--3
if ($1 === H) %letters = 79x79v++x++v+1-3+v+7-9+v++x++v13x13vnvn
if ($1 === h) %letters = 79xxv++xxv+1-9v+79+v++++v1313vnvn
if ($1 === I) %letters = 7--9v1643vx++xvx++xv7649v1--3vnvn
if ($1 === i) %letters = 79v13v79v++v++v13vnvn
if ($1 === J) %letters = xx79vxx++vxx++v79++v+13+v1--3vnvn
if ($1 === j) %letters = x79vx13vx79vx++vx++vx++v73+v1-3
if ($1 === K) %letters = 797-9v+++73v+133xv+79+xv+++19v131-3vnvn
if ($1 === k) %letters = 79xxv++xxv++79v+133v+799v1313vnvn
if ($1 === L) %letters = 79xxxv++xxxv++xxxv++x79v+1-3+v1---3vnvn
if ($1 === l) %letters = 79xv++xv++xv++xv+19v1-3vnvn
if ($1 === M) %letters = 7-97-9v++13++v+4976+v++++++v++++++v131313vnvn
if ($1 === m) %letters = nvnv77-7-9v+7979+v++++++v131313vnvn
if ($1 === N) %letters = 7-9x79v++19++v+7913+v++19++v++x+++v13x1-3vnvn
if ($1 === n) %letters = nvnv77-9v+79+v++++v1313vnvn
if ($1 === O) %letters = 7---9v+7-9+v++x++v++x++v+1-3+v1---3vnvn
if ($1 === o) %letters = nvnv7--9v+79+v+13+v1--3vnvn
if ($1 === P) %letters = 7---9v+7-9+v+1-3+v+7--3v++xxxv13xxxvnvn
if ($1 === p) %letters = nvnv7--9v+79+v+13+v+7-3v++xxv13xx
if ($1 === Q) %letters = 7---9v+7-9+v++x++v++x++v+1-3+v1--9+vxxx13vn
if ($1 === q) %letters = nvnv7--9v+79+v+13+v1-9+vxx++vxx13
if ($1 === R) %letters = 7---9v+7-9+v+1-3+v+7973v+++19v131-3vnvn
if ($1 === r) %letters = nvnv779v+73v++xv13xvnvn
if ($1 === S) %letters = 7---9v+7-9+v+1--9v1--9+v+1-3+v1---3vnvn
if ($1 === s) %letters = nvnv7--9v+--6v4--+v1--3vnvn
if ($1 === T) %letters = 7----9v+7979+v13++13vxx++xxvxx++xxvxx13xxvnvn
if ($1 === t) %letters = x79xv7319v1973vx++xvx+19vx1-3vnvn
if ($1 === U) %letters = 79x79v++x++v++x++v++x++v+1-3+v1---3vnvn
if ($1 === u) %letters = nvnv7979v++++v+13+v1--3vnvn
if ($1 === V) %letters = 79xx79v+1973+v19++73vx+13+xvx1973xvxx13xxvnvn
if ($1 === v) %letters = nvnv7979v+13+v1973vx13xvnvn
if ($1 === W) %letters = 797979v++++++v++++++v+1313+v197973vx1313xvnvn
if ($1 === w) %letters = nvnv797979v+1313+v197973vx1313xvnvn
if ($1 === X) %letters = 7-97-9v191373vx1973xvx7319xv737919v1-31-3vnvn
if ($1 === x) %letters = nvnv7979v1553v7559v1313vnvn
if ($1 === Y) %letters = 79xx79v+1973+v191373vx1973xvxx++xxvxx13xxvnvn
if ($1 === y) %letters = nvnv79x79v++x++v+1-3+v1-973v7-3+xv1--3xvnvn
if ($1 === Z) %letters = 7----9v1--9-+vxx7373vx7373xv73-1-9v1----3vnvn
if ($1 === z) %letters = nvnv7--9v4--+v+--6v1--3vnvn
if ($1 === Ä) %letters = 79x79v42-26v+7-9+v+1-3+v+7-9+v13x13vnvn
if ($1 === ä) %letters = nv7979v4226v+79+v+79+v1313vnvn
if ($1 === Ö) %letters = 79x79v42-26v+7-9+v++x++v+1-3+v1---3vnvn
if ($1 === ö) %letters = nv7979v4226v+79+v+13+v1--3vnvn
if ($1 === Ü) %letters = 79x79v46x46v++x++v++x++v+1-3+v1---3vnvn
if ($1 === ü) %letters = nv7979v4646v++++v+13+v1--3vnvn
if ($1 == 1) %letters = x79xv73+xv19+xvx++xv7319v1--3vnvn
if ($1 == 2) %letters = 7---9v+7-9+v1373+vx7373v73x29v1---3vnvn
if ($1 == 3) %letters = 7---9v+7-9+v1373+v7919+v+1-3+v1---3vnvn
if ($1 == 4) %letters = 79x79v++x++v+1-3+v1--9+vxxx++vxxx13vnvn
if ($1 == 5) %letters = 7---9v+7--3v+1--9v1--9+v+1-3+v1---3vnvn
if ($1 == 6) %letters = 7---9v+7--3v+1--9v+7-9+v+1-3+v1---3vnvn
if ($1 == 7) %letters = 7---9v+7-9+v1373+vxx+73vxx++xvxx13xvnvn
if ($1 == 8) %letters = 7---9v+7-9+v+1-3+v+7-9+v+1-3+v1---3vnvn
if ($1 == 9) %letters = 7---9v+7-9+v+1-3+v1--9+v7--3+v1---3vnvn
if ($1 == 0) %letters = 7---9v+7-9+v+++++v+++++v+1-3+v1---3vnvn
;punctuation: #, !, ?, ., ,, :, ;, ', ", +, -, =, (, ), /, \, space
if ($1 == $chr(35)) %letters = x7979xv731319v197973v731319v197973vx1313xvnvn
if ($1 == $chr(33)) %letters = 79v++v++v13v79v13vnvn
if ($1 == $chr(63)) %letters = 7---9v+7-9+v1373+vxx+73vxx79xvxx13xvnvn
if ($1 == $chr(46)) %letters = nvnvnvnv79v13vnvn
if ($1 == $chr(44)) %letters = nvnvnvnv79v16vx3vn
if ($1 == $chr(58)) %letters = nvnv79v13v79v13vnvn
if ($1 == $chr(59)) %letters = nvnv79v13v79v16vx3vn
if ($1 == $chr(39)) %letters = 79v++v13vnvnvnvnvn
if ($1 == $chr(34)) %letters = 789v+++v123vnvnvnvnvn
if ($1 == $chr(43)) %letters = nvnvx79xv7319v1973vx13xvnvn
if ($1 == $chr(45)) %letters = nvnvnv7--9v1--3vnvnvn
if ($1 == $chr(61)) %letters = nvnv7--9v1--3v7--9v1--3vnvn
if ($1 == $chr(40)) %letters = xx7-9vx7373v7373xv+++xxv+++xxv1919xvx1919vxx1-3
if ($1 == $chr(41)) %letters = 7-9xxv1919xvx1919vxx+++vxx+++vx7373v7373xv1-3xx
if ($1 == $chr(42)) %letters = nvxx<<iNFO>>xxvnvxxMADExxBYxxvxSARABUNNIExvxTHExIRCWiZxvnvn
if ($1 == $chr(47)) %letters = xxxx7-9vxxx7373vxxx+++xvxx7373xvx7373xxvx+++xxxv7373xxxv1-3xxxx
if ($1 == $chr(92)) %letters = 7-9xxxxv1919xxxvx+++xxxvx1919xxvxx1919xvxxx+++xvxxx1919vxxxx1-3
if ($1 == $chr(32)) %letters = nvnvnvxxvxxvnvnvn
;62 = ">", 60 = "<", 124 = "|" -> happy, sad, unsure smiley faces
if ($1 == $chr(62)) %letters = nvx79xx79xvx13xx13xv79xxxx79v+19xx73+v191--373vx1----3xvn
if ($1 == $chr(60)) %letters = nvx79xx79xvx13xx13xvx7----9xv737--919v+73xx19+v13xxxx13vn
if ($1 == $chr(124)) %letters = nvx79xx79xvx13xx13xvnv7------9v1------3vnvn
return %letters
}
alias makecloser {
var %cnt = $numtok($1, $asc(v)), %i = 1, %newlist
:loop
var %left = $gettok($1, %i, $asc(v)), %right = $gettok($2, %i, $asc(v))
if ((%left == n) && (%right == n)) {
var %ld = $numtok($1, $asc(v)), %lmax = 1, %lm = 1
:lmloop
var %ln = $len($gettok($mid($1, 2), %lm, $asc(v)))
if (%ln > %lmax) %lmax = %ln
inc %lm
if (%lm <= %ld) goto lmloop
var %lcm = 1, %left
:lcloop
%left = %left $+ x
inc %lcm
if (%lcm <= %lmax) goto lcloop
var %rd = $numtok($2, $asc(v)), %rmax = 1, %rm = 1
:rmloop
var %rn = $len($gettok($mid($2, 2), %rm, $asc(v)))
if (%rn > %rmax) %rmax = %rn
inc %rm
if (%rm <= %rd) goto rmloop
var %rcm = 1, %right
:rcloop
%right = %right $+ x
inc %rcm
if (%rcm <= %rmax) goto rcloop
%newlist = %newlist $+ n $+ v
}
else {
if (%left == n) {
var %lld = $numtok($1, $asc(v)), %llmax = 1, %llm = 1
:llmloop
var %lln = $len($gettok($mid($1, 2), %llm, $asc(v)))
if (%lln > %llmax) %llmax = %lln
inc %llm
if (%llm <= %lld) goto llmloop
var %llcm = 1, %left
:llcloop
%left = %left $+ x
inc %llcm
if (%llcm <= %llmax) goto llcloop
}
else if (%right == n) {
var %rrd = $numtok($2, $asc(v)), %rrmax = 1, %rrm = 1
:rrmloop
var %rrn = $len($gettok($mid($2, 2), %rrm, $asc(v)))
if (%rrn > %rrmax) %rrmax = %rrn
inc %rrm
if (%rrm <= %rrd) goto rrmloop
var %rrcm = 1, %right
:rrcloop
%right = %right $+ x
inc %rrcm
if (%rrcm <= %rrmax) goto rrcloop
}
var %a = $mid(%left, $len(%left), 1), %b = $mid(%right, 1, 1), %m
if (%a == x) %m = %b
if (%b == x) %m = %a
if (%a == 9) { if (%b == 7) %m = 8 | if (%b == +) %m = 6 | if (%b == 1) %m = 5 | if (%b == 4) %m = 5 }
if (%a == +) { if (%b == 7) %m = 4 | if (%b == +) %m = + | if (%b == 1) %m = 4 | if (%b == 4) %m = 4 }
if (%a == 3) { if (%b == 7) %m = 5 | if (%b == +) %m = 6 | if (%b == 1) %m = 2 | if (%b == 4) %m = 5 }
if (%a == 6) { if (%b == 7) %m = 5 | if (%b == +) %m = 6 | if (%b == 1) %m = 5 | if (%b == 4) %m = 5 }
var %nt = $len(%left) - 1
var %newline = $mid(%left, 1, %nt) $+ %m $+ $mid(%right, 2)
%newlist = %newlist $+ %newline $+ v
}
inc %i
if (%i <= %cnt) goto loop
var %ndim = $len(%newlist) - 1
%newlist = $mid(%newlist, 1, %ndim)
return %newlist
}
alias makeboxes {
var %bs = ┗,┻,┛,┣,╋,┫,┏,┳,┓,┃,━
var %bd = ╚,╩,╝,╠,╬,╣,╔,╦,╗,║,═
var %bt = └,┴,┘,├,┼,┤,┌,┬,┐,│,─
var %br = ╰,┴,╯,├,┼,┤,╭,┬,╮,│,─
var %b = $iif(%bl.border == round, %br, $iif(%bl.border == thin, %bt, $iif(%bl.border == double, %bd, %bs)))
var %p = $iif(%bl.white, $iif(%bl.border == single, ─, ╋), $iif(%bl.border == single, ╋, ─))
var %l = $len($1-), %d = $numtok($1, $asc(v)), %i = 1, %new
:loop
var %c = $mid($1, %i, 1)
if (%c isnum) %new = %new $+ $gettok(%b, %c, 44)
else if (%c == +) %new = %new $+ $gettok(%b, 10, 44)
else if (%c == -) %new = %new $+ $gettok(%b, 11, 44)
else if (%c === x) %new = %new $+ %p
else if (%c === n) {
var %max = 1, %m = 1
:mloop
var %n = $len($gettok($1, %m, $asc(v)))
if (%n > %max) %max = %n
inc %m
if (%m <= %d) goto mloop
var %j = 1
:jloop
%new = %new $+ %p
inc %j
if (%j <= %max) goto jloop
}
else %new = %new $+ %c
inc %i
if (%i <= %l) goto loop
return %new
}
alias trimend {
var %len = $len($1), %r = 1, %new
:loop
var %item = $gettok($1, %r, $asc(v)), %i = $len(%item), %t = 1
while (%i > 0) {
var %c = $mid(%item, %i, 1)
if ((%c == ╋) || (%c == ─)) %t = $calc(%i - 1)
else %i = 0
dec %i
}
%new = %new $+ $iif(%t > 1, $mid(%item, 1, %t), %item)
inc %r
if (%r <= %len) goto loop
return %new
}
alias makerainbow {
var %cols = 4,13,6,12,10,11,9,8,7
var %c = $len($1), %i = 1, %new
:loop
var %a = $calc(%i % $numtok(%cols, 44)) + 1
%new = %new $+ $+ $gettok(%cols, %a, 44) $+ $mid($1, %i, 1)
inc %i
if (%i <= %c) goto loop
return %new
}
alias whitespacers {
var %c = $len($1), %i = 1, %new
:loop
%new = %new $+ $iif($mid($1, %i, 1) == $iif(%bl.border == single, ─, ╋), 0 $+ $chr(44) $+ 0) $+ $mid($1, %i, 1)
%new = %new $+ $iif($2 >= 0, $+ $2, $iif(%bl.color == black, ))
inc %i
if (%i <= %c) goto loop
return %new
}