MOO-cows Mailing List Archive


RE: Wierd Verb Stuff - Need Help!

You're close, but not close enough. :)

What you want to do is to wrap the verbname in parenthesis, like so:

cmd = "foo";

This will call player:foo()

and changing cmd to "bar" will cause it to call player:bar()

This also works with properties, and this is also how you must do it when calling
verbs (or accessing properties) with special characters in it, such as

From:  Chris Jones[]
Sent:  Saturday, January 27, 1996 3:35 PM
To:  moo-cows
Subject:  Wierd Verb Stuff - Need Help!

	Hi, everyone.  I'm trying to setup a verb on an object which 
works like this:
[Verb code may not work; making this off the top of my head]
cmd = "foo";
[Could this be setup so that the second line will execute player:foo(), 
and then if cmd is changed (say to "bar"), that it would execute 
	I've though of a few ways, but they're not really elegant, and 
would waste server ticks:
cmd = "foo";
if (cmd == "foo")
elseif (cmd == "bar")
[end verb code]
	Any ideas?

/--------------------v- PGP Fingerprint --------------------------------\
|42 -It's the answer!| 95 2F 8F 26 F9 CA 4B 1A  D1 CA C1 5E F9 76 59 AB |

Home | Subject Index | Thread Index