mIRC Home    About    Download    Register    News    Help

Print Thread
ON DNS #22115 03/05/03 02:53 PM
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
How do I get mIRC to set a %variable when I type /dns blah-blah

on *:DNS: { var %dnsname (what to have here ?) }
$2, $DNSIP(N) nothing seem to work frown

The script should look like this:
Code:
on *:DNS: { 
  set %dnsname (missing variable)
  if ((!$iaddress) && (!$naddress) && (!$raddress)) { echo -a cant resolve %dnsname }
  else {
    echo -a -× Displaying DNS-Info for: %dnsname
    if $iaddress { echo -a IP Address $iaddress
    if $naddress { echo -a Address $naddress } 
    if $raddress { echo -a Address $raddress } 
  }
  haltdef
}


all works cept the %variable isnt set, and I ran out of ideas frown


Re: ON DNS #22116 03/05/03 04:13 PM
Joined: May 2003
Posts: 5
M
milk Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
M
Joined: May 2003
Posts: 5
See help on mIRC, topic: On DNS.. i think you'll find your answer there.

(hint)
The $dns(N) identifier
This identifier can be used only in the on DNS event, and returns the address that was resolved and any associated IP addresses.



-mike
Re: ON DNS #22117 03/05/03 04:59 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Use Search. There is a lot of DNS scripts posted.. smile

Re: ON DNS #22118 03/05/03 05:09 PM
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
tra la la la youre missing the point... Im not looking for "what is resolved" im looking to set an variable of my input (what I dns)

eg.
/dns Jesper (%var Jesper)
/dns www.mirc.com (%var www.mirc.com)
/dns jibberish (%var jibberish)
/dns "nonexistant user/host" (%var my input)

As I said the rest of the script works, and $DNSIP(N) is useless unless something is resolved ( what I need is a %var before it evens starts to resolve) wink
I do read mirc's help file, more than a preacher reads his bible :P but in many cases it does not carry enuff of examples / lacks the description of what a command can or cant do. wink

And I did use search here, but I didnt find any usefull results.

Re: ON DNS #22119 03/05/03 05:31 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Like I said use Search, there are a lot posted, from them you could have found your answer. laugh

Code:
on *:dns: {
  if !$raddress {
    if $dns(0).nick || $iaddress || $dns(0).addr { var %a = $ifmatch }
    if $dns(0).nick {
      if $iaddress || $dns(0).addr { var %b = ( $+ $ifmatch $+ ) }
      else var %b = (No such nick)
    }
    echo $colour(h) -ta DNS lookup on %a failed. %b
    halt
  }
  echo $colour(h) -ta DNS lookup on $iif($dns(1).nick,$ifmatch,$dns(1)) successful.
  echo $colour(h) -ta Named address: $dns(1).addr
  var %i = 1 {
    while $dns(%i) {
      echo $colour(h) -ta IP address: $dns(%i).ip
      inc %i
    }
    halt
  }
}

Re: ON DNS #22120 03/05/03 07:06 PM
Joined: Jan 2003
Posts: 96
J
Jesper Offline OP
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2003
Posts: 96
many thanks smile

Re: ON DNS #22121 03/05/03 07:24 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
NP grin