mIRC Homepage
Posted By: Joakim $country - 03/10/03 01:09 PM
It should be a $country identifier in the next version. Then I can use it when for example someone joins a channel or something.
Posted By: DekuHaze Re: $country - 03/10/03 01:31 PM
Hm. The only country-specific info you get from IRC is from the user's host address. This $country identifier wouldn't work in the event that the person has an IP address that doesn't resolve to a host name or if they have a .com or .net address, which is very common.
Posted By: Iori Re: $country - 03/10/03 01:33 PM
This is easy enough to script, and isn't totally reliable anyway. (Where is .com/.net/.org/.tv/.etc ?) smile
Posted By: cold Re: $country - 03/10/03 01:35 PM
Well, it could just return $null if it's an IP, "commercial" if it's *.com, "network" if it's *.net. This is what the scripts I've seen before do, I think it's fine, isn't it?

Iori: "This is easy enough to script, ..."
Agreed, but many built-in features are as well. This one would require a big list with countries' names etc. I know this can be considered laziness, but it's fine, why not?
Posted By: DekuHaze Re: $country - 03/10/03 01:47 PM
But the whole purpose of the identifier is to obtain the country, not the network type...
Posted By: pheonix Re: $country - 03/10/03 01:51 PM
next you'll be asking for $phonenumber and $houseaddress smirk
Posted By: cold Re: $country - 03/10/03 01:52 PM
Edit: senselessness and grammar tweaking

It's just an "unrelated" addition I've been used to see. Even returning $null as well for all these possibilities would be fine. *.com, *.net, *.org, *.tv etc. aren't common in many countries other than USA, so it's really reliable.
Posted By: codemastr Re: $country - 03/10/03 06:04 PM
Yeah, you could return "commercial" But the identifier is $country... when did Commercial become a nation?
Posted By: cold Re: $country - 03/10/03 06:10 PM
Again, an unrelated and dispensable addition, if it's not clear yet..
Posted By: KingTomato Re: $country - 03/10/03 06:40 PM
Rather than return null, I'd prefer "Commercial", "Network", "Organization", etc.
Posted By: codemastr Re: $country - 03/10/03 07:20 PM
Ok, and what does it return if it's an IP? What about on networks that mask hosts? Where (for example in Unreal) it is .IP if it is a masked IP, others have a 'random' hex number, etc. It just seems utterly useless to me. I mean first off, it isn't practical. What happens if a new TLD is created? Say NewNation is officially recognized, and given .nn as the TLD. mIRC will of course have to return $null since it does not know of this TLD. The solution is to teach mIRC about this. That means mIRC is going to need something like a tlds.ini so that users can add new entries if new tlds are created.

So basically, that means we're building a 1 line script into mIRC (since it will have to have the tlds.ini that a script to do it would have anyway). So we have just added:

alias country {
return $readini(tlds.ini,tlds,$gettok($address($1,1),$numtok($address($1,1),46),46))
}

Is that really so hard it is worth doing internally?
Posted By: cold Re: $country - 04/10/03 03:40 AM
Well it being easy to script or not is definitely not the point. This doesn't determine anything when talking about built-in features, take $ord() as one of many examples.
About it not being applicable, these situations you mentioned are some fine examples, but they're not all. People just won't use it if it's not needed, yet other people will need it for their uses (not only IRC-related ones, BTW).
An scripted identifier would be easier than what you posted, but anyway, I can see this suggestion being used by many people without the need to be connected to each other or figure it out with their basic scripting.
So, although I don't see a real *need* for this simple feature, it's still a fair suggestion IMO.
Posted By: codemastr Re: $country - 04/10/03 04:14 AM
There are only two types of script I've ever seen use anything like this, the first:
"* Join/#chan: codemastr (country: United States) type of scripts.
The second:
!country .it

$ord, which you brought up, does not have merely two purposes, it can be used in a wide range of applications. Things that come to mind right now, any game scripts. "$nick is in $ord(%place) place!." Kick scripts, "You are the $ord(%kickcount) person I kicked." Virtually any counter that is displayed can make use of $ord. This is not true of $country, it exists only to serve a very specific purpose. I can't see any purposes other than the two I mentioned.

