contribute weather map cycling script using osDynamicTextures.
parent
2c78bdef84
commit
b57b24655c
|
@ -139,4 +139,11 @@
|
||||||
<Key Name="inventoryType" Value="10" />
|
<Key Name="inventoryType" Value="10" />
|
||||||
<Key Name="fileName" Value="osTextBoard.lsl" />
|
<Key Name="fileName" Value="osTextBoard.lsl" />
|
||||||
</Section>
|
</Section>
|
||||||
|
<Section Name="osWeatherMap">
|
||||||
|
<Key Name="assetID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" />
|
||||||
|
<Key Name="name" Value="osWeatherMap" />
|
||||||
|
<Key Name="assetType" Value="10" />
|
||||||
|
<Key Name="inventoryType" Value="10" />
|
||||||
|
<Key Name="fileName" Value="osWeatherMap.lsl" />
|
||||||
|
</Section>
|
||||||
</Nini>
|
</Nini>
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
default
|
||||||
|
{
|
||||||
|
integer count = 0;
|
||||||
|
integer refreshRate = 300;
|
||||||
|
string URL1 = "http://icons.wunderground.com/data/640x480/2xus_rd.gif";
|
||||||
|
string URL2 = "http://icons.wunderground.com/data/640x480/2xus_sf.gif";
|
||||||
|
string URL3 = "http://icons.wunderground.com/data/640x480/2xus_st.gif";
|
||||||
|
string dynamicID="";
|
||||||
|
string contentType="image";
|
||||||
|
|
||||||
|
state_entry()
|
||||||
|
{
|
||||||
|
refresh_texture();
|
||||||
|
llSetTimerEvent(refreshRate); // create a "timer event" every 300 seconds.
|
||||||
|
}
|
||||||
|
|
||||||
|
timer()
|
||||||
|
{
|
||||||
|
refresh_texture();
|
||||||
|
}
|
||||||
|
|
||||||
|
touch_start(integer times)
|
||||||
|
{
|
||||||
|
refresh_texture();
|
||||||
|
}
|
||||||
|
|
||||||
|
void refresh_texture()
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
string url = "";
|
||||||
|
integer c = count % 3;
|
||||||
|
|
||||||
|
if (c == 0) {
|
||||||
|
url = URL1;
|
||||||
|
} else if (c == 1) {
|
||||||
|
url = URL2;
|
||||||
|
} else {
|
||||||
|
url = URL3;
|
||||||
|
}
|
||||||
|
// refresh rate is not yet respected here, which is why we need the timer
|
||||||
|
osSetDynamicTextureURL(dynamicID, contentType ,url , "", refreshRate );
|
||||||
|
}
|
||||||
|
}
|
|
@ -300,4 +300,17 @@
|
||||||
<Key Name="everyonePermissions" Value="257487132" />
|
<Key Name="everyonePermissions" Value="257487132" />
|
||||||
<Key Name="basePermissions" Value="257487132" />
|
<Key Name="basePermissions" Value="257487132" />
|
||||||
</Section>
|
</Section>
|
||||||
|
<Section Name="osWeatherMap">
|
||||||
|
<Key Name="inventoryID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" />
|
||||||
|
<Key Name="assetID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" />
|
||||||
|
<Key Name="folderID" Value="284858c8-9391-6bf1-ddf5-b936f73de853"/>
|
||||||
|
<Key Name="description" Value="A cycling US Weather Map - contributed by Neas Bade" />
|
||||||
|
<Key Name="name" Value="osWeatherMap" />
|
||||||
|
<Key Name="assetType" Value="10" />
|
||||||
|
<Key Name="inventoryType" Value="10" />
|
||||||
|
<Key Name="currentPermissions" Value="257487132" />
|
||||||
|
<Key Name="nextPermissions" Value="257487132" />
|
||||||
|
<Key Name="everyonePermissions" Value="257487132" />
|
||||||
|
<Key Name="basePermissions" Value="257487132" />
|
||||||
|
</Section>
|
||||||
</Nini>
|
</Nini>
|
||||||
|
|
Loading…
Reference in New Issue