Hi all , Can someone help me out here please. I want to make a nasal script that watches controls/gear/gear-down using a listener.
When called this is what i would like to happen. If /systems/electrical/volts > 22 then let the gear go up or down. If /systems/electrical/volts < 22 then make the gear stay where they are. I did have a bash at this myself but cant seem to get it to work right. # Set listners for certain conditions. gear = func { power = getprop("/systems/electrical/volts"); status = getprop("controls/gear/gear-down"); if (power > 22 and status == 1) { setprop("controls/gear/gear-down", 1);} elsif (power > 22 and status == 0) { setprop("controls/gear/gear-down", 0);} elsif (power < 22 and status == 0) { setprop("controls/gear/gear-down", 1);} elsif (power < 22 and status == 1) { setprop("controls/gear/gear-down", 0);} } # end function setlistener("controls/gear/gear-down", gear); See what i mean ? All messed up ;) Thanks in advance, Justin Smithies ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel