Ok, there are a couple of syntax problems here:
- sType and sLabel are never defined.
- You don't need pounds signs (#) in GetVariable().
- You never ended your last "if" statement. I think you confused it with the "end" for Update().
- "exit" is not a standard Lua command for if-statements. And if you're not actually doing anything when the two variables are equal (only when they're not equal), you might as well just use one condition.
- You will probably have some errors unless you put "#CURRENTPATH#variables.inc" in double quotes.
In addition, I can see some conceptual problems:
- You probably want to get #CURRENTCONFIGX# and #CURRENTCONFIGY# in Update(), not Initialize(). Otherwise, you will only be able to use the coordinates from when the skin is first loaded.
- Finally, this probably doesn't affect how the code works, but generally, "x" is associated with horizontal space (i.e. widths), and "y" with vertical space (i.e. heights).
I've cleaned up the most basic mistakes below, but there are still some missing elements you will need to provide.
Code: Select all
function Update()
msXwidth = SKIN:GetVariable('CURRENTCONFIGX')
msXheight = SKIN:GetVariable('CURRENTCONFIGY')
--These have to be defined as something before you can use them:
sType =
sLabel =
if sType ~= msXwidth then
SKIN:Bang('!WriteKeyValue Variables LocationX #CURRENTCONFIGX# "#CURRENTPATH#variables.inc"')
end
if sLabel ~= msXheight then
SKIN:Bang('!WriteKeyValue Variables LocationY #CURRENTCONFIGY# "#CURRENTPATH#variables.inc"')
end
SKIN:Bang('!Refresh')
return '99'
end -- function Update