mIRC Home    About    Download    Register    News    Help

Topic Options
#52384 - 03/10/03 02:09 PM $country
Joakim Offline
Mostly harmless

Registered: 03/10/03
Posts: 1
Loc: Oslo, Norway
It should be a $country identifier in the next version. Then I can use it when for example someone joins a channel or something.

Top
#52385 - 03/10/03 02:31 PM Re: $country
DekuHaze Offline
Fjord artisan

Registered: 28/06/03
Posts: 384
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.

Top
#52386 - 03/10/03 02:33 PM Re: $country
Iori Offline
Hoopy frood

Registered: 30/08/03
Posts: 1831
This is easy enough to script, and isn't totally reliable anyway. (Where is .com/.net/.org/.tv/.etc ?) smile

Top
#52387 - 03/10/03 02:35 PM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
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?


Edited by cold (03/10/03 02:39 PM)
_________________________
* cold edits his posts 24/7

Top
#52388 - 03/10/03 02:47 PM Re: $country
DekuHaze Offline
Fjord artisan

Registered: 28/06/03
Posts: 384
But the whole purpose of the identifier is to obtain the country, not the network type...

Top
#52389 - 03/10/03 02:51 PM Re: $country
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
next you'll be asking for $phonenumber and $houseaddress smirk
_________________________
new username: tidy_trax

Top
#52390 - 03/10/03 02:52 PM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
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.


Edited by cold (03/10/03 02:57 PM)
_________________________
* cold edits his posts 24/7

Top
#52391 - 03/10/03 07:04 PM Re: $country
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
Yeah, you could return "commercial" But the identifier is $country... when did Commercial become a nation?

Top
#52392 - 03/10/03 07:10 PM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
Again, an unrelated and dispensable addition, if it's not clear yet..
_________________________
* cold edits his posts 24/7

Top
#52393 - 03/10/03 07:40 PM Re: $country
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
Rather than return null, I'd prefer "Commercial", "Network", "Organization", etc.
_________________________
-KingTomato

Top
#52394 - 03/10/03 08:20 PM Re: $country
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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?

Top
#52395 - 04/10/03 04:40 AM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
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.
_________________________
* cold edits his posts 24/7

Top
#52396 - 04/10/03 05:14 AM Re: $country
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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.

Top
#52397 - 04/10/03 05:22 AM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
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.
_________________________
* cold edits his posts 24/7

Top
#52398 - 04/10/03 05:30 AM Re: $country
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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.

Top
#52399 - 04/10/03 05:43 AM Re: $country
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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.

Top
#52400 - 04/10/03 05:45 AM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
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.
_________________________
* cold edits his posts 24/7

Top
#52401 - 05/10/03 11:34 AM Re: $country
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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

Top
#52402 - 05/10/03 11:58 AM Re: $country
cold Offline
Hoopy frood

Registered: 25/02/03
Posts: 810
Loc: Brazil
It's not only his isp, it's any hostname entered.
_________________________
* cold edits his posts 24/7

Top