February 24, 20242 yr Hi, I'm trying to set up voice alerts for various things, such as when I cross 10000ft so I don't forget to turn off seat belt/landing lights etc. In essence I want to output voice when certain variables change, such as: (A:BATTERY·CONNECTION·ON,·Bool)·1·==·if{·(VOICE:Microsoft·David·Desktop)·(SPEAK:·battery·on)·} Does this kind of script need to be repeating? And any other things I need to do to get it working? Thanks, Cam.
February 25, 20242 yr Author Scrap that query, I have it working but I want it to be able to recognise that it's given the alert and won't continue doing it. I currently have: (L:BatteryAlertIssued)·==·0·if{(A:ELECTRICAL·MASTER·BATTERY,·Bool)·1·==·if{·(VOICE:Microsoft·James)·(SPEAK:Battery·on)·1·(>L:BatteryAlertIssued)·}·}
February 25, 20242 yr Commercial Member Consider using a CONVERSATION type script file for this. That is what the other people do, some have built their own variant of Fs2Crew/MCE with that technique. Alternatively, you could use the (LISTEN_FOR_RPN script header (please check the AAO manual about those) in a normal script that you then call only once: (LISTEN_FOR_RPN:(A:ELECTRICAL·MASTER·BATTERY,·Bool)·1·==)·(VOICE:Microsoft·James)·(SPEAK:Battery·on) (ONESHOT) The (ONESHOT) makes sure that it is only executed once and then terminated. On another note, be careful with the space characters in your code. They are VERY important. There is one missing after your first if{ command. Edited February 25, 20242 yr by Lorby_SI LORBY-SI
February 26, 20242 yr Author 17 hours ago, Lorby_SI said: ISTEN_FOR_RPN:(A:ELECTRICAL·MASTER·BATTERY,·Bool)·1·==)·(VOICE:Microsoft·James)·(SPEAK:Battery·on) (ONESHOT) Something about this isn't quite working. The script shows the green light in editor, and when I press test, the voice works fine. However when I monitor the variable ELECTRICAL·MASTER·BATTERY, it is constantly showing 1 even when battery off, and when I test with a different variable (eg the beacon light which I can verify is toggling between 0 and 1), the voice call out still doesn't happen. Any ideas? Cheers.
February 26, 20242 yr Author Just to verify, there's a typo in my post. The code is as follows: (LISTEN_FOR_RPN:(A:ELECTRICAL·MASTER·BATTERY,·Bool)·1·==)·(VOICE:Microsoft·James)·(SPEAK:Battery·on)·(ONESHOT)
February 26, 20242 yr Author Incidentally, I've also tested this with a SOUND command instead of VOICE. Again, the Test button actuates the sound (an mp3 file), however switching on the relevant light/battery/whatever else I tell it to monitor doesn't actuate the sound file either.
February 26, 20242 yr Commercial Member You cannot test it like that. Firstly, be mindful of the (ONESHOT). As explained above this works exactly once - that's it. Second, use Scripting->Run scripts to activate it, not the Test button. When you leave the editor, everything is reset and the listener script is disabled again. As for your battery, you are probably using the wrong variable or missong an index. Depends on the aircraft in use. Edited February 26, 20242 yr by Lorby_SI LORBY-SI
February 26, 20242 yr Commercial Member I'm probably giving your the wrong advice - to clear things up - what you are trying to do is getting a callout every time a certain condition changes - right? So when the battery is turned on, it says "Battery is On", and when it is turned off it says "Battery is Off" - every time the event happens? Or is it a different use case? Edited February 26, 20242 yr by Lorby_SI LORBY-SI
February 26, 20242 yr Author The main purpose was for once-only events like climbing past 10000ft. I was just using the battery as something to easily test on ground. I got it working in the form of a script called crossing_10000ft which waits for indicated altitude to be >10000tf before issuing a voice output. It then calls another script called descending_through_10000ft which is similar and does the opposite, and it has been handy twice today already 🙂 I did have to insert an IF statement, and to save me having to go through scripting-run scripts every time, I called the first script via a separate Stream Deck button I press when I get takeoff clearance. The button is just a basic toggle button but it now functions to activate the altitude script without me having to manually do it. that’s what you were saying above, right? That I’d need to run the script manually somehow rather than it being something that would just be running each time I started a flight?
March 19, 20242 yr Hello, I'm quite new in using scripts with Axis and Ohs. I'm not able to create conditional script as I don't know how the get / program correctly the variables (get them and use the correct math symbols etc), even after reading the manual. I would like to do the same as you C414C: create a permanent script ton "monitor" the airplane altitude; passing FL100 my script should trigger automaticaly Notify Crew and Landing lights off, for example. Can someone give my 1-2 scripts as example - and correctly write the commands ? Maybe C414C would kindly give me his actual script ? Thanks for any help / advice. Cedric
March 21, 20242 yr Author Hey Cedric, I’ll post these once I’m back at my computer. Next day or two. Cam.
March 21, 20242 yr Author Hi Cedric, Here's what I have in a custom script called Crossing_10000ft in my z_Voice Alerts script group: (LISTEN_FOR_RPN:(A:INDICATED·ALTITUDE,·Feet)·10000·>)·if{·(VOICE:Microsoft·James)·(SPEAK:Captain.·We·have·reached·ten·thousand·feet.)·(ONESHOT) This issue is you have to have call this script at some point for it to be active. Oliver can perhaps suggest a more elegant solution, but I have a toggle button I press just before takeoff simply to indicate that I've been given takeoff clearance, and on KeyDown, it will turn the toggle button on but also runs the script: (L:TO_Clearance) ! (>L:TO_Clearance) (CALL:z_Voice Alerts-Crossing_10000ft) (CALL:z_Voice Alerts-TransAlt) The first part creates and updates the LVAR that the button reads, you can disregard it. It then calls the 10000ft script. You'll also notice the script calls another script to do with transition altitude. In the PMDG 737, Transition altitude and level are in the FMC and can be referenced (PMDG:FMC_TransitionAlt, PMDG:FMC_TransitionLevel), which is also handy. These scripts give me a voice reminder to adjust my altimeter, because as you'd be aware this differs all over the world. I also have a toggle button I press in my cruise checklist that calls another script called descent_through_10000ft with the following: (LISTEN_FOR_RPN:(A:INDICATED·ALTITUDE,·Feet)·10000·<)·if{·(VOICE:Microsoft·James)·(SPEAK:Captain.·We·have·descended·to·ten·thousand·feet.·Reduce·speed·to·250·knots,·turn·on·seat·belt·and·landing·lights)·(ONESHOT)·} It also calls a script to alert about transition level: (LISTEN_FOR_RPN:(A:INDICATED·ALTITUDE,·Feet)·(PMDG:FMC_TransitionAlt)·<)·if{·(VOICE:Microsoft·James)·(SPEAK:Captain.·We·have·passed·transition·level.Please·set·your·altimeter·to·local·Q·N·H.)·(ONESHOT)·} and also calls 2 other scripts that alert me when I'm 10 minutes and 2 minutes from TOD: (LISTEN_FOR_RPN:(PMDG:FMC_DistanceToTOD)·(A:GROUND·VELOCITY,·Knots)·/·60·*·flr·9·<=)·if{·(VOICE:Microsoft·James)·(SPEAK:Captain.·We·have·ten·minutes·left·until·top·of·descent.)·(ONESHOT)·} (LISTEN_FOR_RPN:(PMDG:FMC_DistanceToTOD)·(A:GROUND·VELOCITY,·Knots)·/·60·*·flr·1·<=)·if{·(VOICE:Microsoft·James)·(SPEAK:Captain.·We·have·two·minutes·left·until·top·of·descent.)·(ONESHOT)·} Hope that all helps, Cam.
March 22, 20242 yr Hi Cam, Thanks a lot for your inputs. That's very kind. I made myself some progress regarding scrpting in general. I will use and test your scripts. Can we imagine launching a "After takeoff" script that will automaticaly activate the "Above FL100) script when we retract the gear ? I will do my tests. Thanks for sharing those scripts with me. Have a nice day Cedric
Archived
This topic is now archived and is closed to further replies.