Help Needed, logical operation.

About advanced scenes, and the Thyme scripting language used in Algodoo.

Help Needed, logical operation.

Postby RpT » Fri Apr 06, 2012 10:36 pm

Hi everyone I want to make myself an automatic gearbox and of course I need "if statement". The problem is that I need two or more conditions to be satisfied at the same time. I tried something like :
Code: Select all
scene.my.resv > 55 && scene.my.gear7 = 2 ? {change to next gear..} : {change to previous one..}
however it doesn't seem to work. Your help would be very appreciated ! Thanks

PS: I have looked over the forum to find a statement with 2 conditions for 1 hour and I couldn't find nothing... Sorry if this had been asked before!
RpT
 
Posts: 11
Joined: Sun Oct 02, 2011 4:45 pm

Re: Help Needed, logical operation.

Postby electronicboy » Sat Apr 07, 2012 1:02 am

Code: Select all
scene.my.resv > 55 ? {scene.my.gear7 = 2 ? {change to next gear..} : {change to previous one..} } : {}



Place one if script into another!!

Code: Select all
<condition1> ? { <condition2> ? {code to next gear}: {Code to previous gear} } : {not used}
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Help Needed, logical operation.

Postby RpT » Sat Apr 07, 2012 9:59 am

thank you very much..
Țăranul se uită la pământ și pământul la țăran..dacă are pământ, dacă nu, atunci nu!

:lol:
RpT
 
Posts: 11
Joined: Sun Oct 02, 2011 4:45 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests