mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
isurl

This would be useful for Hotlinks for example. Please let me know if there is a way to do this already, a simple way, not a complex way. Like... if ($1 isurl) just like ($1 isalnum) works.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
And how does one define what a url is? There is no general way to do it. Every URL scheme defines its own format.

Joined: Feb 2003
Posts: 309
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
To sidetrack:
what about the ability to call custom identifiers/aliases as comparison operators?
IE:
if ($1 $monkey $2) {
;..code..
}

alias monkey {
if ($1 == tail) {
if ($2 == tail) { return $true }
else { return $false }
}
}

Perhaps the above example isn't that great; but hows about this:
;Eval true if both have monkies have at least one foot smile
;monkey1 has feet
;monkey2 has a foot
;so
alias monkey {
if ($1 == feet) {
if ($2 == foot) { return $true }
else { return $false }
}
}

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can already use $monkey($1,$2) in an if statement.

Joined: Feb 2003
Posts: 309
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
Yes Yes I know but this would be nice, particularly if your useing stuff with commas in them (which are hard[read as 'effort filled'] to pass to identifiers)

Moreso if um...
I had more reasons.
Damn I have forgotten them

Oh well.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Not if you set them into %vars first and pass the %vars in the identifier.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Operators require some form of precedence. That means mIRC would need some way to dynamically assign precedence.

Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
Type "/help URL Catcher" while in mIRC. mIRC can tell already. I just want something that tells whether the word X is an URL, or not. If it were, and were shown in a window, you could double click on it and open it. But with HOTLINKS, that becomes a problem kind of. Hence why I suggested this.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Quote:
mIRC looks for URLs beginning with "http://", "ftp://", "gopher://", "www.", and "ftp.". mIRC also checks to make sure addresses are not added to a list if they already exist. Addresses longer than 256 characters are ignored.


alias isurl {
if ($regex($1-,/^((http://)|(ftp://)|(gopher://)|(www\.)|(ftp\.))/i) && $len($1-) < 257) return $true
return $false
}

$isurl(www.test.com) - $true
$isurl(http://www.test.com) - $true
$isurl(test) - $false
$isurl(blah blah blah) - $false

I really don't see why something like that has to be done internally when the script to do it yourself is 2 lines long.

Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
There's stuff in mIRC, that has been added, that could have the same thing said about it. It's still a suggestion. I think it would be worth it to have it built in.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well then please don't waste our time by saying something like:
Quote:
Please let me know if there is a way to do this already, a simple way, not a complex way.


When you really have no intention of actually using a solution when someone provides it.

Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
You misunderstood what I said. When I asked if there was a simple way to do it already, I meant an identifier or operator. If I missed it in the help. When I said not a complex way, I consider what you said to be overly complex.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
1 line is overly complex?

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
what does the /i in regex do?


new username: tidy_trax
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
it makes it case insensitive. So even though I have only http:// in the regex, HtTP:// would match it because the /i tells it to ignore case.

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
ok thanks smile


new username: tidy_trax
Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
In my opinion it is complex when I personally think it should be built in.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well that has to be the dumbest thing I've ever heard.

"I think mIRC should have a $gt because $gettok is long, I could just do alias gt, but thats too complex"


Joined: Dec 2002
Posts: 343
D
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 343
You probably still misunderstand what I'm saying. However, whether you understand or not, this will be my last post on this cause I don't care to argue anymore.

For one thing, I mentioned it as an operator originally. Cause it would be most valuable in ON HOTLINK. Currently I'm using if ($left($1,-2) isalnum) to do this, despite it being flawed in this method.

Second, I'd want it built in. I believe it would be useful in many occasions instead of people having to rely on scripting a custom identifier. Below are some examples. I may make some mistakes in the below, but you get the idea.

ON *:TEXT:*:#:{
if ($me !isop $chan) { halt }
var %a
while (%a < $gettok($1-,0,32)) {
inc %a
if ($gettok($1-,%a,32) isurl) { kick $chan $nick Advertising | halt }
}
}

ON ^*:HOTLINK:*:*:if ($1 isurl) { return } | else { halt }
ON *:HOTLINK:*:*:run c:\Program Files\Internet Explorer\iexplore.exe http://dictionary.reference.com/search?q= $+ $1

What happens when an URL is filled with colors and codes? Would what you said still work?

Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:

Well that has to be the dumbest thing I've ever heard.

"I think mIRC should have a $gt because $gettok is long, I could just do alias gt, but thats too complex"


I frequently read this board and can't even count how many thousands of times I've read you calling someone/something dumb or stupid. You say you come here to discuss as the description of the board says, but I'm yet to discover what is the value of this post of yours as a discussion here. Regardless of what your point is, no one here needs or wants to know what you think it's dumb, so I guess you can't say things like this here.

In this specific thread, the guy wants the identifier built-in, he thinks your solution is complex, so what? It's his view, not yours; you don't have the right to throw to him your personal view as a better one and diminish his one. It's simple.
I couldn't care less if you take the whole day to argue about it's general value as an utility - although it seemed there wasn't anything left to be discussed - as I can filter what I read; but I'm not the only one who has to do that almost everytime your nick appears and, sometimes, it's just excessively disgusting to read someone flaming the way you do (and I can see in other threads that I'm not the only one).

That said, please stop being rude here and there when you can't seem to convince a person. It's ridiculous, disgusting, it decreases both your credibility and the level of this board - this one being what a lot of people here are concerned with. People could lose the interest of posting suggestions if they expect someone to come, disagree and call them dumb for a reason they don't know yet.

This is my unique post about this here, as I don't want to disturb the thread anymore. Next ones could be private, if you reply and if I bother to reply back.
Of course, I'm scaling all these feelings and needs in its own proportion, which is the proportion of something coming from an Internet webboard. No need to think about me worrying too much about this issue, I'm perfectly fine.

Thanks

Last edited by cold; 23/08/03 08:30 PM.

* cold edits his posts 24/7
Page 1 of 2 1 2

Link Copied to Clipboard