ID:1283213
 
(See the best response by Pirion.)
Code:
mob/player/verb/PressD()
usr << "Click <a href=?src=\ref[src];action=start>here</a>!"
mob

player

Topic(href , href_list[])

switch(href_list["action"])

if("start")

usr << "Starting the game..."

else

return ..()


Problem description:
Hello all viewers, so I've decided I want to use grids to catch the topic of a hyper link I place inside a cell.
I can catch the Topic when it automatically goes to the client and I can reroute the Topic to an object..... but I can't reroute and catch Topic at the same time, so I must be doing something wrong!
So I tried to use an example from the reference but it gave me the same error I was getting before, if someone can show me how to catch a topic when it is rerouted to a different object it will be appreciated, preferably without the need of a list!
Have no restraint in whipping me about what I'm doing wrong as-well O.o, thanks.

Heres the error:

runtime error: bad index
proc name: Topic (/mob/player/Topic)
source file: Dialogue.dm,51
usr: Jlxati (/mob/player)
src: Jlxati (/mob/player)
call stack:
Jlxati (/mob/player): Topic("src=\[0x3000000];action=start", /list (/list))
Check
Best response
I used this code and there were no error for me. This is the one that is in the source file mentioned?
Yeah your right the code works fine, I was careless forgot to remove the first Topic proc i wrote. I also figured out what was the problem with my hyper-link before I didn't realise,
 <a href=?src=\ref[src];action=start>

and
<a href=?src=\ref[src];action = start>

are treated differently must be sensitive to white space >_> once again thank you!
Also do you know how one would create a hyper-link that catches just a topic name from a an object set as the src, instead of a list
i.e:
"<a href=?src=\ref[src];action> Ill eat your entrails on mah tummeh, Time Child!!!</a>!"

But with
src=\ref[src]
defined. Thanks in advance!
Sorry - I'm not sure what you want to do?

It seems like your asking for the href param?
In response to Pirion
Urm..
    player

Topic(href , href_list[])

switch(href)

if("start")

usr << "Starting the game..."

else

return ..()


I only want to use the first passed variable to check if the topic was caught, instead of the second variable which is a list. But I don't know how to construct the sentence in html, i tried looking it up but found no example.
<edit>
Yeah basically what you said!
First off you can't parse a second string using ;

The first string must always have ? before it every extra one uses & , like below

"<a href=?src=\ref[src]&action=haha&blah=1> Ill eat your entrails on mah tummeh, Time Child!!!</a>!"


Using a list is fine and easy.

"<a href=?src=\ref[src]&action=eathim> Ill eat your entrails on mah tummeh, Time Child!!!</a>!"

player
Topic(href , href_list[])
switch(href_list["action"])
if("eathim")
usr << "The eating has begun!"
else
return ..()
In response to A.T.H.K
Thanks for the advice and clearing that up, A.T.H.K and thanks for the hints, pirion.
This problem is now Solved!