openUrl() nonfunctional?

Akaxi
Posts: 13
Joined: Tue Sep 28, 2010 8:06 pm

openUrl() nonfunctional?

Post by Akaxi »

Hi,

I tried a simple alias using one of the examples from the manual:
Code: [show] | [select all] lua
openUrl("http://google.com")
The following message from the "errors" console was output:
Code: [show] | [select all] lua
[ERROR:] object:<test> function:<Alias7>
<[string "function Alias7()..."]:3: attempt to call global 'openUrl' (a nil value)>
I'm guessing the function was deleted from the latest release and the manual wasn't updated to reflect that. OR! I could be missing something stupid. :)

If the function is indeed removed/bugged, is there some other way to open a browser or otherwise do web-interactive tasks from w/in mudlet?

Thanks!

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

Re: openUrl() nonfunctional?

Post by Yetzederixx »

Not sure what you are going for here, but this is how I got clickable URL's:

Code: Select all

Trigger: Clickable URL's
Pattern: \b(((https?|ftp|telnet)://[\w\d:#@%/;$()~_?\+\-=&]+|www|ftp)(\.[\w\d:#@%/;$()~_?\+\-=&]+)+)\b
Pattern: \b([\w\d._%+\-]+@[\w\d.\-]+\.[\w]{2,4})\b

Code:
     selectString(matches[2],1)
     replace("")
     echoLink(matches[2], "", matches[2])
Hope that helps

Akaxi
Posts: 13
Joined: Tue Sep 28, 2010 8:06 pm

Re: openUrl() nonfunctional?

Post by Akaxi »

Hmm, thanks! My MUD has a little reminder that pops up occasionally, requesting that you vote for them on topmudsites.com. My plan was to partially (not totally! that is against the rules!) automate doing that by triggering off of that phrase such that the web browser automatically pops up, so I can just click on the "vote" button and be done.

Not a big deal; it'd just save me a few keystrokes, and I could use echoLink() similar to what you suggest to give me a url to click on when the message pops up. :)

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

Re: openUrl() nonfunctional?

Post by Vadi »

Latest Mudlet uses openURL, which is implemented differently and works better

Akaxi
Posts: 13
Joined: Tue Sep 28, 2010 8:06 pm

Re: openUrl() nonfunctional?

Post by Akaxi »

Thanks as always for the quick reply. Is there any documentation for openURL()?

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

Re: openUrl() nonfunctional?

Post by Vadi »

It's the same usage

Akaxi
Posts: 13
Joined: Tue Sep 28, 2010 8:06 pm

Re: openUrl() nonfunctional?

Post by Akaxi »

Hrm, when I did the same example from above but with openURL() instead of openUrl(), I got a blank command prompt to open up (running WinXP).

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

Re: openUrl() nonfunctional?

Post by Yetzederixx »

I tried making clickable links and can't get it to work either.
Code: [show] | [select all] lua
selectString(matches[2],1)
replace(" ")

echoLink(matches[2], [[ echoUrl(matches[2]) ]], matches[2])
This is what I get when I click the link in the MUD:

Code: Select all

Lua error:[string " echoUrl(url) "]:1: attempt to call global 'echoUrl' (a nil value)
I've tried echoUrl and echoURL.

Win XP, 1.2.0 pre6

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: openUrl() nonfunctional?

Post by Denarii »

Code: [show] | [select all] lua
echoLink(matches[2], [[openURL(]]..matches[2]..[[)]], matches[2])

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

Re: openUrl() nonfunctional?

Post by Yetzederixx »

Thanks Denarii, you were almost right:
Code: [show] | [select all] lua
-- need the double quotes to make it work
echoLink(matches[2], [[openURL("]]..matches[2]..[[")]], matches[2])

Post Reply