;Alan's refreshing room script. ;Place the following in any room which contains props ;which you want refreshed. ;Add the prop IDs where indicated. ;Add the room number to the Refreshing Control script. ON ENTER { mainscript GLOBAL ME mainscript = refresh GLOBAL cmd GLOBAL { "refresh" cmd = 0 ME SETALARM } refresh IF } ON INCHAT { refresh GLOBAL ;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 { refresh GLOBAL stopped GLOBAL ;help commands { "To determine the IDs of props you want refreshed put them in the room and type: / SHOWLOSEPROPS" LOCALMSG "The prop IDs (the six digit numbers) as well as their x y position will be shown in your log." LOCALMSG "Copy the prop IDs and paste them into the Room Refresher script where indicted." LOCALMSG } CHATSTR "help" == ISWIZARD AND 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 = "Refresh resumed." LOGMSG "" CHATSTR = 0 ME SETALARM } CHATSTR "resumerefresh" == stopped AND ISWIZARD AND IF } ON ALARM { refresh GLOBAL refresh_time GLOBAL cmd GLOBAL ;initialize { stopped GLOBAL 0 stopped = -1 prop = "\x0dRefreshing " ROOMNAME & LOGMSG "Message from " USERNAME & ": I'm automatically refreshing props. I may not respond to you." & ROOMMSG "" cmd = } cmd "refresh" == IF ;refresh refresh_startroom GLOBAL roomarraydef GLOBAL roomarrayindex GLOBAL prop GLOBAL [ ;***************Place Prop IDs here**************** ;in the form: [ 1234567890 ... 1234667890 ] [ 1234567890 ... 1234567890 ] [ -1269774719 -1269774725 -1269774743 -1269774749 -1244193098 -1266931860 -1269777152 ] ;************************************************** ] proparray = proparray LENGTH nbrprops = ;nextprop - get next prop prop ++ { "Now refreshing prop " prop 1 + ITOA & " of " & nbrprops ITOA & LOGMSG NAKED proparray prop GET SETPROPS } { roomarraydef EXEC roomarrayindex ++ { 0 refresh = "Refresh completed.\x0d" LOGMSG "." SAY refresh_startroom GOTOROOM } { roomarray roomarrayindex GET GOTOROOM } roomarrayindex nbrrooms >= IFELSE } prop nbrprops < IFELSE { refresh_time 60 * ME SETALARM } refresh IF }