ID:162883
 
As some may know I am making a Tradex game. I am trying to make a show code verb, but I can't figure out how to add it as link type thing, so when they type the code, it will show as a link. When the other players click the link, it will open dream maker with the code 'M' typed.

This is what I had before I thought of making it a link type thing:

mob
verb
Announce_Code(message as message)
set category = "Program"
set name = "Share Code"
set desc = "(message) Announce a code to all players logged in"
for(var/client/C)
C.mob << "<hr><br><font color=#000888><b>Code From [src]:</b><br><font color=white>[message]</font><hr>"


Ps. If this doesn't make sense, please say. o.o
Have a global list, called "codelist". Each time someone shows code, append that code to that list. We will then take the length of the list (we'll call it "coderef"), and from that, construct a link: <code>LINK The format of this is then interpreted by Topic(), which will use the value of the action parameter (href_list["action"]) to check if the link clicked was a showcode link (in which case, it will be equal to "showcode"). Then, the reference parameter is fetched, and converted into a number with text2num(). We'll save it in a variable also called "coderef". With this number, you can then get the code that was posted from the codelist variable: it will be codelist[coderef]. You can then take this and display it however you want.
In response to Garthor
Ok, could you explain alittle bit more, like an example (I am a visual learner). I am not exactly a pro programmer. XD Although some people think I am great at it. =|