A little more further in what you can do with this and using regex to filter links.
;Hooks right, selected, and double click events in channels for nicks, links and channels ;)
on *:HOTLINK:*:*: {
var %n $hotlink(match) ,%e $hotlink(event)
if (%n ison #) {
if (%e == rclick) { xdid -u nicklist 3 | xdid -c nicklist 3 $xfind(%n) | nicklist.popup }
elseif (%e == sclick) { xdid -u nicklist 3 | xdid -c nicklist 3 $xfind(%n) }
elseif (%e == dclick) { query %n }
}
elseif (%e == dclick) {
if ($regex(%n,/(^|\s|>)((https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim)) { URL $regml(2) }
elseif ($regex(%n,/(^|\s|>)(www\.[\S]+(\b|$))/gim)) { URL $+(http://,$regml(2)) }
elseif ($regex(%n,/(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/gim)) { url mailto: $+ $regml(1) }
elseif ($regex(%n,/(%#\w+)/g)) { JOIN $regml(1) }
} }
@Xcution nice, but try to add to hers/his instead of posting your own.
@Yama When you have long lists of matches like that, regex is a blessing. Something simple like:
if ($regex($1-,/\b(.+?\.(?:com|net|org|de|to|info|biz).+?)\b/SUi))
This will match any string with .com, .net, .org, etc and place that string in $regml(1), everything in either direction until it hits whitespace (space, end of line, etc).
I would also suggest not adding the "www." to the beginning, as my website doesn't even allow for it, and some others don't too. I've only ever come across one, though, that needed it.
Nice, but I only wanted hotlink for links without http:// or www.
Nicks and channels are working fine.