ID:273968
 
I wish to record the use of verbs in a log to identify spamming and verb abuse. I was wondering if there is a way of doing something like this:

mob
verb
Click()
logs+="[time]: [usr] used [src]!"
Say(t as text)
view()<<"[usr] says [t]!"


Obviously this itself will not work, it will just make a new verb called Click. but is there a way to generate the desired result or will i have to add the log code to every verb?

Any ideas would be appreciated.

Thank You
I can't think of any way to make the logging process happen automatically, since client/Command() is called on non-verbs per documentation.

However, this could certainly simplify things:
var/list/logs = new
mob
proc/Log(vname)
if(usr && usr!=src)
logs += "[usr.name] activated [src.name]'s \"[vname]\""
else
logs += "[src.name] activated \"[vname]\""

verb/Test1()
Log("Test1")
usr << "foo"

verb/Test2()
Log("Test2")
var/mob/m = new
m.name = "Danny"
m.Test1()

verb/View()
Log("View")
for(var/i in logs)
usr << i
usr << "<hr>"

Use Test1, then Test2, then View, and you'll see how it works I suppose. The main downside to this is it's easy to forget to log a verb.
In response to Hiead
Thanks for the reply.

Yeah i figured I'd have to log each verb individually. This is going to be fun... lol

Thanks again.