Knowledgebase
Storm Palace Hosting > Storm Hosting Help Desk > Knowledgebase

Ask a question:


Day/Night

Solution ;Changes the spot picture based on time of day.
;- the first picture shows during the day, the second picture shows at night.
ON ENTER
{
0 ME SETALARM
}
ON ALARM
{
;***Set your time data here***
630 daystart = ;time day starts in 2400 format
1830 nightstart = ;time night starts in 2400 format
-8 tz = ;time zone change from Zulu (GMT or Universal) in hours
0 dst = ;0 = standard, 1 = daylight savings
;***end of time data***
;
;get current time
DATETIME mytime =
{ 2085978496 mytime += } { tz dst + 3600 * mytime += } DATETIME 0 < IFELSE
mytime 86400 % myday =
myday DUP 3600 / hours = 3600 % mins_secs =
mins_secs 60 / minutes =
hours 100 * minutes + timenow =
;turn picture on/off
{ 1 ME SETSPOTSTATELOCAL } timenow daystart < timenow nightstart >= OR ME GETSPOTSTATE NOT AND IF
{ 0 ME SETSPOTSTATELOCAL } timenow daystart >= timenow nightstart < AND ME GETSPOTSTATE AND IF
3600 ME SETALARM
}
 
Was this article helpful? yes / no
Article details
Article ID: 219
Category: Room Scripts
Date added: 07-11-2011 20:09:42
Views: 1210
Rating (Votes): Article rated 5.0/5.0 (1)

 
<< Go back

Powered by Help Desk Software HESK™