ID:1951570
 
(See the best response by Nadrew.)
Code:
mob/playerstarting/proc/test()
usr << browse("<HTML><HEAD><TITLE>TESTING</TITLE></HEAD><BODY><A href = '/client/verb/ooc(msg as txt)'>OOC</A></BODY></HTML>", "window=test")


Problem description:
I'm trying to get this to activate the OOC chat verb when activated,
Of course this is just for testing purposes.
It instead thinks i'm trying to tell it to go to a webpage named /client/verb/ooc(msg as txt)

My instinct would be to try encasing the href in square brackets. Maybe slap a \ref immediately before the [] too?

Guess work. Just trying to repay the favours done for me in this forum...
Didn't work at all, It just said "Undefined var "verb"" and "Undefined proc", so i tried changing the code to:
<A href = \ref[setname()]>Set Name</A>

in place where that original bit of Href code was, still did not work, the exact same issue as the original happened.
Best response
You'll have to add some Topic() handler stuff.

client/Topic(href,href_list[])
if(href && href_list)
if(href_list["action"] == "command")
var/command = text2path(href_list["command"])
if(hascall(mob,command))
call(mob,command)() // You can handle arguments here, if you want.
..()


Then form your links like

<a href="byond://?action=command&command=/mob/verb/Whatever">Whatever()</a>
Now it's just doing nothing when clicked.
Add some debugging text and figure out where it's failing, I wrote it off the top of my head to give you an idea of where to go, not to point you full-on at the solution. You learn more if you've got to fiddle with things a little ;)
Alright, i'm gonna try to fiddle about with it.
But for right now: this is the debug i put in:
client/Topic(href,href_list[])
src <<"Debug: Topic Launched"
if(href && href_list)
src <<"Debug: href_list sucess!"
if(href_list["action"] == "command")
var/command = text2path(href_list["command"])
src <<"Debug: href_list action == command success"
if(hascall(src,command))
call(src,command)() // You can handle arguments here, if you want.
src <<"Debug: call success"
else.
src <<"Debug: call failed"
else
src <<"Debug: href_list action == command failed"
else
src <<"Debug: href_list failed"

Everything succeeds, except for Call. i get the "Debug: Call failed" message.
Problem is the pathing. Instead of command=mob/verb/Whatever, just make it command=Whatever. Also, remove the var/command = text2path(href_list["command"]) and just make it var/command = href_list["command"].
Still does it, but thanks for trying.
I'm gonna go ahead and hit the hay, then try something else tomorrow.
After a bit of fiddling around, i managed to get it to successfully preform the verb. However i have to manually change the Client Topic for every verb.

client/New()
..()
src <<"<a href= 'byond://?action=command&command=Whatever()'>TESTING</a>"
mob/proc/Whatever()
usr <<"Debug: VERB SUCCESS"

client/Topic(href,href_list[])
src <<"Debug: Topic Launched"
if(href && href_list)
src <<"Debug: href_list sucess!"
if(href_list["action"] == "command")
var/command = href_list["command"]
src <<"Debug: href_list action == command success"
if(command == "Whatever()")
src.mob.Whatever()
src <<"Debug: call success"
else.
src <<"Debug: call failed"
else
src <<"Debug: href_list action == command failed"
else
src <<"Debug: href_list failed"
The call method worked fine, you didn't need the ()'s though. Ring around the rosy is only fun for so long, so I'll just give you the outright answer.

client/New()
..()
src <<"<a href= 'byond://?action=command&command=Whatever'>TESTING</a>" //Not command = Whatever() but command = Whatever

mob/proc/Whatever()
usr <<"Debug: VERB SUCCESS"

client/Topic(href,href_list[])
src <<"Debug: Topic Launched"
if(href && href_list)
src <<"Debug: href_list sucess!"
if(href_list["action"] == "command")
var/command = href_list["command"]
src <<"Debug: href_list action == command success"
if(hascall(mob,command))
call(mob,command)()
src <<"Debug: call success"
else.
src <<"Debug: call failed"
else
src <<"Debug: href_list action == command failed"
else
src <<"Debug: href_list failed"
..()//Try to always call back to a parent function. Never know when you might have multiple defines
The command var was probably not in the right format for call(), which I suspect is why it was failing.

However, I would highly recommend not allowing a direct link to call any proc or verb belonging to the mob or client, for the simple reason that you have very little control over what comes in on the link. Proceed from the assumption that players will try to screw with you. To that end, I suggest having only a few commands that are setup to work this way.