Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Tue Oct 14, 2003 4:57 pm   

mxp / HTML
 
Is there a way to set zmud 6.62 to be able to have http links be clickable...?

Example....

I'm on X mud... chatting with people on the chat channel... and someone chats... "Chat: Oh my! Look at http://www.something.something "

You would go and just click on the http address and it would act as a link and open a web browser to that page...

I mean... Tinyfuge is primitive... but it can do it. Is there a way to make it work with Zmud 6.62


Poploco


[?]
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Tue Oct 14, 2003 5:36 pm   
 
Something like this should work okay.

[code]#TRIGGER {({http|ftp|telnet}://%*{.com|.net|.org})} {#SUBSTITUTE {~<A "%1">%1~</A>}}[code]

If you want to allow for ip addresses in the URL, you'd probably be better off with a second trigger like this.

[code]#TRIGGER {({http|ftp|telnet}://%d.%d.%d.%d)} {#SUBSTITUTE {~<A "%1">%1~</A>}}[/code]
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Tue Oct 14, 2003 6:42 pm   
 
thanks! It works!
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Tue Oct 14, 2003 7:38 pm   
 
Ummm what about .co.* or .gov.* or .ac.*
As you can't use wild cards in the {blah|blah2} construct do you have to rewrite the trigger pattern as a regular expression or is there a way of doing it in ZMud?
And that trigger matches white spaces in the url which I suspect may cause some confusion in use (not that there is ever time to click on anything when I am playing a mud cos it scrolls so fast - Hey Zugg, how about slowing that scroll rate down? <grin>)
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Tue Oct 14, 2003 8:01 pm   
 
The trigger I posted was only meant as a base to work from. You need a somewhat constant pattern at the beginning and the end so it can pick out URLs like these

Hey! look at thishttp://www.zuggsoft.comCool eh?

That is why I chose to use string lists to match the protocol and the top level domain. The only problem with this is URLs such as these.

http://www.zuggsoft.com/forum/default.asp
telnet://somemud.com:4000
telnet://192.168.1.1:4000
ftp://user:pass@192.168.1.1

I did not spend the time devising a way of matching all of those possibilities. It shouldn't be that difficult if given more than a minute to think it out. Perhaps when I get home?
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Tue Oct 14, 2003 8:28 pm   
 
If somebody gets a completed set of triggers to capture all possible links, could you post it on the finished scripts forum. I think this would be very usefull to a lot of people.
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Tue Oct 14, 2003 8:41 pm   
 
Of course I would forget that there *is* a non-whitespace wildcard available in zMUD. [:I]

To rewrite the original trigger.

Code:
#TRIGGER {({http|ftp|telnet}://%x)} {#SUBSTITUTE {~<A "%1">%1~</A>}}


With this, however, any extra characters that are hitched on to the end of the URL will be treated as part of that URL.

Hey! look at thishttp://www.zuggsoft.comCool Eh?

will now look like this

Hey look at thishttp://www.zuggsoft.comCool Eh?

but does allow for any combination of possibilities.

http://www.zuggsoft.com/forum/default.asp
telnet://somemud:4000
http://192.168.1.1/somedir
ftp://192.168.1.1/pub
telnet://192.168.1.1:4000

