Base was dr-dolittle's Iron man skin but the code has for the most part been removed.
Code: Select all
[rainmeter]
by Nicholas Parrell
-weather
VARIABLES============================================
[variables]
temp_f = 15
feelslike_f = 15
City = Philadelphia
;updating = !Execute ["C:\Users\Nick\Documents\Python\testing.py"]
[background]
meter=image
imagename=#skinspath#dr-dolittle\shared\weather.png
x=0
y=0
[luaScript]
Measure = script
ScriptFile = "C:\\Users\\Nick\\Documents\\Rainmeter\\Skins\\dr-dolittle\\@include\\getWeather.lua"
UpdateRate = 1000
[meterTemp]
measurename=luaScript
meter=string
x=120
y=35
fontcolor=0,255,255,150
fontsize=10
stringalign=center
stringstyle=BOLD
fontface=electrofied
;text = 0
text = #temp_f#
antialias=1
DynamicVariables = 1
[meterCity]
measurename=luaScript
meter = String
x = 215
y = 25
stringstyle=normal
fontcolor=00fff6
fontsize=10
stringalign=center
stringstyle=BOLD
fontface=ALGERIAN
antialias=1
;text = 0
text = #City#
DynamicVariables = 1
;postfix="f"
[meterFeelsLiketemp]
measurename=luaScript
meter=string
x=225
y=86
stringstyle=normal
fontcolor=00fff6
fontsize=40
stringalign=center
stringstyle=BOLD
fontface=ALGERIAN
antialias=1
;text = 0
text = #feelslike_f#
postfix="f"
DynamicVariables = 1
lua file
Code: Select all
function ReadFile()
--FilePath = SKIN:MakePathAbsolute(FilePath)
FileP = "C:\\Users\\Nick\\Documents\\Rainmeter\\Skins\\dr-dolittle\\@resources\\weather.txt"
--print(io.open(FileP, "r"))
local File = io.open(FileP, "r")
--print(File)
if not File then
print('ReadFile: unable to open file at ' ..FileP )
return
end
local contents = {}
for Line in File:lines() do
table.insert(contents, Line)
end
print(contents[1])
print(contents[2])
print(contents[3])
SKIN:Bang('!SetVariable', 'temp_f', contents[2])
SKIN:Bang('!SetVariable', 'feelslike_f', contents[3])
SKIN:Bang('!SetVariable', 'City', contents[1])
return
end
ReadFile()
Philadelphia, PA
62.8
62.8
I want to be able to take the values from the text file and set them as the variables temp_f, feelslike_f, and city.
I am just starting to use lua so I am not exactly sure how it integrates with Rainmeter.
As of right now I know that lua is getting the correct values from the file but I am not sure how to set them in Rainmeter file nor if the Rainmeter file in running the lua script.