mIRC Home    About    Download    Register    News    Help

Print Thread
#98893 27/09/04 05:23 PM
Joined: Sep 2004
Posts: 3
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2004
Posts: 3
hello
i am needing some help here...

i need some mirc code to make it resolve an ip address quickly and to save it into a variable....
i tried the dns command but its too slow and i cant save the value to a variable....

it would be excelent something like this:

echo - $dns(domainname.com) %difport



txs

#98894 27/09/04 05:27 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
on *:DNS:{
var %n = $dns(0)
echo -a Found %n addresses
while (%n > 0) {
echo -a dns : $dns(%n)
echo -a nick : $dns(%n).nick
echo -a addr : $dns(%n).addr
echo -a ip : $dns(%n).ip

dec %n
}
}

not tested

Last edited by alkahol1k; 27/09/04 05:28 PM.
#98895 27/09/04 05:35 PM
Joined: Sep 2004
Posts: 3
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2004
Posts: 3
txs for replying... that was my first atempt but i need something to fit here:

elseif (HULL == $1) {
sockwrite -tn $sockname $+(:,$remove($sini(zird,hullname),$chr(32))) 155 %nick. [ $+ [ $sockname ] ] : $+ $dns(domainname.com) %difport
}

so, the information is needed quickly because if that ip isnt the real one the connection closes.
Also the resolved domain ip is dynamic... thats why it cant be checked just once, but everytime it goes there.

I was trying to avoid timers because they slow down the system.

txs again, you'r great! :tongue:

#98896 27/09/04 07:48 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Put what you had in the on DNS event. It is the only way you can have a code use the output of the /dns command. You also cannot make it go faster than it does, as the speed at which the /dns request is processed relies on a lot of factors that are totally out of your hands.

As for saving, use what is already suggested. Just move the code that uses the output from wherever you have it now into the on DNS event.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#98897 27/09/04 08:46 PM
Joined: Sep 2004
Posts: 3
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2004
Posts: 3
txs smile
you gave me an idea and it all works now

txs again! wink


Link Copied to Clipboard