Clickable URL's

Share your scripts and packages with other Mudlet users.
Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Clickable URL's

Post by Yetzederixx »

Attachments
clickableURL.xml
(1.46 KiB) Downloaded 1086 times

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Clickable URL's

Post by Yetzederixx »

Btw I'm lazy, you can view the discussion and final code here.

bluebaleen
Posts: 48
Joined: Sun Feb 06, 2011 2:00 pm

Re: Clickable URL's

Post by bluebaleen »

I am attempting to implement this code and while the links are, indeed, made clickable, I receive the following error upon clicking the link:

Lua error:[string "openURL("http://www.test.com")"]:1: attempt to
call global 'openURL' (a nil value)

I am running: Mudlet 2.0-dev built: January 19, 2011

Any input here is greatly appreciated.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Clickable URL's

Post by Vadi »

Try changing it to openUrl

bluebaleen
Posts: 48
Joined: Sun Feb 06, 2011 2:00 pm

Re: Clickable URL's

Post by bluebaleen »

That did it. Thanks!

Phoenix
Posts: 92
Joined: Tue Feb 15, 2011 3:23 am

Re: Clickable URL's

Post by Phoenix »

Is there a reason openUrl() doesn't work proper on links without the prefix? Like, it won't work with
Code: [show] | [select all] lua
openUrl("www.google.com") 
period, but it works on
Code: [show] | [select all] lua
openUrl("http://www.google.com") 
There is no error message for why it doesn't work, either. It simply doesn't open the page.

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

Re: Clickable URL's

Post by Omni »

Phoenix wrote:Is there a reason openUrl() doesn't work proper on links without the prefix? Like, it won't work with
Code: [show] | [select all] lua
openUrl("www.google.com") 
period, but it works on
Code: [show] | [select all] lua
openUrl("http://www.google.com") 
There is no error message for why it doesn't work, either. It simply doesn't open the page.
Both work perfectly for me.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Clickable URL's

Post by Vadi »

That behavior is OS-dependant I guess. So for safety, use http://, because the http:// protocol is how you want it to be opened with.

Sojik
Posts: 6
Joined: Thu May 26, 2011 9:31 pm

Re: Clickable URL's

Post by Sojik »

I've improved this package so that it works for multiple urls on one line. Also if you were having problems with the colors of your links with the last package you probably won't with this one.
Attachments
clickableURLs.xml
(1.36 KiB) Downloaded 1377 times

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Clickable URL's

Post by Vadi »

thanks a ton

Post Reply