;Alan's refreshing prop room script ;adapted from a script by FOXY ;Last updated May 6, 2001 ;Place the following script in a spot: ON ENTER { mainscript GLOBAL ME ID mainscript = cmd GLOBAL refresh GLOBAL stopped GLOBAL dataformat GLOBAL ; ;******************************************************************************* ;define which format of prop IDs you are using. ;use: "brackets" dataformat = if you are using prop IDs defined as [ xxxx xxxx xxxx ] ;use: "quotes" dataformat = if you are using prop IDs defined as "xxxx xxxx xxxx" "quotes" dataformat = ;******************************************************************************* ; 0 stopped = { "refresh" cmd = } { "init" cmd = } refresh IFELSE 0 ME SETALARM } ON INCHAT { refresh GLOBAL ; { refresh_startroom GLOBAL roomarraydef GLOBAL roomarrayindex GLOBAL roomarraydef EXEC roomarrayindex ++ { 0 refresh = "Refresh completed.\x0d" LOGMSG "." SAY refresh_startroom GOTOROOM } { roomarray roomarrayindex GET GOTOROOM } roomarrayindex nbrrooms >= IFELSE } CHATSTR ";endofprops" == refresh AND IF ;Get your name minus any leading asterisks { "$1" GREPSUB myname = } USERNAME "[*]*(.*)" GREPSTR IF ;If they say your name let them know you're busy. { "Message from " USERNAME & ": I'm automatically refreshing props. I may not respond to you." & ROOMMSG } CHATSTR myname SUBSTR refresh AND IF } ON OUTCHAT { cmd GLOBAL dataformat GLOBAL refresh GLOBAL stopped GLOBAL ;help commands { "Say 'propids' to list in your log the prop ID's you're currently wearing." LOCALMSG "Copy the ID line from the log and paste it into the script where indicated." LOCALMSG "You may also say 'propids text' which will cause the text you type to be added to your ID's." LOCALMSG } CHATSTR "help" == ISWIZARD AND IF ;"propids " - write prop data to log in form to put in database { 0 i = { "[ " } { "\" " } dataformat "brackets" == IFELSE { i USERPROP ITOA & " " & i ++ } { i NBRUSERPROPS == NOT} WHILE { "] ;" } { "\";" } dataformat "brackets" == IFELSE & "$1" GREPSUB & LOGMSG "" CHATSTR = } CHATSTR LOWERCASE "^propids(.*)" GREPSTR IF ;turn refresh off. { 0 refresh = 1 stopped = "stop" cmd = "Refresh stopped." LOGMSG "" CHATSTR = } CHATSTR "stoprefresh" == refresh AND ISWIZARD AND IF ;resume refresh. { 1 refresh = 0 stopped = "autoforward" cmd = "Refresh resumed." LOGMSG "" CHATSTR = 0 ME SETALARM } CHATSTR "resumerefresh" == stopped AND ISWIZARD AND IF } ON ALARM { cmd GLOBAL dataformat GLOBAL prop GLOBAL refresh GLOBAL refresh_time GLOBAL unitsspot GLOBAL tensspot GLOBAL ; [ ;******************************************************************************* ; if "brackets" format, put prop id's here in form: [ id id id id id id id id id ] ; propname (optional) ; if "quotes" format, put prop id's here in form: " id id id id id id id id id " ; propname (optional) " 960332508 960332502 960332496 " " 960333085 960333094 960333102 960333112 " " 957916456 " ;******************************************************************************* ] proparray = proparray LENGTH nbrprops = ;nextprop - get next prop { { 0 prop = { ";endofprops" SAY "stop" cmd = } refresh IF } prop nbrprops >= IF { nbrprops 1 - prop = } prop 0 < IF prop 1 + 10 / tensspot SETSPOTSTATELOCAL prop 1 + 10 % unitsspot SETSPOTSTATELOCAL "Now showing avatar " prop 1 + ITOA & " of " & nbrprops ITOA & LOGMSG { proparray prop GET SETPROPS} { "[" proparray prop GET & "] SETPROPS" & STRTOATOM EXEC } dataformat "brackets" == IFELSE } getprop DEF ; ; commands ; { -1 prop = "There are " nbrprops ITOA & " avatars in this room." & LOCALMSG "Use 'Reset' to start with avatar 1" LOCALMSG "Use '>' and '<' to change the avatar" LOCALMSG "Use '>>' and '<<' to cycle automatically between avatars" LOCALMSG "Use the black square to stop the automatic cycles." LOCALMSG } cmd "init" == IF ; { -1 prop = "\x0dRefreshing " ROOMNAME & LOGMSG "Message from " USERNAME & ": I'm automatically refreshing props. I may not respond to you." & ROOMMSG "autoforward" cmd = } cmd "refresh" == IF ; { 0 prop = getprop EXEC } cmd "reset" == IF ; { prop ++ getprop EXEC } cmd "next" == IF ; { prop -- getprop EXEC } cmd "previous" == IF ; ;******************************************************************************* ;Set the automatic display time in seconds (time between prop changes) 5 display_time = ;******************************************************************************* { prop++ getprop EXEC { refresh_time 60 * ME SETALARM } { display_time 60 * ME SETALARM } refresh IFELSE } cmd "autoforward" == IF ; { prop -- getprop EXEC { refresh_time 60 * ME SETALARM } { display_time 60 * ME SETALARM } refresh IFELSE } cmd "autobackward" == IF ;note: no need for a 'stop' script. Changing 'cmd' stops alarm } ;Place the following scripts in a separate spot marked "Reset": ON SELECT { cmd GLOBAL mainscript GLOBAL "reset" cmd = 0 mainscript SETALARM } ;Place the following scripts in a separate spot marked "Next": ON SELECT { cmd GLOBAL mainscript GLOBAL "next" cmd = 0 mainscript SETALARM } ;Place the following scripts in a separate spot marked "Previous": ON SELECT { cmd GLOBAL mainscript GLOBAL "previous" cmd = 0 mainscript SETALARM } ;Place the following scripts in a separate spot marked "Stop": ON SELECT { cmd GLOBAL mainscript GLOBAL "stop" cmd = 0 mainscript SETALARM } ;Place the following scripts in a separate spot marked "Auto Forward": ON SELECT { cmd GLOBAL mainscript GLOBAL { 0 mainscript SETALARM } cmd "autoforward" == NOT cmd "autobackward" == NOT AND IF "autoforward" cmd = } ;Place the following scripts in a separate spot marked "Auto Backward": ON SELECT { cmd GLOBAL mainscript GLOBAL { 0 mainscript SETALARM } cmd "autoforward" == NOT cmd "autobackward" == NOT AND IF "autobackward" cmd = } ;Place the following script in a separate door to disply the one's digit of the prop number: ON ENTER { unitsspot GLOBAL ME unitsspot = 0 ME SETSPOTSTATELOCAL } ;Place the following script in a separate door to display the ten's digit of the prop number: ON ENTER { tensspot GLOBAL ME tensspot = 0 ME SETSPOTSTATELOCAL }