mIRC Homepage
Posted By: pouncer buzzen roomnames - 04/09/06 06:08 PM
for e.g.. on buzzen this room:

%#MIRAGE

on webchat it is

http://www.buzzen.com/chat/chatroom.php?rhx=4d4952414745

my question is how do i get from MIRAGE to 4d4952414745
because i want a small alias from converting the %#roomname into a browser link
Posted By: hixxy Re: buzzen roomnames - 04/09/06 06:20 PM
Code:
alias tohex { return $regsubex($1,/(.)/g,$base($asc(\t),10,16)) }


$tohex(MIRAGE) = 4d4952414745
Posted By: pouncer Re: buzzen roomnames - 04/09/06 10:33 PM
thanks alot mate!!

but will that only work on 6.2?
is there a way so that it can work for all mircS?
Posted By: hixxy Re: buzzen roomnames - 05/09/06 05:59 AM
It won't work on all versions but it should work back as far as 6.03 (that's the version I started using) and maybe before.

Code:
alias tohex { 
  var %hex, %i = 1
  while ($mid($1,%i,1) != $null) {
    %hex = %hex $+ $base($asc($ifmatch),10,16)
    inc %i
  }
  return %hex
}
Posted By: pouncer Re: buzzen roomnames - 05/09/06 10:23 AM
thanks mate, awesome.

will it also work if the roomname is like

%#Hello\bThere
Posted By: hixxy Re: buzzen roomnames - 05/09/06 10:33 AM
I take it the \b is a space?

Code:
alias tohex { 
  var %hex, %i = 1, %1 = $replace($1,\b,$chr(32))
  if (% $+ #* iswm %1) { %1 = $mid(%1,2) }
  while ($mid(%1,%i,1) != $null) {
    %hex = %hex $+ $base($asc($ifmatch),10,16)
    inc %i
  }
  return $eval(%#,0) $+ %hex
}
© mIRC Discussion Forums