February 22, 20251 yr Hello, I would like to create a button on my Streamdeck that displays an image based on the value AMBIENT PRECIP STATE, Number. 2 = None (image1) 4 = Rain (image2) 8 = Snow (image3) I created a script located at MyScripts > Weather_State with the following: (A:AMBIENT PRECIP STATE, Mask) 2 == if{'None'} els{ (A:AMBIENT PRECIP STATE, Mask) 4 == if{RAIN} els{ (A:AMBIENT PRECIP STATE, Mask) 8 == if{SNOW} els{ '' } } } Under Variable1 I have the following settings: Variable A: ( I have tried them all A L P E S B ) MyScripts-Weather_State Two questions. One, the above still only displays the variable value 2, 4 or 8 why is it not displaying None, Rain or Snow? Two, how do I get the above script to show an image based on the 2, 4 or 8 value that is returned? Thanks in advance!
February 22, 20251 yr Commercial Member 1 hour ago, IrwinMFletcher said: Two questions. One, the above still only displays the variable value 2, 4 or 8 why is it not displaying None, Rain or Snow? What action are you using? In general, a script doesn't return a value when you call it by "group-name". That syntax is only for executing it (>K:). For example, when using it i a TextGauge action the type would be S: and then paste the entire code into the box - after fixing the syntax errors, rain and snow aren't string literals. Also be mindful that this must be a single line of code, there can't be any line breaks in it (like there are in your script above) (A:AMBIENT PRECIP STATE, Mask) 2 == if{ 'None' } els{ (A:AMBIENT PRECIP STATE, Mask) 4 == if{ 'RAIN' } els{ (A:AMBIENT PRECIP STATE, Mask) 8 == if{ 'SNOW' } els{ 'NONE' } } } 1 hour ago, IrwinMFletcher said: Two, how do I get the above script to show an image based on the 2, 4 or 8 value that is returned? Use either a SliderGauge or a MultiGauge and utilize the AVar directly, without a script. Here is a video about how a SliderGauge works, made by a fellow simmer Edit: sorry, I just realized that it is in German. You will have to trust YouTube's AI CC translation . Edited February 22, 20251 yr by Lorby_SI LORBY-SI
February 22, 20251 yr Commercial Member Btw and you will need a bit of math - just leaving this here in case you struggle with the SliderGauge. To convert the bit mask (A:AMBIENT PRECIP STATE, Mask) into values 0,1,2 for easy multiplication you use the log operator to base 2 and subtract 1 from it: (A:AMBIENT PRECIP STATE, Mask) 2 log 1 - LORBY-SI
Create an account or sign in to comment