It is currently May 2nd, 2024, 5:04 am

SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Report bugs with the Rainmeter application and suggest features.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Post by Mordasius »

I have been having problems using SKIN:Bang('!SetOption ... Text "..." ') and SKIN:Bang('!SetOption ... ToolTipTitle "..." ') on a STRING Meter since installing 2.3.0 beta r1172 64-bit (Feb 5 2012). The relevant part of the .LUA file is:

Code: Select all

function Update()
.....

SKIN:Bang('!SetOption ShowNumActiveStorms Text "Active Storms ( '..iNumStorms..' )\" ')--<< CAUSES ERROR >> --

for i = 1, iNumStorms do

sTitleTipText = sTitleTipText.."- "..tStormName[i].."\n"
SKIN:Bang('!SetOption ShowNumActiveStorms ToolTipText \"'..sTitleTipText..'\"')
SKIN:Bang('!SetOption ShowNumActiveStorms ToolTipTitle "Active Storms" ') --<< CAUSES ERROR >> --
sStormTipText = ""
SKIN:Bang('!SetOption StormMeter'..i..' LeftMouseUpAction """!Execute [http://www.wunderground.com'..tStormLink[i]..']"""')
SKIN:Bang('!SetOption StormMeter'..i..' ImageName ts.png')	
SKIN:Bang('!MoveMeter '..(Xpos[i])..' '..(Ypos[i])..' StormMeter'..i..'')		
SKIN:Bang('!SetOption StormMeter'..i..' ToolTipTitle \"'..tStormName[i]..'\"')
sStormTipText = "Wind:     "..tWind[i].."\n".."Moving: "..tMoving[i]
SKIN:Bang('!SetOption StormMeter'..i..' ToolTipText\"'..sStormTipText..'\"')			

end
.....
end -- function Update
Both of the lines marked --<< CAUSES ERROR >> -- result in Error 00:00:03.479 Bang:Config " " not found. All the other SKIN:BANG('!SetOption ...)s, including SKIN:Bang('!SetOption ShowNumActiveStorms ToolTipText \"'..sTitleTipText..'\"')acting on the same String Meter, are fine.

There were no such problems with Rainmeter 2.2.0 r1116 64-bit (Jan 8 2012)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Post by jsmorley »

The problem in both cases is the trailing "space" at the end of the bang.

SKIN:Bang('!SetOption ShowNumActiveStorms Text "Active Storms ( '..iNumStorms..' )\" ')

This is telling Rainmeter to send the bang to a Config of "", which of course does not exist. Removing that space:

SKIN:Bang('!SetOption ShowNumActiveStorms Text "Active Storms ( '..iNumStorms..' )\"')

makes it work fine.

However, I did test in 2.2 and while it is and was a syntax error really, Rainmeter 2.2 seems to ignore it and work anyway. We will look into what was changed that is no longer forgiving this error. In the meantime, fix your skin.. ;-)
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Post by Mordasius »

jsmorley wrote:The problem in both cases is the trailing "space" at the end of the bang.
That fixed it. Thanks :)

I get into all sorts of problems trying to get the endings right in the first place without thinking too carefully about the spaces. Guess that means I'm going to have to go back and take a look at my older skins which will probably start churning out the same errors.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Post by jsmorley »

Mordasius wrote:That fixed it. Thanks :)

I get into all sorts of problems trying to get the endings right in the first place without thinking too carefully about the spaces. Guess that means I'm going to have to go back and take a look at my older skins which will probably start churning out the same errors.
Yeah, getting complicated bangs with embedded values sent from Lua to Rainmeter sometimes feels as much an art as a science...

Here is one of my favorites. Took a while to sort this one out.

SKIN:Bang('!SetOption MeterTitle'..i..' LeftMouseUpAction """!Execute [\"'..tLinks..'\"]"""')
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: SKIN:Bang('!SetOption ... problem with 2.3.0 beta r1172

Post by Mordasius »

I see your

SKIN:Bang('!SetOption MeterTitle'..i..' LeftMouseUpAction """!Execute [\"'..tLinks..'\"]"""')

AND/OR I raise you smurfier's

SKIN:Bang('!SetVariable "'..sVariablePrefix..'ItemTitle'..i..'" """'..(tTitles and tTitles or '')..'"""')

:???: