Hey all, I've been trying to create a Rainmeter skin that changes the static IP address of a network adapter. When I click on the meter, it prompts for the address and the subnet mask, and stores them as variables which I then try to concatenate with a space in between to help with delimiting later.
However, when I try to send my lua script the parameters, it only receives the variables names, not their values. i.e. "#contents#" instead of "192.168.x.x 255.255.255.0".
I've looked over a lot of posts with similar issues, but none of the solutions there seemed to help. I just can't wrap my head around the syntax here. I know there's an issue with my !SetVariable bangs, because if I initialize #contents# in the Variables section, the initial value won't be overwritten at the output.
Here's my skin code, followed by my lua script. The end result is just an info.txt file with (hopefully) the address and subnet mask one space apart. Thanks for looking over my code![Smiler :)]()
However, when I try to send my lua script the parameters, it only receives the variables names, not their values. i.e. "#contents#" instead of "192.168.x.x 255.255.255.0".
I've looked over a lot of posts with similar issues, but none of the solutions there seemed to help. I just can't wrap my head around the syntax here. I know there's an issue with my !SetVariable bangs, because if I initialize #contents# in the Variables section, the initial value won't be overwritten at the output.
Here's my skin code, followed by my lua script. The end result is just an info.txt file with (hopefully) the address and subnet mask one space apart. Thanks for looking over my code

Code:
[Rainmeter]Update=-1DynamicWindowSize=1AccurateText=1[Variables]filePath="C:\\Users\\<User>\\Documents\\Rainmeter\\Skins\\<User>\\Change IP to Static\\info.txt"contents=!SetVariableFontSize=12[measureScript]Measure=scriptscriptFile=Script.lua[measureInput]Measure=pluginPlugin=InputTextDynamicVariables=1SolidColor=76A0E8FFFontColor=255,255,255,255Command1=[!SetVariable ipAddress "$UserInput$"] DefaultValue="Input IP Address"Command2=[!SetVariable subnetMask "$UserInput$"] DefaultValue="Input Subnet Mask"Command3=[!SetVariable contents "#ipAddress# #subnetMask#"]Command4=[!CommandMeasure "measureScript" "WriteFile('#filePath#', '#contents#')"]Command5=[!CommandMeasure "measureCommands" "Run"][measureCommands]Measure=PluginPlugin=RunCommandProgram="C:\Users\<user>\Documents\Rainmeter\Skins\<user>\Change IP to Static\Static.bat"State=show[meterChangeStaticIP]Meter=StringX=95%FontColor=255,255,255,255SolidColor=47,47,47,255Padding=5,5,5,5Text=Click to set WiFi to Static IPLeftMouseUpAction=[!CommandMeasure "measureInput" "ExecuteBatch 1-5"]
Code:
function WriteFile(filePath, contents)local File = io.open(filePath, 'w')if not File thenprint('WriteFile: unable to open file at ' .. filePath)returnendFile:write(contents)File:close()return trueend
Statistics: Posted by lyingriotman — Yesterday, 10:17 pm — Replies 9 — Views 148