How to Add Functions and Verbs
Functions are called by verbs or other functions. Verbs are
invoked on the command line.
How to Get Started
- launch tk-moo lite and log on with your
programmer character, and go to your room
- if you are working on your room, find out your room's object
number (either with #here or @audit),
otherwise you can use
#OBJECTNAME to get the object number of other objects
- using tk-moo lite, pull down on 'tools' let
up on 'Macmoose' to get a 'browser' dialog box
- in the 'Browse' field,
type the object number you want to work on, and press return
How to Add a Function
These instructions are tailored to an assignment
calling for a new 'enterfunc' function to be added to a room
- pull down on 'Tools' let up on 'Add Script/Property'
- do the following:
- make sure the 'script' radio button is selected,
- type 'enterfunc' into the 'name' field,
- change the 'perms' field from 'rd' to 'rxd' and
- press the 'Add' button, then press the 'Close' button
- on the 'browser' dialog box, double
click 'enterfunc' on the Scripts/Verbs list
- enter your code in the 'verb editor',
don't forget to write meaningful comments,
and that you save your work with the 'send' option on the 'file' menu.
Assuming your room was #12345 and you are #67890, you can test
this code by typing:
;#12345:enterfunc(#67890)
How to Add a Verb
These instructions are tailored to an assignment
calling for a new 'report' verb to be added to an object
or a room
- pull down on 'Tools' let up on 'Add Script/Property'
- do the following:
- make sure the 'script' radio button is selected,
- type 'report' into the 'name' field,
- make sure the 'perms' field has 'rd' (do NOT change to 'rxd')
- change the 'args' from 'none none none' to 'this none none'
- press the 'Add' button, then press the 'Close' button
- on the 'browser' dialog box, double
click 'report' on the Scripts/Verbs list
- enter your code in the 'verb editor',
don't forget to write meaningful comments,
and that you save your work with the 'send' option on the 'file' menu.
Assuming your object is named TrafficCounter12345, you can test
this code by typing:
report TrafficCounter12345
Modified: 21Feb10, 4Mar13
Send comments to:
slator@cs.ndsu.edu