There arent a whole lotta ways to do this script but Im going to give you as many variations as I can think of.  =)


All this script does is if you click a spot it dims the room.  Click again and it returns to normal.  Good for a lamp in the room.

ON SELECT
{
lev GLOBAL
{ 0 lev = }
{ 50 lev = } lev IFELSE
lev DIMROOM
}


This script below has 4 different levels of darkness.  You can achieve them by saying the command words light, dim, dark, and black.  There was a known bug with the server, the dim scripts and any sound scripts you may have in the room.  Altho, Ive not tested this on the new server with the new client, if music wont play in a room with a dim script, then Ive warned you why that may be.  Take the dim script out and try again.  If the music plays, then there is still this bug.

ON INCHAT
{ lstat GLOBAL CHATSTR lstat = 30 ME SETALARM }

ON ALARM
{
lev GLOBAL
lstat GLOBAL
 { 0 lev = } lstat "light" == IF
 { 60 lev = } lstat "dim" == IF
 { 40 lev = } lstat "dark" == IF
 { 20 lev = } lstat "black" == IF
lev DIMROOM
 }

ON ENTER
{
{ "To dim lights, say...&"   STATUSMSG  } 300 ALARMEXEC
{ " \"dim\", \"dark\", \"black\", or \"light\"."  STATUSMSG  }  500 ALARMEXEC }


Now if you want to create your own script with the darkness that you desire this is all you need to know.......

0 and 100 are the room fully lit with no dim at all.
1 is the DARKEST
99 is the LIGHTEST

Use any script you want, just replace the numbers you see in them with however dark you want the room.
You can even set the dim script up on an alarm for Halloween.  Someone walks into a fully lit room and in 10 seconds it is totally dark.

ON ENTER { 600 ME SETALARM } ;60 ticks = 1 second
ON ALARM { 1 DIMROOM }

A room script that changes with the time of day.  If its getting dark at your house, then its going to be getting dark in your palace too.

ON SIGNON { ptime GLOBAL hr GLOBAL 10 ME SETALARM
{
{ DATETIME 86400 % ti = ti 3600 / 5 - hr = }
{ DATETIME 2085978496 + 86400 % 11647 + 86400 % ti = ti 3600 / hr = }
DATETIME 0 >= IFELSE
{ 24 hr -= } hr 24 > IF
{ 24 hr += } hr 0 < IF
}
ptime DEF }

ON ALARM { ptime GLOBAL hr GLOBAL ptime EXEC
[ 50 50 50 50 60 70 80 90 0 0 0 0 0 0 0 0 0 90 90 80 70 60 50 50 ]
hr_arr = hr_arr hr GET tm = tm DIMROOM
}

ON ENTER { 10 ME SETALARM }

If you want to take this same script above and cause the background pic to change according to time of day, you would do this......
You could modify the code to use spot pics if thats what you want to do by changing the array to spotstates and the DIM to ME SETSPOTSTATELOCAL.  50 would be reflective of midnite to 4am, 60 = 4-5, 70 = 5-6, 80 = 6-7, 90 = 7-8, 0 would be 8am-5pm, and then they start getting darker again.  If you only wanted to use 4 spot pics to represent morning, afternoon, evening, and night, the ALARM handler would look like this if you put those spot pics in in just the order I said.

ON ALARM {  ptime GLOBAL hr GLOBAL ptime EXEC
[ 3 3 3 3 3 3 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 ]
hr_arr =  hr_arr hr GET tm =  tm ME SETSPOTSTATELOCAL
}

0 = morning pic
1 = afternoon pic
2 = evening pic
3 = night pic

The whole script would look like this in its entirety.....

;the 4 pics go in this door
ON SIGNON { ptime GLOBAL hr GLOBAL 10 ME SETALARM
{
{ DATETIME 86400 % ti = ti 3600 / 5 - hr = }
{ DATETIME 2085978496 + 86400 % 11647 + 86400 % ti = ti 3600 / hr = }
DATETIME 0 >= IFELSE
{ 24 hr -= } hr 24 > IF
{ 24 hr += } hr 0 < IF
}
ptime DEF }
ON ALARM {  ptime GLOBAL hr GLOBAL ptime EXEC
[ 3 3 3 3 3 3 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 ]
hr_arr =  hr_arr hr GET tm =  tm ME SETSPOTSTATELOCAL
}
ON ENTER { 10 ME SETALARM }

;And it was pointed out by Alan that the time of day for PCs is the server time, not the client time.  For Macs it is the clien