on $*:text:/(dns|calc)/iS:#:{
if $left($1,1) != %c { return }
if $regml(1) == dns {
if $0 < 2 { msg # Format is !dns yahoo.com }
else {
msg # Performing DNS on $2.
set -u99 %dnshost. $+ $2 # DNS for $2:
.dns $2
}
return
}
msg # Answer = $calc($replace($2-,pi,$pi))
}
on *:dns:{
if $var($+(%,dnshost.,$dns(0).addr),1) {
var %a = $($ifmatch,2)
unset $ifmatch
msg %a $iif($dns(1).ip,$ifmatch,Not resolved)
halt
}
elseif $var($+(%,dnshost.,$dns(0).ip),1) {
var %a = $($ifmatch,2)
unset $ifmatch
msg %a $iif($dns(1).addr,$ifmatch,Not resolved)
halt
}
}