ID:2278964
 
(See the best response by Kaiochao.)
Hey guys,

I am trying to make a computer type of thing that has a simple button called 'profile' on it. I made a variable called profiled (It is a mob type), and I came as far as that..

But now my problem is how would I go about assigning the variable with the button so the code knows what to select? Currently it sticks to null..

My code for the button:
<a href='?src=\ref[src];choice=Profile;profiled=[M]'>Profile</a></li>"


Also included is my attempt at turning the profiled part into the mob that was selected (profiled=[M]), but it did not work.

And in Topic:
            if("Profile")
// profiled = locate(href_list["Profile"])
if(!profiled) return to_chat(usr, "Unknown system error occurred, could not retrieve profile.")
screen = 2
popup.update()


I have been trying for some time with little understanding as to how this works, could someone help me get through this?

Thanks!
Best response
I'm guessing you want "profiled=\ref[M]" in the href, and then locate(href_list["profiled"]) in Topic.
<a href=?cmd=checkProfile profile=\ref[MOB_HERE/src/M]> Click Here </a>

// Once the above is clicked it'll call client/Topic() below.

client/Topic(_,list/l)
if(l.len)
switch(l["cmd"])
if("checkProfile")
var mob/M = locate(l["profile"])
if(M)
// ...