Place the following script in a door: ;Alan's refreshing prop room script ;adapted from a script by FOXY ;Last updated May 6, 2001 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 ; { "next" cmd = 0 ME SETALARM "" CHATSTR = } CHATSTR "next" == IF ; { "previous" cmd = 0 ME SETALARM "" CHATSTR = } CHATSTR "previous" == IF ; { "stop" cmd = 0 ME SETALARM "" CHATSTR = } CHATSTR "stop" == IF ; { { 0 ME SETALARM } cmd "autoforward" == NOT cmd "autobackward" == NOT AND IF "autoforward" cmd = "" CHATSTR = } CHATSTR "showme" == IF } ON ALARM { cmd GLOBAL prop GLOBAL refresh GLOBAL refresh_time GLOBAL dataformat 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 " " 924020057 924020054 924020049 " ;******************************************************************************* ] 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 "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 "Say 'showme' to view the props in this room." LOCALMSG "Say 'stop' to stop the props." LOCALMSG "Say 'next' to view the next prop." LOCALMSG "Say 'previous' to view the previous prop." 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 ; { 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 ; ;note: no need for a 'stop' script. Changing 'cmd' stops alarm }