It is currently September 19th, 2021, 1:53 am

LuaWind

Weather skins
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

LuaWind

Post by jsmorley »

This is another example of how you might use Mattking's fabulous new Lua Measure=Script feature of the latest Rainmeter 1.4 beta.

This will obtain the current wind direction in compass degrees from Yahoo Weather, and turn it into some useful information.

First get the latest beta (at least r676) from http://Rainmeter.net.

Then install this skin:
LuaWind.rmskin
12-29-2010 1-00-46 PM.png
You do not have the required permissions to view the files attached to this post.
sgtevmckay

Re: LuaWind

Post by sgtevmckay »

Tried to install.
Rainmeter Crashed with the following information:

Code: Select all

Files that help describe the problem:
  C:\Users\Magis Esse\AppData\Local\Temp\WERB0D4.tmp.WERInternalMetadata.xml
  C:\Users\Magis Esse\AppData\Local\Temp\WERC935.tmp.appcompat.txt
  C:\Users\Magis Esse\AppData\Local\Temp\WERCB48.tmp.hdmp

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
I can pull down information from the mention files if necessary

Restart of Rainmeter; the skin works like a champ.

Too bad we are unable to get the image to rotate to reflect the wind direction ;)
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: LuaWind

Post by jsmorley »

sgtevmckay wrote:Tried to install.
Rainmeter Crashed with the following information:

Code: Select all

Files that help describe the problem:
  C:\Users\Magis Esse\AppData\Local\Temp\WERB0D4.tmp.WERInternalMetadata.xml
  C:\Users\Magis Esse\AppData\Local\Temp\WERC935.tmp.appcompat.txt
  C:\Users\Magis Esse\AppData\Local\Temp\WERCB48.tmp.hdmp

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
I can pull down information from the mention files if necessary

Restart of Rainmeter; the skin works like a champ.

Too bad we are unable to get the image to rotate to reflect the wind direction ;)
Actually, that would be really simple. Just use your image, set dynamicvariables=1 and set ImageRotate=[WindDirection] Just so happens that degrees of a compass and of the full rotation of an image are 0 to 360, so no clever calculating needs to be done.
sgtevmckay

Re: LuaWind

Post by sgtevmckay »

jsmorley wrote:Actually, that would be really simple. Just use your image, set dynamicvariables=1 and set ImageRotate=[WindDirection] Just so happens that degrees of a compass and of the full rotation of an image are 0 to 360, so no clever calculating needs to be done.
Just need to separate the Center sun Icon from the Compass ring
I am going to work on that.
Great Graphics find :great:
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: LuaWind

Post by jsmorley »

sgtevmckay wrote: Just need to separate the Center sun Icon from the Compass ring
I am going to work on that.
Great Graphics find :great:
Yeah, and have one of the "beams" highlighted so it becomes a "pointer" and start it pointing north. Then just set ImageRotate and you have it.
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: LuaWind

Post by jsmorley »

Or put the pointer in the middle like this:

User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: LuaWind

Post by jsmorley »

Fixed a small typo in the .lua file. New version in the first post.
TheAslan
Posts: 87
Joined: June 4th, 2009, 10:41 pm

Re: LuaWind

Post by TheAslan »

I don't understand how you managed to get that Northwest text in your skin, i checked the code but there wasn't any measurements for that? Or did i missed something?
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: LuaWind

Post by jsmorley »

TheAslan wrote:I don't understand how you managed to get that Northwest text in your skin, i checked the code but there wasn't any measurements for that? Or did i missed something?
Most of that work is done in the .lua file, not the skin .ini.

It's a simple two dimensional lookup table that uses the wind direction in degrees returned by the skin to look up the appropriate full direction text and abbreviation (North by Northwest / NbNW). The Lua script then simply sets the values of the meters displaying this information.
TheAslan
Posts: 87
Joined: June 4th, 2009, 10:41 pm

Re: LuaWind

Post by TheAslan »

So what i have to write in .ini file to get it show?