apercrcl01 Posted June 1, 2021 Report Posted June 1, 2021 I use Self-Loading Cargo and I am trying to figure out if I can get FSUIPC to open a video (Aer Lingus Safety Announcement) using VLC media player when I start to push back from the gate. Any help would be appreciated. I have seen how to run a program when FSUIPC starts up, but not how to start a program when a condition is true. Also, I'm not sure what Self Loading Cargo uses to determine the beginning of the taxi phase.
John Dowson Posted June 1, 2021 Report Posted June 1, 2021 22 minutes ago, apercrcl01 said: I use Self-Loading Cargo and I am trying to figure out if I can get FSUIPC to open a video (Aer Lingus Safety Announcement) using VLC media player when I start to push back from the gate. Any help would be appreciated. I have seen how to run a program when FSUIPC starts up, but not how to start a program when a condition is true. As you found, you cannot do this using the FSUIPC [Programs] ini section. The only thing I can think of is to try lua. You could monitor for the push-back event (maybe TOGGLE_PUSHBACK, number 66483 - or log events to see what control and control number is used) and then use event.control to wait for the event. In your handling function. you can try using the (inbuilt) lua os.execute function to run VLC. I'm not !00% sure if this will work as I haven't tried/tested to see if the os.execute function is available and working. Please report back if you get this to work!
apercrcl01 Posted June 1, 2021 Author Report Posted June 1, 2021 Success! Thank you for your help! function vlc() checkiftrue=1 os.execute [[""C:\\Program Files\\VideoLan\\VLC\\vlc.exe" "https://www.youtube.com/watch?v=_g2qU2pSzTY" "--fullscreen" "--no-qt-fs-controller" "--qt-start-minimized" "--qt-fullscreen-screennumber=2" "vlc://quit""]] end function checkPushback() if checkiftrue==0 then event.control(66483,"vlc") end end checkiftrue=0 checkPushback()
apercrcl01 Posted June 1, 2021 Author Report Posted June 1, 2021 Except now it is running over and over again. I'm know this is probably a dumb question and I'm sorry for asking, but how do I get that function to stop running. I've got it looking at a global variable, but it runs over and over anyways. function vlc() checkiftrue=1 math.randomseed(os.time()) math.random(); math.random(); math.random() randomNumber = math.random(1,3) print(randomNumber) if randomNumber==1 then os.execute [[""C:\\Program Files\\VideoLan\\VLC\\vlc.exe" "https://www.youtube.com/watch?v=_g2qU2pSzTY" "https://www.youtube.com/watch?v=OAUUrM87jg8" "--fullscreen" "--no-qt-fs-controller" "--qt-start-minimized" "--qt-fullscreen-screennumber=2" "--no-video-title-show" "vlc://quit""]] elseif randomNumber==2 then os.execute [[""C:\\Program Files\\VideoLan\\VLC\\vlc.exe" "https://www.youtube.com/watch?v=_g2qU2pSzTY" "https://www.youtube.com/watch?v=xFnTXoKeWIE" "--fullscreen" "--no-qt-fs-controller" "--qt-start-minimized" "--qt-fullscreen-screennumber=2" "--no-video-title-show" "vlc://quit""]] elseif randomNumber==3 then os.execute [[""C:\\Program Files\\VideoLan\\VLC\\vlc.exe" "https://www.youtube.com/watch?v=_g2qU2pSzTY" "https://www.youtube.com/watch?v=sTm1I5lBDrA" "--fullscreen" "--no-qt-fs-controller" "--qt-start-minimized" "--qt-fullscreen-screennumber=2" "--no-video-title-show" "vlc://quit""]] end return end function checkPushback() if checkiftrue==0 then event.control(66483,"vlc") return end end checkiftrue=0 checkPushback()
Blake Buhlig Posted June 2, 2021 Report Posted June 2, 2021 8 hours ago, apercrcl01 said: Except now it is running over and over again. I'm know this is probably a dumb question and I'm sorry for asking, but how do I get that function to stop running. event.cancel("vlc") executed inside the vlc() function should do it.
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