![]() |
|
"Mosh," like "dressup," started as an allscray hack and grew into the full, luxuriant form we know today. And like its dressy cousin, the guts of "mosh" are in a single spot script.
; In the ENTER section, we initialize the
; shared variable "moshDel," which controls how fast each
; individual moshes.
ON ENTER {
moshDel GLOBAL
45 moshDel =
}
; In the OUTCHAT block, we let the user decide if they've had enough,
; or if they're hungry for more
ON OUTCHAT {
moshDel GLOBAL
{
45 moshDel =
"Reseting Mosh" STATUSMSG
"" CHATSTR =
} CHATSTR "mosh" == moshDel 1 < AND IF
{
0 moshDel =
"No Mosh For You" STATUSMSG
"" CHATSTR =
} CHATSTR "nomosh" == IF
}
; The INCHAT carries
the real meat of the "mosh."
ON INCHAT {
moshDel GLOBAL
{
POSX px = POSY py = 0 i =
{
{ 22 468 RANDOM + 22 340 RANDOM + SETPOS } i moshDel * ALARMEXEC
i ++
} { i 20 < } WHILE
px ITOA " " & py ITOA & " SETPOS" & STRTOATOM i moshDel * ALARMEXEC
} CHATSTR "mosh" == moshDel 10 > AND IF
}
|
As long as their moshDel is at least 10 (about 1/6th of a second),
anyone who hears the word "mosh" will leap around the screen
like a happy idiot. Note that mosh contains two important principles
of X-approved room script design:
INCHAT, you might instead
set the spot to trigger on SELECT
Another way to vary the underlying
idea is to devise new rules for moving the avatars