You are in a book of howtos

How To Do Things In COWScript

How to find things
These set the variable $found_id

How to find an specific object in your current location:

find $loc,small chair;


How to find an specific object in the actor:

find $actor,small chair;


How to find an random object in your current location:

find $loc,random;


How to find an random object which is not the actor:

find $loc,random not me;


How to find an random object which is a doorway:

find $loc,random doorway;


How to find an random object which is a player and not the actor:

find $loc,random player not me;


How to find an random object which is not a doorway, a player or the actor:

find $loc,random not doorway not player not me;


How to move an objects location
If the object to be moved is known as $found_id and the new location is $dest:

set $found_id's loc to $dest;


You would want to tell people in the old location that the object has left, and in the new location that it has arrived so the complete code is this:


var $loc to $found_id's loc;
say 'leaves',"[$actor] winks out of existance!";
set $found_id's loc to $dest;
var $loc to $dest;
say 'arrives',"[$actor] arrives with a pop!";


How to set a variable to a random string of text


var $colour to (red,yellow,white,orange with green bits,black and white,purple);


How to set a variable to the displayable unformated name of an object
This sets a variable $this_name

findname $trget,plain;