$wrap control codes - 14/04/23 06:03 PM
I've wanted to report this bug for some time, but my laziness wouldn't let me. Since version 7.64 mIRC supports preserving colors in $wrap and since then it doesn't work correctly.
I will publish prints to better illustrate...
mIRC 7.63 $wrap - Here is expected behavior
https://snipboard.io/pHjnVr.jpg
mIRC 7.63 $wrap2 (available here http://hawkee.com/snippet/17956/) - Here correctly preserves the control codes
https://snipboard.io/sBAFze.jpg
Finally, mIRC 7.72 $wrap
https://snipboard.io/PhL4Bc.jpg
I will publish prints to better illustrate...
mIRC 7.63 $wrap - Here is expected behavior
Code
alias testwrap { set -l %frase 9,37 😺 37 13Testtest 9😻 37www.9testtest.com 9😽 13Testtest 9$Test 13 É o 1º projeto 3,8 100% 8,3 <12@8> 3,8 Brasileiro 12 rodando na rede 0,59 🧊 Fantom Opera 13Agora também no 40,15 IR41C . 59Canal do Telegram ⇨ 9https://t.me/testtest set -l %x 1 echo -ea %frase while $wrap(%frase, $window($active).font, $window($active).fontsize, 400, 1, %x) { echo -a $v1 inc %x } }
mIRC 7.63 $wrap2 (available here http://hawkee.com/snippet/17956/) - Here correctly preserves the control codes
Code
alias wrap2 { if (!$isid) return if ($3 !isnum) || ($4 !isnum) || ($5 !isnum) || (($6) && ($6 !isnum)) { echo -esc info * Invalid parameters: $!wrap2 halt } set -l %n $5 set -l %wrap $!wrap($1,$2,$3,$4,%n) if ($6 != $null) { %n = $6 %wrap = $!wrap($1,$2,$3,$4,$5,%n) } if (%n < 1) return [ [ %wrap ] ] set -l %t %n %n = 1 while (%n < %t) { set -l %m $gettok(%r $+ [ [ %wrap ] ],-1,15) set -l %r if (2 \\ $count(%m,$chr(2))) %r = $chr(2) if (2 \\ $count(%m,$chr(31))) %r = $+(%r,$chr(31)) if (2 \\ $count(%m,$chr(29))) %r = $+(%r,$chr(29)) if (2 \\ $count(%m,$chr(22))) %r = $+(%r,$chr(22)) set -l %x $count(%m,$chr(3)) if (!%x) goto b if (!$regex(k,$mid(%m,$pos(%m,$chr(3),%x),3),/^\x03(\d\d?)/)) goto b %r = $+(%r,$chr(3),$base($regml(k,1),10,10,2)) :a if ($regex(k,$mid(%m,$pos(%m,$chr(3),%x),6),/^\x03(\d\d?)(?:\x2c(\d\d?))?/)) && ($regml(k,2) != $null) %r = $+(%r,$chr(44),$base($v1,10,10,2)) elseif ($regml(k,0) == 1) && (%x > 1) { dec %x goto a } :b inc %n } if ([ [ %wrap ] ] != $null) return %r $+ $v1 } alias testwrap { set -l %frase 9,37 😺 37 13Testtest 9😻 37www.9testtest.com 9😽 13Testtest 9$Test 13 É o 1º projeto 3,8 100% 8,3 <12@8> 3,8 Brasileiro 12 rodando na rede 0,59 🧊 Fantom Opera 13Agora também no 40,15 IR41C . 59Canal do Telegram ⇨ 9https://t.me/testtest set -l %x 1 echo -ea %frase while $wrap2(%frase, $window($active).font, $window($active).fontsize, 400, 1, %x) { echo -a $v1 inc %x } }
Finally, mIRC 7.72 $wrap
Code
alias testwrap { set -l %frase 9,37 😺 37 13Testtest 9😻 37www.9testtest.com 9😽 13Testtest 9$Test 13 É o 1º projeto 3,8 100% 8,3 <12@8> 3,8 Brasileiro 12 rodando na rede 0,59 🧊 Fantom Opera 13Agora também no 40,15 IR41C . 59Canal do Telegram ⇨ 9https://t.me/testtest set -l %bold $iif($window($active).fontbold, 1, 0) set -l %italic $iif($window($active).fontitalic, 1, 0) set -l %x 1 echo -ea %frase while $wrap(%frase, $window($active).font, $window($active).fontsize, 400, $+(b,%bold,i,%italic,p1t1w1), %x) { echo -a $v1 inc %x } }