ID:2205469
 
(See the best response by Lummox JR.)
i was wondering is there a way to make a verb that clicks on a object without you having to manually click on it? like say you had a hotbar of skills and they activate when you click em but you have no mouse how would you make a verb that could click on that object?

Best response
Certainly it's possible.

There are two ways to go about this. One is way better. First I'll show you the most direct way, which is not the best:

usr = M
O.Click()

That acts as if a mob, M, clicked the object O. Odds are you're not using any of the arguments in Click(), but you could call it with args if you wanted.

Click() is a pseudo-verb, which means if you're not calling it manually you can treat it as a verb and it's usr-safe. If you are calling it manually, you have to ensure that usr has the correct value. usr is a hidden local var that is automatically passed to any procs you call.

Now as I said, that's not the best way to do this. This is the best way:

obj/skill
proc/Activate(mob/owner)
// do something to react to a click
...

Click()
Activate(usr)

This is much cleaner, because then you can call O.Activate(M) without having to remember to set usr--in fact usr has no business in Activate() at all. You can treat procs as procs, and pseudo-verbs as verbs, without worrying about whether you're calling your pseudo-verb correctly or abusing usr in a proc.