Setting up quick links for your game is done in two steps, and its pretty easy once you see an example of it. Step one is to create the parser and quicklink datums, and step two is to run your text strings through the parser's parse() proc.
Step 1: Define your quick link types.
As an example, we're going to create a quick link that will allow people to link to the Google dictionary just like Google does using the shortcut name "define:".
quicklink
define
name = "define:"
url = "http://www.google.com/search?q=define:"
In order for it to be used in your program, you'll need to create your own instance of the parser like this:
var/quicklink_parser/quicklinks = new()
Step 2: Parse the message.
If you want to use this in a chat function so that whenever someone says something that includes "define:word", it will convert that into a link to Google's dictionary, all you need to do is run the message through the parser's parse() proc, like this:
mob/verb/Chat(message as text)
if(!message)
return
message = quicklinks.parse(message)
world << "[src]: [message]"
Using the parse(message) function will convert the matching tags into links, so define:game turns into define:game. If you want to use more than one word in your quick link arguments, you can put quotes around them, such as define:"au revoir".
Other Stuff:
Another tool that you can use when defining a quick link is the numeric variable. This variable means that only numeric arguments will be accepted for the quick link, just as BYOND's "id:" tag only accepts numeric values. id:123456 will convert to a link, but id:wookie will not. If you want your quick link to only accept numeric values, set it up like this:
quicklink
forum
name = "forum:"
url = "http://www.byond.com/developer/forum/?forum="
numeric = TRUE
If at any point while the game is running you want to find out what quick links are available, you can loop through the parser's quicklinks variable, which will contain all of the /quicklink datums that you've defined. You can find out what those datums are like this:
mob/verb/QuicklinksHelp()
src << "List of valid quick links:"
for(var/quicklink/link in quicklinks.quicklinks)
src << "\t - [link]"
And that's about all there is to it.
One unrelated question though...
I submitted an article here for what seems like a month ago. How does this get through seemingly so fast, and yet it seems like nobody has found my submission. Maybe it dissapeared o.o, or maybe I just thought I sent it.