Re: LUA data is nil
Posted: December 22nd, 2017, 5:48 pm
Without the ApiKey.mworsnop wrote:Here is the complete INI and LUA.
Without the ApiKey.mworsnop wrote:Here is the complete INI and LUA.
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>
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: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.
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
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.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.
The print() command in Lua outputs to the Rainmeter log.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...
Indeed. I had no idea about this. But it indeed does.jsmorley wrote:The print() command in Lua outputs to the Rainmeter log.