Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;this is actually needed to bypass mIRC's parsing behavior of strtok(str, ":")
- alias urlreg return /((?:(?:(?:http|ftp|gopher)\72\/\/)|(?:www|ftp)\.)\S+)/Sig
- ;the coloring alias, blue (12), underline (31)
- alias urlcolor return $+($chr(3), 12, $chr(31), $1-, $chr(31), $chr(3))
- alias selfurlcolor return $+($chr(3), 12, $chr(31), $1-, $chr(31), $chr(3), 14)
- ;trigger for the regex event only
- on ^&$*:text:$($urlreg):*:{
- ;if we are in a channel, turn nick into @nick if applicable
- var %nick = $iif($chan, $nick($chan, $nick).pnick, $nick)
- ;color all the linkes using the predefined alias above
- var %msgs = $regsubex($1-, $urlreg, $urlcolor(\t))
- var %color = $cnick($nick).color
- if ( $nick isop $chan ) {
- %color = 5
- if (destin isin %nick) {
- %color = 4
- }
- }
- ;print the message, default timestamp, highlighting options, and nick coloring
- echo -tcrl normal $iif($chan, $v1, $nick) $+(<, $chr(3), %color, %nick, $chr(3), >) %msgs
- ;prevent mIRC's default echo
- haltdef
- }
- on &*:INPUT:*:{
- if ($regex($1-,$urlreg) > 0) {
- var %nick = $iif($chan, $nick($chan, $nick).pnick, $nick)
- var %msgs = $regsubex($1-, $urlreg, $selfurlcolor(\t))
- var %color = $cnick($nick).color
- if ( $nick isop $chan ) { %color = 5 }
- echo -atcr normal $+($chr(3), 14, <, $chr(3), %color, %nick, $chr(3), 14, >) %msgs
- .msg $iif($chan, $v1, $target) $1-
- haltdef
- }
- }
Add Comment
Please, Sign In to add comment