ID:273971
 
Can the verb var name be used for an output? and if so how would i call it?

mob
verb
Get_Name()
usr << "[verb.name]"


the path itself would also be fine, but again, i cannot figure out how to call it in an output.

Any ideas?

Thanks
I believe that you would have to use the verbs variable and parse through that list, looking for the verb you wanted to use in the output. Verb Names themselves cannot be referenced directly unless through a Stat Panel. If you were to set your syntax for this as "verb.name" Then you would likely get several errors. Let me explain.
mob
verb
kill_all()
set name = "Banzai!"
//Arbitrary Code
getVerbName()
src << "[kill_all.name]"

As you can see from this example, the getVerbName verb will attempt to reference the verb, kill_all's, name, only it won't. What it will be doing is looking for a variable named "kill_all" that is referencing an ATOM. Since this reference variable doesn't exist, you get a compiler error.

What are you even trying to do? In all the years I've spent programming on BYOND, I've never once run into an occasion where I've had to attempt to output a verbs name. It would probably be 1000x easier to simply create a list containing the names of all of your verbs.
In response to Solomn Architect
thanks for the reply.

the purpose of the this is to create a log of the verbs certain people use. so i can find out if my GMs are abusing their verbs.

the log will contain time, usr and the verb used.

I was hoping there was a generic way to reveal this rather than making a custom line of code for each verb.

I know the following would work:
mob
verb
Kill()
log += "[usr] used Kill"

but i was hoping to just copy and paste into my current verbs rather than specify each verb again ((there are alot of verbs))
In response to Kozar's friend
Well. If I could give you an easier way I would. Unfortunately this is the only method you have to work with at the current moment. May I suggest the Ctrl+C and Ctrl+V Macro's to help speed up the process?
In response to Kozar's friend
mob/verb/Whatchadoin(txt in verbs)//Pick from your verbs
world<<Check(usr,"[txt]")//Call the proc with ref and the verb converted to text


proc/Check(mob/Player,txt)//ref,text version of the verb
return replacetext("[txt]","/mob/verb/","")//pull the verb name from txt


That gives you the name of the verb you picked from a list of your verbs, though I'm sure you could find a way to handle it without picking from your verbs. It requires Hiead's TextLib library.
In response to Robertbanks2
Thanks for the replies guys.

The verb handling wouldn't work unless there is a way to reference verb variables, but nobody has found a way to do this yet. Looks like I am going to have to custom make it. But oh well, just means more work is all.