(except ftp://user:pass@someftp.com)

Those should all work fine as long as there is a whitespace following the URL.
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Wed Oct 15, 2003 11:44 am   
 
Doh oh yeah %x (I played around with various patterns and forgot about %x too)
Cool stuff, thanks Carabas.
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Thu Oct 16, 2003 6:31 am   
 
Cool works better now. Thanks dudes and dudets!
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Thu Jan 08, 2004 12:13 pm   
 
What about a version of this trigger that will capture an email address and spit it out as a mailto link?
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Fri Jan 09, 2004 11:19 am   
 
*bump* I'm still having trouble figuring this out. Anyone have any suggestions?

Also, I seem to be having an error with this trigger. I loaded the most recent version (#TRIGGER {({http|ftp|telnet}://%x)} {#SUBSTITUTE {~<A "%1">%1~</A>}}), and now all of my text is underlined. There's also no actual link in the test that I made. I simply imported the trigger, then did the following:

say http://www.yahoo.com/

My own actual input to the mud was underlined as a link, but when the mud spit back with "You say '", I got a bit confused. Now, everything the mud sends to me, and everything I send to the mud is underlined. Any suggestions?
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Fri Jan 09, 2004 11:26 am   
 
UPDATE:

When I close zMUD and re-open it, the text has returned to normal. So I'm guessing there's just something funky going on with the MXP that makes it want to keep underlining everything.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Fri Jan 09, 2004 12:31 pm   
 
This might work, Musish:

#trigger {(%x)~@(%x)} {#SUBSTITUTE {~<A "mailto: %1~@%2">%1~@%2~</A>}}

Same deal with the URL trigger, except it also needs a space in front of the Email address and at the end.
Reply with quote
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: Fri Jan 30, 2004 3:57 pm   
 
Hi,

I was looking over past posts and found this one useful.

I added the trigger and it works fine on its own. However, i do a lot of capturing to different windows. I found that the substitution doesnt carry over to the captured window. Any advice?


thanks


ps i found a work around or maybe this is the only way.
I added the trigger to the capture windows settings file
and it works that way. Although i would like to keep everything to the main mudfile.
Reply with quote
Ratalon
Beginner


Joined: 08 Apr 2004
Posts: 24
Location: USA

PostPosted: Sun Apr 11, 2004 5:57 am   
 
mortie: The only way I was able to get a trigger to work when there is a possibilty of it being captured is to have it as a seperate settings file for the other window.

Here is a head scratcher, that is making me bald
Using the trigger
#TRIGGER {({http|ftp|telnet}://%x')} {#SUBSTITUTE {~<A "%1">%1~</A>}}
(the ' in the trigger is for URLs that are ended with a ' like how muds do it Ratalon says 'URL')
So that being said a URL that has a ~ in it does FUNKY things
In order to pass http://pics.bla.com/~user/pics
The URL must be entered as http://pics.bla.com/~~user/pics
(The second tilde makes the first tilde show up)

The URL that the MXP trigger sends people to http://pics.bla.com/user/pics&&http://pics.bla.com/user/pics'

IF the #TRIGGER {({http|ftp|telnet}://%x)} {#SUBSTITUTE {~<A "%1">%1~</A>}}
(this one doesn't have the ' in it)
then clicking on the link removes the tilde.
In order for the link to work There has to be 2 tildes in the MXP link.

I have been messing with the trigger, but it only seems to get worse before it gets better.
Any ideas?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Sun Apr 11, 2004 10:53 am   
 
If you dont mind it automatically opening a web browser try:

#TRIGGER {({http|ftp|telnet}://%x)} {#URL %1}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 11, 2004 5:02 pm   
 
Okay after months of Accumulated studying I have come up with this *thanks all the various forum contributors for some of the Ideas

#TRIGGER {(%q)({http|ftp|telnet}://%x)(%q)} {#SUBSTITUTE {~<A '%quote(%2)'>%1%2%3~</A>}}

This one works 100% for me (at least works for everything on this post I tested it against)
works with ~, Begining, End, and Middle of sentance etc. Just won't match ftp://user:pass@192.168.1.1 kind of lines.

#trigger {(%q)(%x)~@(%x)(%q)} {#SUBSTITUTE {~<A 'mailto: %quote(%2)~@%quote(%3)'>%1%2~@%3%4~</A>}}
Same as URL but for Mailto-Links

Also since it has been Recomended I guess I will Cross post this to Finished Scripts in about a week (to make sure all quirks are out)
*ponders changing his Sig line to "Has yet to find something zMud can't do"
Reply with quote
Ratalon
Beginner


Joined: 08 Apr 2004
Posts: 24
Location: USA

PostPosted: Sun Apr 11, 2004 8:37 pm   
 
Nexela: that trigger is MOST excelent!
I have sadly managed to break it :-(
IF a single line has 2 links in it.. and EACH link has a tilde(~) in the URL.
says 'haha http://d.com/~ch and http://d.com/~ch'
It EATS the second tilde (it must parse it away on the first sweep or something)
As long as thoes EXACT conditions are not met, everything is clean and serene.
(this trigger SO belongs in the MXP help file, its the coolest part)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 11, 2004 10:04 pm   
 
NOOO!!!!! *rofl* *reminds himself to SAVE often*
I was working on this trying to find a fix and did something that totaly fried Zmud and of course the other script I was working on wasn't saved......
Reply with quote
snoop
Newbie


Joined: 21 Feb 2004
Posts: 9
Location: Sweden

PostPosted: Fri May 14, 2004 9:24 pm   
 
I have found a problem.
If you have a link like this:
http://www.foo.com/~user/page.php?view=foo&show=bar
The current triggers i've seen either make the ~ disappear or
the &.

So either you end up with a link like this:
http://www.foo.com/user/page.php?view=foo&show=bar
or like this:
http://www.foo.com/~user/page.php?view=foo=bar

Anyone has a fix for this?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri May 14, 2004 11:32 pm   
 
Those are special characters, the tilde will be next to impossible to keep. You might try working around the problem by using multiple #PSUBs and matching blank spots before and after the link. Working off Nexela's last post to give you an example of what I mean:
#TRIGGER {(%q)()({http|ftp|telnet}://%x)()(%q)} {#PSUB "<A '" %x2;#PSUB "'>%3</A>" %x4}

I have no idea how well that will work just a concept item.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat May 15, 2004 12:13 am   
 
As far as I can tell when YOU send it ie say tell etc you have to be sure to quote all the special chars with your current Quote char as zmud parses the line as its send then does the %quote.

But recieving them from a source sending them correctly should work correctly even though I wasn't able to completly test it but Il see what I can do
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net