MOO-cows Mailing List Archive
Re: Portable source form of MOO database
> I'm trying to avoid the use of object numbers, which are assigned
> unpredictably by the server. If a objnamed function were possible then
This is a very hard thing to do. I suggest poking around
> @go objnamed("Train Station Steps")
>***Kipp> You're mixing the code parser with
>***Kipp> the command parser (perhaps you can explain this better, Pavel)
>***Kipp> To find out object numbers of objects you've forgotten, type
>***Kipp> '@audit [<player>]'
> One of the questions I was trying to ask is `how do I create user
> defined functions? Is it even possible?' I can't seem to find it in
> the docs anywhere.
Where did you even hear that you could? They're called 'verbs'.
> Kipp> Okay, a brief summary that should make this easier... Commands
> Kipp> go: <verb>[[ <dobj>][ <prep>[ <iobj>]]] CODE does just about
> Kipp> everything else.. (Keep in mind that <function>(<args>) and
> Kipp> <OBJ>:<VERB>(<args>) are in code, not commands.)
> I just looked to see if there is anything called code or @code (in the
> LambdaCore DB)-- nope. Assume I am a rank newbie, how can I define a
Nononono, I mean, CODE as in the stuff you put in when you type '@program...'
<verb>[[ <dobj>][ <prep>[ <iobj>]]]
Nowhere in this expression does it mention any builtin functions. They
may only be called from within CODE, not commands. I think you're
getting confused with unix shells.
There is, though, a verb that is called every time the server wants to
match an object; <player>:my_match_object(<objname>);
The verb normally calls :match and then $string_utils:match_object.
With the following code, you can type the names of objects you own, even
if you aren't near the objects.
You should write something like this:
for y in (this.owned_objects)
(seconds_left<2 || ticks_left() < 50) && suspend(0);
Subject Index |