Still not clear with the docs. Does anyone know how to use inline lua? (or/and require a file?)
looking for something like: [execlua:'readFile("stuff.txt")']
It is currently March 29th, 2024, 5:13 am
How to use inline lua?
-
- Posts: 5
- Joined: June 8th, 2021, 12:41 pm
How to use inline lua?
amogus is pog
-
- Posts: 5
- Joined: June 8th, 2021, 12:41 pm
Re: How to use inline lua?
found it
```
[MeasureScript]
Measure=Script
ScriptFile=filenamehere.lua
Disabled=1
```
and
```
[&MeasureMyScript:GetCharaceterInString('Rainmeter', 5)]
```
```
[MeasureScript]
Measure=Script
ScriptFile=filenamehere.lua
Disabled=1
```
and
```
[&MeasureMyScript:GetCharaceterInString('Rainmeter', 5)]
```
amogus is pog
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How to use inline lua?
Skin:
Lua:
Test.xml:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[&execlua:readFile('#CURRENTPATH#Test.xml')]
[execlua]
Measure=Script
ScriptFile=Test.lua
Disabled=1
[MeterFile]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Code: Select all
function readFile(arg)
file = io.open(arg)
fileTxt = file:read('*all')
file:close()
SKIN:Bang('!SetOption', 'MeterFile', 'Text', fileTxt)
end
Code: Select all
<item>
<Name1>Bob</Name1>
<Name2>Sue</Name2>
</item>
You do not have the required permissions to view the files attached to this post.
-
- Posts: 5
- Joined: June 8th, 2021, 12:41 pm
Re: How to use inline lua?
amogus is pog