dlsocool commented on a Page, mIRC Control Codes to HTML  -  Dec 01, 2010

If you are used while loop you needed to input inc %i see this code fallowing:

alias mirccc2html {
  var %stdin = $+($replace($mid($1,$calc($pos($1,:,2) + 1)),$chr(32),$lf),$chr(15)), %stdout, %LF = 0, %i = 1, %len = $len(%stdin)
  while (%i <= %len) {
    var %char = $mid(%stdin,%i,1), %i = %i + 1
    if (%char == $lf) var %LF = %LF + 1, %stdout = $+(%stdout,$iif(2 // %LF,&nbsp;,$lf))
    elseif (%char == $chr(2)) var %^B = $iif(%^B,$false,$true), %stdout = $+(%stdout,$iif(%^B,<b>,</b>))
    elseif (%char == $chr(29)) var %^I = $iif(%^I,$false,$true), %stdout = $+(%stdout,$iif(%^I,<i>,</i>))
    elseif (%char == $chr(31)) var %^U = $iif(%^U,$false,$true), %stdout = $+(%stdout,$iif(%^U,<u>,</u>))
    elseif (%char == $chr(22)) var %^R = $iif(%^R,$false,$true), %stdout = $+(%stdout,$iif(%^R,<span class="R">,</span>))
    elseif (%char == $chr(3)) {
      if (%^K) var %^K = $false, %stdout = $+(%stdout,</span>), %color, %background-color
      if ($mid(%stdin,%i,1) isnum) var %color = $base($v1,10,10,2), %i = %i + 1
      if ($mid(%stdin,%i,1) isnum) var %color = $base($+(%color,$v1),10,10,2), %i = %i + 1
      if ($mid(%stdin,%i,1) == ,) {
        var %i = %i + 1
        if ($mid(%stdin,%i,1) isnum) var %background-color = $base($v1,10,10,2), %i = %i + 1
        if ($mid(%stdin,%i,1) isnum) var %background-color = $base($+(%background-color,$v1),10,10,2), %i = %i + 1
      }
      if (%color) var %^K = $true, %stdout = $+(%stdout,<span class=" $+ $+(K,%color,%background-color) $+ ">)
    }
    elseif (%char == $chr(15)) {
      if (%^B) var %^B = $false, %stdout = $+(%stdout,</b>)
      if (%^I) var %^I = $false, %stdout = $+(%stdout,</i>)
      if (%^U) var %^U = $false, %stdout = $+(%stdout,</u>)
      if (%^R) var %^R = $false, %stdout = $+(%stdout,</span>)
      if (%^K) var %^K = $false, %stdout = $+(%stdout,</span>), %color, %background-color
    }
    else {
      var %LF = 0
      if (%char == &) var %stdout = $+(%stdout,&amp;)
      elseif (%char == <) var %stdout = $+(%stdout,&lt;)
      elseif (%char == >) var %stdout = $+(%stdout,&gt;)
      else var %stdout = $+(%stdout,%char)
    }
    inc %i
  }
  return $replace(%stdout,$lf,$chr(32))
}

if you forget this (inc %i) this script will have problem.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.