|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Fri Jan 02, 2009 5:36 pm
clickable hyperlink url |
I made this after seeing nexala's because i wanted it to capture correctly and www.
Code: |
#TRIGGER {(%q)({http://|https://|ftp://|telnet://|www.}%x)(%q)} {#var htmll "%2";#SUBSTITUTE {~<A '%expand(@htmll,1)'>%1%expand(@htmll,1)%3~</A>}} |
It worked perfect.
Let me know any thoughts on it please and thanks :) |
|
|
|
chumppi Newbie
Joined: 04 Jan 2009 Posts: 8 Location: Vaasa, Finland
|
Posted: Sun Jan 04, 2009 9:28 pm |
It's perfect. Tried all kinds of tricky stuff with the links and still worked.
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Tue Jan 06, 2009 5:34 pm |
Ok, but what about: zuggsoft.com or even worse, ipchicken.co.uk ?
It wont pick up either of these. I can give you a variable that contains ALL the tlds (.com, .net, .org, .edu, etc etc...) as of the time I created it if you'd like to incorporate that into the trigger. If I still have it anyways. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Jan 06, 2009 8:39 pm |
The reason it doesn't pick them up isn't because of TLDs, it already supports all of those. And besides, now that TLDs can be anything, making a list of them is pointless.
The reason it doesn't work is because this trigger requires some kind of protocol to start the URL, or a www. Without either of those, it won't work. You could try making one that doesn't require that, but I guess it's a worry about false positives. |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Wed Jan 07, 2009 9:57 am |
Yeah I made it because expand will actually pick up the whole link.
Just like this being a pain:
Code: |
#add clickable_binNum 1
#var clickable_bin "~#SUB ~{~<send ~"l in "@clickable_binNum()".bin~"~>~<i>%line~</i~>~~</send~>~}"
#exec @clickable_bin |
Maybe sub/send was a little buggy in zmud |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Wed Jan 07, 2009 5:25 pm |
hmm, Fang has a point about the tlds, BUT the majority still fall under that several hundred in my var, I guess the thing would be to use that as a stop-gap measure in my own implementation. Making it smart enough to pick up "anything" just isn't worth it.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jan 07, 2009 8:01 pm |
Not really, %x%q pretty much does the job. Though I wonder how it'd cope with a URL terminated with a slash - my suspicion is poorly.
|
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Wed Jan 07, 2009 11:41 pm |
Of course. It captures everything. but it should still work, without typing in the last slash.
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jan 08, 2009 6:35 pm |
but again, it won't work without a www. or a protocol on it as it is. I would suggest adding ftp. to that as well.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Fri Jan 09, 2009 8:40 am |
ftp would be good.
My main point was %expand captures the whole link, unlike nexala's. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Jan 09, 2009 3:15 pm |
Yeah, I noticed that nice quirk. And btw, thanks for updating it ;)
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ParaVox3 Newbie
Joined: 30 Mar 2012 Posts: 6
|
Posted: Sat Jun 02, 2012 5:47 am |
Ahem, I rarely mess with the coding functionality of Zmud. How do you install this if you want it?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jun 02, 2012 7:13 pm |
1)copy the code to the clipboard
2a)for small scripts like this, paste into the command line and press enter.
2b)for longer scripts (as a general guideline, more than 2 lines as displayed on the command line), open the ZMud text editor (umm, CTRL-SHIFT-ENTER?), paste there, and click the SEND button.
3)go into the Settings Editor and review the newly-created settings. ZMud will have improperly expanded variable references and done a few other things that you will need to fix to ensure smooth operation. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
ParaVox3 Newbie
Joined: 30 Mar 2012 Posts: 6
|
Posted: Sun Jun 03, 2012 8:22 am |
Thank you!
|
|
|
|
|
|