[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Making Hyperlinks

Making Hyperlinks

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Ragnarr   Australia  (4 posts)  [Biography] bio
Date Wed 27 Nov 2002 10:22 PM (UTC)
Message
All I want is a trigger that will make certain output from the MUD [for eg. http://(.*) or (www\..*) ] become active hyperlinks and clickable in exactly the same way as MXP would and as I would when highlighting and selecting "Go to URL" in the drop down menu.

The MUD is actually LambdaMOO and it isn't publeo enhanced but, as it is a MOO, I can program my $player:tell() verb to add the relevant MXP tags. I've experimented with this but the server always sends (i assume) a final \n and escapes my escapes.

E 1024: ( 1991) Secure MXP tag ignored when not in secure mode: <a>

Obviously I am never going to be allowed into Secure Mode and the only way I can send escape sequences is via world.tell() which is never parsed by MXP. Only the server output is parsed... So I've kinda given up on that..

So now, my question/request is, could we please have a trigger option 'Make Hyperlink' (make %1 the url and %2 optional text) or even a Function that my trigger could call, something like, 'world.noteHyperlink(<url>,[optional text])' which would display nice clickable hyperlink and would behave exactly as "Go to URL"? or even just send the output from .tell .note through the MXP parser. I dunno...all I want is nice clickity hyperlinks.

If someone has a workaround, I would be delighted to know about it, if not, i think this would add value to your product. Also, many other smaller mud clients already have this.

Thankyou.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 28 Nov 2002 01:55 AM (UTC)
Message
Added as suggestion #478.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 29 Apr 2003 05:28 AM (UTC)
Message
There is now a Hyperlink script item in version 3.41. You can use that to make hyperlinks that both go to the Internet, or just send commands to MUSHclient.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 29 Apr 2003 05:55 AM (UTC)
Message

Here is an example of it in operation:


Things you can do ... View chat sessions, Visit the forum


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 29 Apr 2003 05:56 AM (UTC)
Message
To do the above, I entered this:


world.tell "Things you can do ... "
world.Hyperlink "#chats", "View chat sessions", "", "green","", 0
world.Tell ", "
world.Hyperlink "/world.DoCommand ""Forum""", "Visit the forum", "", "green","", 0
world.Note ""


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #5 on Tue 29 Apr 2003 01:24 PM (UTC)
Message
I do not believe in using the mouse on a MUD.
Yet, i have to say that this function really rocks... Now i can add details on my scripts and make them interface differently and stuff... Great!
Way to go Nick and Ragnarr.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Norbert   USA  (61 posts)  [Biography] bio
Date Reply #6 on Thu 01 May 2003 11:31 PM (UTC)
Message
I'm trying to set up triggers that will pick up www. and http:// from the world. It's not quite working out. Does anyone have a plugin or a example script in any language that I could look at to figure out what I'm doing wrong. Or maybe just add a toggle to the output configurations to detect them and let the user choose for them to be hyperlinks or not.
Thank You
Norbert

Norbert

-Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens
It's a dumb question... skip it.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Fri 02 May 2003 03:04 AM (UTC)
Message
This example trigger will detect http://xxx and make an additional line with a hyperlink in it.

It can't turn the actual text into a hyperlink because it is world output, not a note, however if you were keen you could omit the original line from output and make a new line with the URL turned into a hyperlink.

You may need to fiddle with the rules for detecting the http://whatever, and to do one that just matched www.something you would need to do it a bit differently - make sure you prepend "http://" to the hyperlink in that case.


<triggers>
  <trigger
   custom_colour="17"
   enabled="y"
   match="http\:\/\/([A-Za-z0-9\.\\\/\?])+"
   regexp="y"
   send_to="12"
   sequence="100"
   other_text_colour="whitesmoke"
   other_back_colour="orangered"
  >
  <send>Hyperlink &quot;%0&quot;, &quot;%0&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 1</send>
  </trigger>
</triggers>



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #8 on Tue 13 May 2003 10:11 PM (UTC)
Message
This would be a nice example of omitting output and then replacing it... Could someone write a small listing that omits the line, and then sends it to the world with the hyperlink? I can't figure out how to do it myself...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Wed 14 May 2003 04:00 AM (UTC)

Amended on Wed 14 May 2003 04:02 AM (UTC) by Nick Gammon

Message
Assuming you only had one hyperlink on a particular line, it would be something like this:


<triggers>
  <trigger
   enabled="y"
   match="(.*)(http\:\/\/(?:[A-Za-z0-9\.\\\/\?])+)(.*)"
   omit_from_output="y"
   regexp="y"
   script="OnHyperlink"
   sequence="100"
  >
  </trigger>
</triggers>


The script needs to go in the script file, or the omit from output also omits the scripted lines. :)


sub OnHyperlink (name, line, wildcards)
  ColourTell RGBColourToName (NormalColour(8)), _
             RGBColourToName (NormalColour(1)), _
             wildcards (1)
  Hyperlink  wildcards (2), wildcards (2), "", "", "", 1
  ColourNote RGBColourToName (NormalColour(8)), _
             RGBColourToName (NormalColour(1)), _
             wildcards (3)
end sub


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #10 on Sat 17 May 2003 12:49 PM (UTC)
Message
Oh, I see, so you split it into 3 parts... Great sample, thanks!
By the way, could you clarify the use of the Hyperlink function in a plugin? I.e. if I use it in a plugin, do i have to include its ID, or will the plugin find its ID automatically? That is not mentioned in the online reference.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Sun 18 May 2003 01:37 AM (UTC)
Message
You have to put the plugin ID there. Once the hyperlink is in the output window it is not linked to any particular plugin, thus the ID has to be there. The hyperlink function itself does not know what your intentions are.

I have amended the description a bit to give an example of doing that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Ragnarr   Australia  (4 posts)  [Biography] bio
Date Reply #12 on Mon 02 Jun 2003 06:00 PM (UTC)
Message
I just got the latest Mushclient today and discovered the new hyperlink function. It's FANTASTIC. It works GREAT. This function is much more powerful than I had ever hoped. THANKYOU very much Nick, you are truly a man of the people.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


27,825 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]