mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2005
Posts: 1
M
myk Offline OP
Mostly harmless
OP Offline
Mostly harmless
M
Joined: May 2005
Posts: 1
Hi all,

I've discovered that mIRC only supports turning http:// and ftp:// paths into hot clickable links.

We use mIRC at work and we frequently paste local network paths into the channel eg : <a href="file://server\somedir\anotherdir\filename.doc" target="_blank">file://server\somedir\anotherdir\filename.doc</a>

Is there a way I can hack the config files or use a script to support clicking on these links? Other clients (Miranda) can do it but we'd rather use mIRC!

I've googled and found nothing. Any assistance would be *much* appreciated! Thanks in advance!

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Agreed, I'd like to see this. But this should have been posted in the Feature Suggestions. smile

You could try this...

Code:
;Matches any line
on ^1:HOTLINK:*:#: {
  ;Narrows the matching down to file://
  if (*file://* iswm $hotline) {
    ;When you close the $input() and you move the mouse again near the hotlink you'll get the $input() box again.
    ;So, I set a var to auto unset in 10 seconds, if the var is still set you wont get annoyed with the $input() keep popping up.
    if (%tmp.link) return
    else {
      ;The var isn't set which means if you click yes, the link opens in internet explorer, you may change iexplore.exe to your browser exe name.
      if ($input(Visiting $hotline,y,Are you sure?)) run iexplore.exe $hotline
      ;We set our variable, you may change the 10 to a higher or lower number.
      set -u10 %tmp.link $true
    }
  }
  ;As we matched all lines, we add halt to stop seeing other links..
  ;What I mean is if you put your mouse over any word without halt you'll see the little finger cursor.
}


*Quick note: I think it was just my mIRC that wouldn't let me use /url instead of /run <browser.exe> so you might want to change it to that for a fuill syntax on that command type /help /url. It just wouldn't go for me.

Hope this helps.

-Andy

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I just had to post on this buggy alone,
You mentioned it but forgot the HALT at the bottom <snicker snicker>

Anyway...

Odd usage of hotlinking there (not wrong just different), normally you use the double click (non ^ option to trip the link)
Also you needed to get rid of the stuff not needed on the $hotline it contains all the text of the line , as in mine is [timestamp] <nick> text <a href="file://etc" target="_blank">file://etc</a>
$1 well be the ( striped smile ) text your hotlink was on tho smile so you could use that, as in...
Code:
on ^1:HOTLINK:*:#: {
  if (*file://* iswm $1) {
    if (%tmp.link == $1) halt
    else {
      if ($input(Visiting $1,y,Are you sure?)) run iexplore.exe $1
      set -u10 %tmp.link $1
    }
  }
  halt
}

* i made the variable the hotlink so if u pass over another it allows that, dont know if i like that tho, its pretty kaotic

I also cut this out of some code i wrote, and patched it up to work on its own, its not the best becuase well becuase its not LOL, i dont like how i cant figure a way to deal with spaces well.

Code:
on ^*:HOTLINK:file?//*:#:{ if (file://* !iswm $1) { halt } }
;
;^ Mirc dont like $($+(file,$chr(58),//*)) as the matchtext, never tried a regex as i suck at them
;
on  *:HOTLINK:file?//*:#:{ if (file://*  iswm $1) { if ($1 == $left($cb,$len($1))) { tokenize 13 $cb } | run iexplore.exe $1 } }
;
;^ use this if the link is in the middle of other text "this is the file file://server\folder\file.ext open it now"
;^ if the link has spaces in it then highlight it (mirc copy) and then click it "this is the file file://server\new folder\file.ext open it now"
;
; ********
; ** OR **
; ********
;
on  *:HOTLINK:file?//*:#:{ if (file://*  iswm $1) { tokenize 13 $gettok($strip($hotline),$+($gettok($hotlinepos,1,32),-),32) | run iexplore.exe $1 } }
;
;^ use this if the link is always at the end of the text "this is the file open it now file://server\folder\file.ext"
;^ use this if the link is always at the end of the text "this is the file open it now file://server\new folder\file.ext"
;


* I have spaces in my shared folder assignments "D Drive" etc so all my links always have spaces in frown

/me wonders if i make things hard for me on purpose

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I originally did add the halt in the code to see if it did as I said it would, just forgot to paste the halt in. mad

-Andy


Link Copied to Clipboard