Page 2 of 2

Re: LUA data is nil

Posted: December 22nd, 2017, 5:48 pm
by balala
mworsnop wrote:Here is the complete INI and LUA.
Without the ApiKey.

Re: LUA data is nil

Posted: December 22nd, 2017, 6:09 pm
by mworsnop
Yes I left that out as its registered to me. I will send you my key in PM

Re: LUA data is nil

Posted: December 22nd, 2017, 6:47 pm
by balala
I'm sorry, but something is still going wrong. Loading your skin with the given variables, still gives a RegExp matching error (-1) error (about the [WeatherForecast] measure). Trying to open the posted URL in a web browser (again, replacing the variables with the appropriate given values), doesn't open anything, just this:

Code: Select all

<?xml version="1.0"?>
-<response>
	<version>0.1</version>
	<termsofService>http://www.wunderground.com/weather/api/d/terms.html</termsofService>
	-<features>
		<feature>alerts</feature>
	</features>
	-<error>
		<type>unknownfeature</type>
	</error>
	<alerts> </alerts>
</response>
So, I'm not sure what's going on, maybe the needed URL isn't accessible for me (outside of US)?

Re: LUA data is nil

Posted: December 23rd, 2017, 4:19 am
by mworsnop
Those errors are both correct. There are no descriptions as there are no alerts.

The URL is correct. There are no alerts right now.

But in the LUA I should be able to do the print and see the weatherData var so I can see if its working.

Re: LUA data is nil

Posted: December 23rd, 2017, 8:55 pm
by balala
mworsnop wrote:But in the LUA I should be able to do the print and see the weatherData var so I can see if its working.
Where? I mean where would you like to see weatherData? Using the print function probably works in standalone used lua (however I never workd so, so I'm not sure), but not here. To can see the data through the Rainmeter skin, you should have to use instead of the print function a this kind of command: SKIN:Bang('!SetOption', 'MyStringMeter', 'Text', weatherData). This command sets the Text option of the [MyStringMeter] meter, which you must have in the code of your skin. Something like:

Code: Select all

[MyStringMeter]
Meter=STRING
X=0
Y=0
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Obviously you can use here any options you'd like, this is just an example. Important is that this meter doesn't have a Text option, which isn't needed, because it is set by the above lua command.

Re: LUA data is nil

Posted: December 24th, 2017, 4:08 pm
by mworsnop
In the LUA I would like to see weatherData print to the log. weatherData should be the data that was returned from the URL.

Re: LUA data is nil

Posted: December 24th, 2017, 8:24 pm
by balala
mworsnop wrote:In the LUA I would like to see weatherData print to the log. weatherData should be the data that was returned from the URL.
Well, I have no idea how you could send information directly from the lua script to the log of Rainmeter. From the Rainmeter skin it can be (through the !Log bang), but I doubt you could from the .lua script. I don't say precisely you can't, I say just that I don't know how. Maybe someone else how knows will come to help.
Sorry...

Re: LUA data is nil

Posted: December 24th, 2017, 11:32 pm
by jsmorley
balala wrote:Well, I have no idea how you could send information directly from the lua script to the log of Rainmeter. From the Rainmeter skin it can be (through the !Log bang), but I doubt you could from the .lua script. I don't say precisely you can't, I say just that I don't know how. Maybe someone else how knows will come to help.
Sorry...
The print() command in Lua outputs to the Rainmeter log.

Re: LUA data is nil

Posted: December 25th, 2017, 9:52 am
by balala
jsmorley wrote:The print() command in Lua outputs to the Rainmeter log.
Indeed. I had no idea about this. But it indeed does.
Thanks for the info.