From b57b24655ca52f031aa87898ba8db132767523d0 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 18 Jun 2008 19:38:30 +0000 Subject: contribute weather map cycling script using osDynamicTextures. --- bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml | 7 ++++ bin/assets/ScriptsAssetSet/osWeatherMap.lsl | 43 ++++++++++++++++++++++ .../ScriptsLibrary/ScriptsLibraryItems.xml | 13 +++++++ 3 files changed, 63 insertions(+) create mode 100644 bin/assets/ScriptsAssetSet/osWeatherMap.lsl diff --git a/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml b/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml index 341454f..8f85027 100644 --- a/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml +++ b/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml @@ -139,4 +139,11 @@ +
+ + + + + +
diff --git a/bin/assets/ScriptsAssetSet/osWeatherMap.lsl b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl new file mode 100644 index 0000000..7dda87b --- /dev/null +++ b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl @@ -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 ); + } +} diff --git a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml index b78c094..3f674eb 100644 --- a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml +++ b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml @@ -300,4 +300,17 @@ +
+ + + + + + + + + + + +
-- cgit v1.1