Logic Machine Forum
A litle script, but I got no output - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: A litle script, but I got no output (/showthread.php?tid=5207)



A litle script, but I got no output - Quattro - 17.01.2024

I have made this script:
But when I send a 1 value at this two objectadress, nothing happen. What do I do wrong?

Code:
Input_1 = event.getvalue('0/2/3')
Input_2 = event.getvalue('0/2/9')
Output = '0/2/0'

if input_1 == 1
  and input_2 == 1 then
grp.write(output, 35)
  end
   


RE: A litle script, but I got no output - forsterm - 17.01.2024

Hi,
use == true instead of == 1 at your if-statement.


RE: A litle script, but I got no output - Quattro - 17.01.2024

I tried that, but it didn't help

Code:
Input_1 = event.getvalue('0/2/3')
Input_2 = event.getvalue('0/2/9')
Output = '0/2/0'

if input_1 == true
  and input_2 == true then
grp.write(output, 35)
  end



RE: A litle script, but I got no output - Erwin van der Zwart - 17.01.2024

And check for case sensitive Input_ =…  -> if input_1 instead of if Input_1 … and Output =.. -> grp.write(output, .. instead of grp.write(Outpu..

I recommend to only use lower case to avoid those kind of mistakes..


RE: A litle script, but I got no output - Quattro - 17.01.2024

Didn't help

Code:
input_1 = event.getvalue('0/2/3')
input_2 = event.getvalue('0/2/9')
output = '0/2/0'

if input_1 == true
  and input_2 == true then
grp.write(output, 35)
  end



RE: A litle script, but I got no output - Erwin van der Zwart - 18.01.2024

Sorry missed that one, event.getvalue needs to be grp.getvalue

Also try to log your vars like log(input_1, input_2) so you know their values that you need to use in your conditions…


RE: A litle script, but I got no output - CristianAgata - 18.01.2024

Hi Quattro,
You have created an event on the scene object. So the script start every time this object change. I suggest you to create a script on tag and assign to input 1and 2 this tag.
So every time that those objects change the script starts.
Pay attention at the variables name must be the same.
Best regards Cristian


RE: A litle script, but I got no output - Quattro - 18.01.2024

Hi, tanks alot. I got it to work.
I now used grp.getvalue, change that the script react at a tag, and put the same tag on both adress object