mIRC Homepage
Posted By: DragonRyder DNS - 28/05/08 03:37 PM
is it possible to write this shorter?

Code:
on &*:DNS:{
  set -u1 %:echo echo $color(info) -ti2 $+ $iif(($_isactive) && (@* !iswm $active), a, s)
  set -nu1 %::me $me | set -nu1 %::server $server | set -nu1 %::port $port
  set -nu1 %::pre 12.11.13.
  set -nu1 %::c1 00 | set -nu1 %::c2 11 | set -nu1 %::c3 13 | set -nu1 %::c4 12
  if ($dns(0)) {
    var %i = 1, %t = $dns(0)
    while (%i <= %t) {
      set -nu1 %::nick $dns(%i).nick
      set -nu1 %::address $dns(%i)
      set -nu1 %::iaddress $dns(%i).ip
      set -nu1 %::naddress $dns(%i).addr
      set -nu1 %::raddress $remtok($dns(%i).ip $dns(%i).addr, $dns(%i), 1, 32)
      %:echo 10.... 11Resolved 15~» 14 $+ $iif((%::raddress == %::iaddress), %::naddress, %::iaddress) $+ 15~» 11To 15~» 07 $+ %::raddress $+  | haltdef
      inc %i
    }
  }
  else {
    set -nu1 %::nick $nick
    set -nu1 %::address $address
  }
  unset %:echo %::nick %::address %::iaddress %::raddress %::naddress %::me %::server %::port %::pre %::c?
}
Posted By: hixxy Re: DNS - 28/05/08 04:36 PM
That looks like it's part of an MTS theme, so I wouldn't change that too much if I were you, but if you're using it stand alone you can make it much shorter:

Code:
on &*:DNS:{
  if ($dns(0)) {
    var %i = 1, %t = $dns(0)
    while (%i <= %t) {
      echo $color(info) -ti2 $+ $iif(($_isactive) && (@* !iswm $active), a, s) 10.... 11Resolved 15~» 14 $+ $iif(($remtok($dns(%i).ip $dns(%i).addr, $dns(%i), 1, 32) == $dns(%i).ip), $dns(%i).addr, $dns(%i).ip) $+ 15~» 11To 15~» 07 $+ $remtok($dns(%i).ip $dns(%i).addr, $dns(%i), 1, 32) $+  | haltdef
      inc %i
    }
  }
}
Posted By: DragonRyder Re: DNS - 29/05/08 03:09 AM
it is with my main script - but i have it as a stand alone on my bot script. is it possible to get this in regex format?

and btw - ty so much that works great.
Posted By: hixxy Re: DNS - 29/05/08 05:35 PM
In regex format? Regex doesn't really have use here.
© mIRC Discussion Forums