Artox67 Posted March 28, 2018 Report Posted March 28, 2018 Hi all, I've an issue with the following script: alj=0 function alandj(offset,value) aljflag =0 gs = ipc.readStruct(0x02B4, "UD") -- read value gs = (gs * 3600) / (65536 * 1852) -- to knots if (gs < 110 ) and (djz == 1) and (alj == 0) and (aljflag == 0) then --check if Ground Speed less than 110 KTN sound.play("c:\\mysound\\paxsign.wav") ipc.sleep(1000) sound.play("c:\\mysound\\crew7_beforeland.wav") alj=1 aljflag=1 end end If I set (gs < 230) and ..... <-- it works on airborn. If I set the gs as in the script nothing happens after landing. Any ideas??
Pete Dowson Posted March 28, 2018 Report Posted March 28, 2018 2 hours ago, Artox67 said: If I set (gs < 230) and ..... <-- it works on airborn. If I set the gs as in the script nothing happens after landing. That isn't the complete script I assume? What is the event? Or are there more than one? The way I debug these things is to use the ipc.log function to log what is happening. you could alternatively use the Debug/Trace log option, but if this function is called frequently that could be very long and mostly no use. I see you test "and (aljflag == 0) " which is a waste as aljflag is always zero there, it is zeroed when the function is called. You might as well delete it and all references to it. You also refer to a "djz" value which is not set or changed in this fragment. You've cut out far too much for it to make sense. Try using ipc.log to show the value reecived frow offset 02B4 and the computed gs. Pete
Artox67 Posted March 28, 2018 Author Report Posted March 28, 2018 Hi Pete, thx for the response. What I mean is the script himself works ok as long I'm airborn. Set gs < 230 for a test and the trigger runs. But at the ground if gs is set to gs < 110 the trigger wont fire. Is it possible that the value is not read while on ground? Cheers Artox
Pete Dowson Posted March 28, 2018 Report Posted March 28, 2018 2 hours ago, Artox67 said: Is it possible that the value is not read while on ground? No. GS is always available. It comes in very useful for monitoring taxi speeds. Why not try debugging in the way I suggested? Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now