ID:20259
Oct 3 2006, 9:49 pm
|
|
Okay, this may sound stupid, but can someone give me an example of how to set up something that would take things like people:EternalDread and create a link with that text linking to http://games.byond.com/people ?
|
First you'd have to do some findtext() to figure out where everything was, findtext("people:") is a start, then you need to find where it finishes using findtext(" ",value_returned_from_first_findtext), THEN you need to find the key name using findtext(":",value_returned_from_first,value_returned_from_s econd)
Then you need to use copytext() with the values you obtained to root out the keyname, then you need to replace the people:keyname with the proper linked version. |
I couldn't figure it out, could you just post the code I would use for it in a Say verb?
|
edit: hurrm, no
tags =( proc/replacetext(string, find, replace)var/found = findtext(string, find)if(!found)proc/test(string, word, link)return stringreturn copytext(string, 1, found) + replace + replacetext(copytext(string, found + lentext(replace)), find, replace)var/found = findtext(string, word)if(found)var/space = findtext(string, " ", found)var/value = copytext(string, found + lentext(word), space)return replacetext(string, "[word][value]", "a href=[link][value]>[word][value]</a") |
Just make a normal HTML link, it'll open a new browser window.
That's it, if you're asking for the actual text parsing, that's another story. Linking to an external website doesn't require Topic().