mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#43045 - 20/08/03 01:19 AM New Operator for if-then-else
Doomstars Offline
Fjord artisan

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

Top
#43046 - 20/08/03 01:23 AM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
And how does one define what a url is? There is no general way to do it. Every URL scheme defines its own format.

Top
#43047 - 20/08/03 05:58 AM Re: New Operator for if-then-else
CloCkWeRX Offline
Fjord artisan

Registered: 18/02/03
Posts: 309
Loc: Adelaide, Australia
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 }
}
}
_________________________
http://www.ahsonline.com.au/dod/FOAF.rdf

Top
#43048 - 20/08/03 06:02 AM Re: New Operator for if-then-else
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
You can already use $monkey($1,$2) in an if statement.

Top
#43049 - 20/08/03 09:13 AM Re: New Operator for if-then-else
CloCkWeRX Offline
Fjord artisan

Registered: 18/02/03
Posts: 309
Loc: Adelaide, Australia
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.
_________________________
http://www.ahsonline.com.au/dod/FOAF.rdf

Top
#43050 - 20/08/03 09:17 AM Re: New Operator for if-then-else
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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

Top
#43051 - 20/08/03 06:04 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
Operators require some form of precedence. That means mIRC would need some way to dynamically assign precedence.

Top
#43052 - 20/08/03 07:56 PM Re: New Operator for if-then-else
Doomstars Offline
Fjord artisan

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

Top
#43053 - 20/08/03 08:57 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

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

Top
#43054 - 20/08/03 09:17 PM Re: New Operator for if-then-else
Doomstars Offline
Fjord artisan

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

Top
#43055 - 20/08/03 09:27 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

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

Top
#43056 - 20/08/03 09:54 PM Re: New Operator for if-then-else
Doomstars Offline
Fjord artisan

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

Top
#43057 - 20/08/03 09:55 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
1 line is overly complex?

Top
#43058 - 20/08/03 09:56 PM Re: New Operator for if-then-else
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
what does the /i in regex do?
_________________________
new username: tidy_trax

Top
#43059 - 20/08/03 10:00 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

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

Top
#43060 - 20/08/03 10:01 PM Re: New Operator for if-then-else
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
ok thanks smile
_________________________
new username: tidy_trax

Top
#43061 - 20/08/03 10:17 PM Re: New Operator for if-then-else
Doomstars Offline
Fjord artisan

Registered: 09/12/02
Posts: 339
In my opinion it is complex when I personally think it should be built in.

Top
#43062 - 20/08/03 10:35 PM Re: New Operator for if-then-else
codemastr Offline
Hoopy frood

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


Top
#43063 - 21/08/03 03:24 AM Re: New Operator for if-then-else
Doomstars Offline
Fjord artisan

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

Top
#43064 - 23/08/03 09:20 PM Re: New Operator for if-then-else
cold Offline
Hoopy frood

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


Edited by cold (23/08/03 09:30 PM)
_________________________
* cold edits his posts 24/7

Top
Page 1 of 2 1 2 >