mIRC Home    About    Download    Register    News    Help

Print Thread
#200124 28/05/08 03:37 PM
Joined: Aug 2006
Posts: 45
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 45
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?
}

DragonRyder #200126 28/05/08 04:36 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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
    }
  }
}

hixxy #200145 29/05/08 03:09 AM
Joined: Aug 2006
Posts: 45
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 45
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.

DragonRyder #200183 29/05/08 05:35 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
In regex format? Regex doesn't really have use here.


Link Copied to Clipboard