M << output("<center><b><font color = [usr.textcolor]>(Effect: [src.Effect]) Damage: (<a href='?src=\ref[src];cmd=damage'>Damage</a>)","IC")

var/tmp/damage1 = DamageCalc(src.strength, src.dexterity, usr.endurance, usr.agility)
usr.stamina -= damage1

Problem description:

Code above has been doctored simply for ease of viewing, but problem lies in how I'm attempting to make damage work through hyperlink in a project I'm working on.

Essentially, when a player uses an "obj/technique" in their contents, it outputs a bunch of text, and by clicking on this hyperlink I'd like other players to be able to accept damage.

So I need to access the variables of the player who activated the object, for attacking stats (strength and dexterity) and defender's stats (endurance and agility) for the time being.

I'm getting no error readouts, no runtime errors, and am genuinely at a loss after reading the documentation if there's a way around this beyond simply storing these stats inside of "obj/technique" on use so I can refer to the object directly as a source for variables.
src << "<a href=?src=\ref[src]&target=\ref[target]>ATTACK</a>"

var mob/attacker = locate(l["src"])
var mob/defender = locate(l["target"])
world << "[] attacks []!"
In response to Kozuma3
The above may not be exactly be correct, since the source of the command is a obj/technique/verb.

But it does give me an idea, where on use of the verb I could create a target variable, and use that as the src. Along the lines of.
var/mob/target = usr
src << "<a href='?src=\ref[target]'>ATTACK</a>"

var attacker = locate(l["target"])
var defender = usr
world << "[] attacks []!"

Since upon clicking the hyperlink, "usr" should refer to the person clicking it. The only data I'm missing is the attacker's and should be able to point to them in this manner?
In response to Kozuma3
Update on this: I've decided to simply store the data needed on every case that the use command is activated, though I was hoping there was a more efficient way to do so.

The data handling of this was wonky because I was using mob/Topic instead of obj/Topic

My working version is as follows

usr << "(<a href='?src=\ref[src];cmd=damage'>Damage</a>)"

var/tmp/damage1 = DamageCalc(src.pow, src.crit, usr.endurance, usr.agility)
usr.stamina -= damage1
usr << output("[] has taken [DamageText(damage1)] damage from []'s attack!")

I'd still prefer not to store the data in the src object if possible, is this possible?
You could pass the pow/crit into the a href tag as well.
The "src=\ref[src]" part of the link can be changed to any reference. It determines whose Topic() proc gets called. In Topic(), usr is the mob who clicked the link. Also, the href_list list is an associative list of the parameters passed in the link after "src". You're checking for "action" in your Topic(), but as you found, you should have been checking for "cmd".

If you want the technique user's Topic() called, then you pass usr as the src of the link.
// src is the technique, usr is the user of the technique.
// Pass usr as the src of the topic link, so that usr's Topic() gets called.
world << "<a href=\"?src=\ref[usr];action=damage\">damage</a>"

Topic(href, list/hrefs)
// "action" here needs to match action=damage from above.
if(hrefs["action"] == "damage")
// src is the user of the technique.
// usr is the mob who clicked the link.

Login to reply.