Now, if the new plan is "if even one person needs it, add it" well then don't be suprised when other common scripts are asked to be made built-in. Things I can see right now that I'm sure someone could equally make an argument for:
/thank [-sm [+ohv]] [msg]
Sends a "thank you" message on the given action, e.g.:
/thank -m +o Hey $nick thanks for the +o!
/thank -s Hey $nick thanks for $file!
/thank -m +v Hey $nick thanks for the +v!
etc.

$urldecode(text)/$urlencode(text), e.g.:
//echo -a $urldecode(http://www.something.com/%20test)
//sockwrite httpsock Location: $urlencode(the file***.ext)
etc.

$htmldecode(text)/$htmlencode(text), e.g.:
//echo -a $htmldecode(&)
//echo -a $htmlencode(&)

Those are just some examples. Would each of those be useful to some people? Of course. The thing is, their usefulness is confined to a very small set of scripts. What it comes down to is, should 99% of scripts be made slower in order to make 1% of the scripts easier to make? I don't think so. Like I said, $country has two applications that I can think of. There are literally thousands of scripts available, I think we mIRC should focus on providing features that will be useful to the masses, not to one guy.
Posted By: cold Re: $country - 04/10/03 04:22 AM
There are more, you just didn't see them as you said. Checking addresses other than IRC hostnames is one of them. You just can't say you know all its usages.
About the "new plan" stuff, I don't need to comment it. I was very clear when I said many people. smile

Well, no need to continue arguing, it just wouldn't stop.
Posted By: codemastr Re: $country - 04/10/03 04:30 AM
Quote:
There are more, you just didn't see them as you said. Checking addresses other than IRC hostnames is one of them.

Yeah that's called a nonparticular hypothetical use. I'm talking about real applications. Give me an example when you'd want to do that. A "type in a host and I'll tell you the country" script? Well thats the same thing as !country, it's just got a few more bells and whistles.

Quote:
You just can't say you know all its usages.

I never said I know all the uses, I said the uses I could think of, however you haven't provided any other uses, so all you've done is support what I've said.

Quote:
I was very clear when I said many people.

Yeah, you were very clear, but just because you are clear doesn't mean you are right. I can very clearly state that the earth is flat. That, however, doesn't make it so. Again I say, provide proof. Show me existing scripts where people wrote their own $country and are using it for things differently than I said. I doubt you could find any such scripts.

If I'm wrong, that's fine, but prove me wrong, don't simply say "I think you're wrong and I'm not going to show you how." If I'm wrong, show me how and why I'm wrong with some real evidence.
Posted By: codemastr Re: $country - 04/10/03 04:43 AM
Thank you for not reading my message at all and instead replying with statements that have nothing to do with what I've said.

Why should we end it btw? Because you don't want to take the time to substantiate your claims? If you can't provide facts, don't pretend to have them. It's not my fault if you make a claim that you can't back up with facts.
Posted By: cold Re: $country - 04/10/03 04:45 AM
So now I should prove that I've seen many people using a country identifier? LOL grin

You see bells and whistles in a !country thing or the example I did, then is it automatically not something valuable for anyone? Well, I see bells and whistles in your $ord() example, but I won't ask you to "prove" me that it's worth it - I already know it has its place, the same place a $country identifier would have, IMO.

End of discussion.
Posted By: DaveC Re: $country - 05/10/03 10:34 AM
Wouldnt it be $country pulled that data from what country you set windows (if your using it) up to be in, rather than trying to chop up some ip addy, ok so 75% of pc's on earth not in the USA are likely set to be there anyway, well pooha, I have to admit i cant think of a usefull aplication for $country either! Just thought id mention that i thought he ment the setup country on the pc, rather than his isp
Posted By: cold Re: $country - 05/10/03 10:58 AM
It's not only his isp, it's any hostname entered.
© mIRC Discussion Forums