Advertisement
makimaki

Untitled

May 23rd, 2010
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.88 KB | None | 0 0
  1. alias hex {
  2.   if ($isid) {
  3.     var %r = $1,%g = $2,%b = $3
  4.     if ($len(%r) == 1) { %r = 0 $+ %r }
  5.     if ($len(%g) == 1) { %g = 0 $+ %g }
  6.     if ($len(%b) == 1) { %b = 0 $+ %b }
  7.     var %i 1
  8.     while (%i <= 3) {
  9.       var %calc = $calc($iif(%i == 1,%r,$iif(%i == 2,%g,%b)) / 16)
  10.       if ($len($iif(%i == 1,%r,$iif(%i == 2,%g,%b)))) { var %remamount = - $+ $calc($len($iif(%i == 1,%r,$iif(%i == 2,%g,%b))) -1) }
  11.       var %return = %return $+ $converthex($int(%calc),$int(%calc)) $+ $converthex($int(%calc),$int($calc($right(%calc,%remamount) *16)))
  12.       inc %i
  13.     }
  14.     return $chr(35) $+ %return
  15.   }
  16. }
  17. alias converthex {
  18.   if ($isid) {
  19.     var %even = 0,2,4,6,8,0,10,12,14
  20.     var %odd = 1,3,5,7,9,11,13,15
  21.     if ($istok(%even,$1,44)) { return $mid(0123456789ABCDEF,$calc($2 +1),1) }
  22.     if ($istok(%odd,$1,44)) { return $mid(0123456789ABCDEF,$calc($2 +1),1) }
  23.   }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement