mIRC Home    About    Download    Register    News    Help

Print Thread
#213601 02/07/09 01:21 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'm needing some kind of a loop that will stop when the end results are already stored.
The information will be coming from the ON DNS event.

Basically, the user will issue /dns <host>, which will then return and address & ip from the ON DNS event.
If that address or ip is not already stored, then the information will be stored.
Next, the address and/or ip (which wasn't already stored) will be sent through the /dns command.
This process will continue until neither the address or the ip can be resolved or until both are already in the storage.

I hope I was clear in regards to what I'm trying to do.

RusselB #213852 10/07/09 07:15 AM
Joined: Oct 2008
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2008
Posts: 36
is this what you're looking for?

ON *:dns:{
if ($hget($+(",$mircdirdns.txt,"))) { .hload $+(",$mircdirdns.txt,") }
var %dns = $dns(0)
while (%dns > 0) {
if (!$hfind(dns,$dns(%dns).addr,0).data) {
echo -a Stored $dns(%dns).ip @ $dns(%dns).addr
.hadd -m dns $dns(%dns).ip $dns(%dns).addr
}
dec %dns
}
if (!$hfind(dns,$dns(%dns).ip,0)) {
echo -a Stored $dns(%dns).ip
.hadd -m dns $dns(%dns).ip
}
.hsave dns $+(",$Mircdirdns.txt,")
}


There's if in LIFE


Link Copied to Clipboard