mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
on *:TEXT:*MyNick*:#: {
if ($nick == TheirNick) {
.notice $nick BlahBlahBlahBlahBlah
.notice $nick BlahBlahBlahBlahBlah
}
...
Okay so i want this simple scipt to only work on people with certain isp's. The only way I know is just by their nickname. How do I make a if statement that uses isps?

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
If you can see your ip with $ip then you could try and matcht he ISP with that.

Joined: Jan 2007
Posts: 31
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2007
Posts: 31
Hmm idk really what you mean.
I tho there was a way to make it so that the script will only work if it matches the users isp. cant I make it read of a txt file and just add the ips in there?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
A lot of networks hide the IP information or give you the option to have the information hidden, so unless you have IRCops access on the network, odds are that you will not be able to determine what ISP someone else is using.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You could match $address($nick,4) if you just want the general ISP.
See /help $address and /help $mask

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
The IP you would be looking for would be your own though.

You could connect to a site with a socket that will return your IP and/or ISP info.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: DJ_Sol
The IP you would be looking for would be your own though.

You could connect to a site with a socket that will return your IP and/or ISP info.

I think you're confused as to what he wants. Read his initial post again, perhaps?
From the look of it he wants to check if a person who highlights him/triggers the on TEXT event has a certain Internet Service Provider.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Ohhh quite right, thanks.

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
The best (but still not perfect) way to do this is pretty easy, really: http://ip-address.domaintools.com/myip.xml

so connect to ip-address.domaintools.com port 80, send the following:
Quote:
GET /myip.xml HTTP/1.1 $+ $crlf $+
host: ip-address.domaintools.com $+ $crlf $+ $crlf



then store all returned data, test the return value of $regex(isp,%data,/$\<isp\>([^<]*)\<\/isp\>^/) (if the return value is 0 then return because otherwise the user will end up with an ugly error message)... then to retrieve the ISP: $regml(isp,1)

edit: this is an example using their free "myip" xml API... to run a query on any IP you'll need to find some other service because this will only work for the IP that the script is running on...

Last edited by s00p; 02/10/09 12:55 PM.

Link Copied to Clipboard