Find
You are looking at a boucing thing which wants to be pushed
This object is a birthday suprise
It demonstrates toggling the timer on and off
push it
It also demonstrates:
responding to an action (push)
doing a random block of code on a timer (tockloc)
checking the actor is the target
finding a random object in the current location
doing or saying a random sentence
finding a doorway in the current location
moving out a random doorway
notifying current locaiton and new location of arival/departure
Since it has the magical words ##base: in its code you can quickly make new coded copies of this when you
create a bouncing thing
Created by
wolis
, last updated 28 Jan 2007
Code
##txickloc:runsub whatodo;
##push:runsub toggleit;
##base: rem - this is a base bouncing thing so more can be namde easily;
##whatodo:runsub bounceme or supriseme or transmoveme;
##bounceme:
find $loc, random not me;
var $how to (on,behind,beside,against,over,towards,away from,on top of);
say 'msg',"[$actor] bounces $how [$found_id]";
##supriseme:
var $how to (sings,laughs,dances,shouts,says);
var $msg to (Happy Birthday!,Woo hoo!,My oh my - another year older,Yippie!!);
say 'msg',"[$actor] $how '$msg'";
rem -----------------------------------------------------;
##toggleit:
if $actor eq $target then checkstate else end;
##checkstate:
if $actor's slot1 eq "1" then switchon else switchoff;
##switchon:
set $actor's slot1 to "0";
code $actor switch on;
say 'msg',"[$actor] wakes up";
##switchoff:
set $actor's slot1 to "1";
code $actor switch off;
say 'msg',"[$actor] goes to sleep";
rem -----------------------------------------------------;
##transmoveme:
find $loc,random doorway;
var $tlink to $found_id's link;
var $tloc to $tlink's loc;
say 'leaves',"[$actor] bounces away via [$found_id]";
clear $actor,all;
msg $loc,$actor,0,0,'force',"force:look $loc";
set $actor's loc to $tloc;
var $loc to $tloc;
msg $tloc,$actor,0,0,'arrives',"[$actor] bounces in from [$tlink] and settles on the ground";
rem say 'arrives',"[$actor] bounces in from [$tlink] and settles on the ground";
msg $tloc,$actor,0,0,'force',"force:look $tloc";