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

  1. launch tk-moo lite and log on with your programmer character, and go to your room

  2. 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

  3. using tk-moo lite, pull down on 'tools' let up on 'Macmoose' to get a 'browser' dialog box

  4. 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

  1. pull down on 'Tools' let up on 'Add Script/Property'

  2. do the following:

    1. make sure the 'script' radio button is selected,
    2. type 'enterfunc' into the 'name' field,
    3. change the 'perms' field from 'rd' to 'rxd' and
    4. press the 'Add' button, then press the 'Close' button

  3. on the 'browser' dialog box, double click 'enterfunc' on the Scripts/Verbs list

  4. 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

  1. pull down on 'Tools' let up on 'Add Script/Property'

  2. do the following:

    1. make sure the 'script' radio button is selected,
    2. type 'report' into the 'name' field,
    3. make sure the 'perms' field has 'rd' (do NOT change to 'rxd')
    4. change the 'args' from 'none none none' to 'this none none'
    5. press the 'Add' button, then press the 'Close' button

  3. on the 'browser' dialog box, double click 'report' on the Scripts/Verbs list

  4. 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