mIRC Home    About    Download    Register    News    Help

Print Thread
IP update script #191590 12/12/07 02:04 PM
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
I got this crappy isp who refuses to set their dns records to allow for reverse dns resolving...

On a connect with mIRC this results in a
Code:
unable to resolve local host
error on DCC protocols.

So in order to dcc my eggdrops, i either have to enter my IP manual, or run my own coded alias that fetches my IP from whatismyip.com and put it into the "localinfo" variable using:
Code:
/localinfo $host %ip

However I am not totally satisfied with the way mIRC handles the setting of this var.
I can set it to whatever i want, but it wont take affect untill i manually open the option's menu.

How can i force my mIRC to use this variable immediately?

Thanks in advance smile

Re: IP update script [Re: Div] #191595 12/12/07 04:19 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
the variable %ip should be called immediately when requested, there should be no lag, so if your alias fetches the ip on whatsmyip and stores it has %ip your string should work buyt you maybe talking about $host.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: IP update script [Re: Div] #191596 12/12/07 04:35 PM
Joined: May 2007
Posts: 89
T
TropNul Offline
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
Originally Posted By: mIRC's Help file
Local Info

Your Local Host and IP Address are needed if you want to use the DCC capabilities of mIRC.

mIRC will try to look up these values by itself and display them in the Setup dialog. However, if you see the message Unable to resolve local host or you are unable to initiate DCC sessions, then changing the settings below might help.

Local Host

This is used to register with the server and may be the part of your email address after the @ sign, eg. if my email address is khaled@mirc.com, then I would enter mirc.com here.

If you leave this box empty then mIRC will try to get your local hostname by itself. However, if mIRC replies with the message Unable to get local host then you will have to fill in your local hostname manually. mIRC will then use whatever you have entered to get your IP address...

IP Address

This will normally be filled in by mIRC and is here mainly for your information. mIRC looks up your IP address and stores it in the mirc.ini file for future reference. This way it doesn't have to look it up every time you want to connect.

If mIRC is having trouble getting your IP address then you can enter this value manually and mIRC will assume that it is correct. If this value is wrong you will still be able to log on to IRC but you will not be able to initiate DCC Send/Chat sessions (you will only be able to accept them).

On connect, always get...

These options are here because of the different types of internet connections people have. Some people have a fixed Local hostname and IP address, other have a dynamic Local Hostname, others a dynamic IP address, and yet others have both. If you don't know what kind of connection you have, leave both of these checked.

Selecting Always get local host automatically turns on the Always get IP address option. De-selecting the Always get IP address option automatically turns off the Always get local host option.

Lookup Method

If you find that mIRC is not resolving your IP address correctly you might try changing from Normal to Server or vice versa, which might solve the problem.

With the Normal method, mIRC relies on your winsock to reply with the correct information.

With the Server method, mIRC looks up your local host through the IRC Server, and then performs a /dns on it to resolve it to an IP address.

The Server method will most likely be slower, you can tell when it has been completed when you see your local host name and IP address displayed in the status window.

Note: If changing the above switches still doesn't solve the problem, or you don't know what to enter for your local host or ip address, contact your internet provider or system administrator.

Originally Posted By: mIRC's Help file
/localinfo -uh [host ip]

Looks up and sets your local info settings. The -u switch performs a /userhost lookup, the -h switch does a normal lookup. If you wish, you can also set the local info manually by specifying the host and ip values.


Now, with all that being said (and I hope fully read wink ), maybe you should also use the command < /flushini DirectoryToMircIni/mirc.ini > to make sure that the "cached in memory" version of mirc.ini is updated immediately (because it says in the help file (see quote above) that localinfo is saved in mirc.ini).

Furthermore, the command < /localinfo > will try a lookup before updating mirc.ini. Why not write directly to the specified section/item in the mirc.ini once you obtain %ip ? Then, make a < /flushini DirectoryToMircIni/mirc.ini > to stay updated. And that's it.

Cordialement smile


tropnul
Re: IP update script [Re: TropNul] #191648 13/12/07 10:35 AM
Joined: Aug 2005
Posts: 31
D
Div Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 31
Yea thanks alot!

The flushini did the trick ;-)