Jump to content

Recommended Posts

Posted (edited)

Does anyone know if it is possible (and if so, how) to invoke an iCommand (eg iCommandPlaneShowKneeboard) directly from a script? For example, I'd like to be able to toggle the Kneeboard on and off via script.

 

Cheers!

Edited by Preacher74
Typo
  • Like 1
  • 4 weeks later...
Posted

You can possibly use the dispatch_action() function takes takes (device_id, command_number, value) as parameters. Also, you could use:

local dev = GetSelf()
dev:performClickableAction(command_number, value, true/false) -- I think last parameter specifices if the switch bound to the command should be moved.

 

  • Like 1

:lol::pilotfly::thumbup:

  • 2 years later...
Posted

Hi, Preacher74.

Have u figure out how to do this? I also want to invoke iCommandMissionRestart command to restart my mission automatically in export.lua file via a socket message from my other program.

Posted

@NeoBlue That is a long way to restart your mission. I name my missions X.XA and X.XB. Say I want it to restart after 8 hours. Add a once trigger>time more 28800>load mission. Then I load the B version. Then go back to B version and load A version. Mission restarts no problem every 8 hours

Intel i9-13900k, Asus Z790-E Gaming Wi-fi 2 motherboard, 64gb Corsair Vengeance LPX DDR5-6400 RGB ram 2x32gb XMP2 profile, 4TB Crucial T700 PCIE 5.0 SSD internal, 2TB Crucial T700 PCIE 5.0 SSD internal, Asus ROG Strix OC GeForce RTX 4090, Corsair 7000X Case with 5 x 120mm side mounted intake fans and 3 x 140mm top mounted exhaust fans, 1 x 140mm rear mounted exhaust fans, front mounted Corsair H150i Elite Capellix 360mm liquid cooler w/Elite LCD with 6 x 120mm fans in 3 push, 3 pull intake configuration, 1 x 32" Samsung 3840x2160 display, 1x 32" Asus 2560x1440 display, TrackIR5 w/pro clip, Thrustmaster Warthog stick and throttle, CH Fighterstick Pro and Pebble Beach Velocity pedals. 

Posted
On 8/25/2023 at 1:48 AM, 104th_Money said:

@NeoBlue That is a long way to restart your mission. I name my missions X.XA and X.XB. Say I want it to restart after 8 hours. Add a once trigger>time more 28800>load mission. Then I load the B version. Then go back to B version and load A version. Mission restarts no problem every 8 hours

thx for ur helpful information. The trigger in Mission Editor is really a powerful tool. Timeout restart and pilot death restart can work via your method.

Because my need is to restart the mission externally using export.lua via socket commands. I would love to share some other skills I discovered recently.

1. in directory /DCSWorld/MissionEditor/ change file MissionEditor.lua line 4

OPTIONS_ADD_COMMAND_CODES_TO_TOOLTIP = true

2. Now restart DCS and in control configurations, the internal command code will be displayed in tooltip. Search for Restart Mission Action code=1641

nullimage.png

3. The export.lua file should be modified to support socket communication(usually the lua side work as a server). Once a predefined msg is transmitted to lua socket server, the lua script will use LoSetCommand(1641) to restart my mission.

4. Now lots of clickable thing can be done by following combos of commands

    --Step 1. Anti-skid OFF, hook lever DOWN, hook bypass switch to CARRIER, landing lights ON
    -- Anti-skid OFF:
    GetDevice(5):performClickableAction(3004,0)
    -- Arresting Hook Handle-DOWN
    GetDevice(5):performClickableAction(3013, 0)
    -- hook bypass switch to CARRIER
    GetDevice(9):performClickableAction(3009, 0)--(3025) this also work
    -- landing lights ON
    GetDevice(8):performClickableAction(3010, 1)
    --Step 2. Set ALTITUDE Switch to RDR, set Radar Altimeter Index to 320 ft(proper altitude when 3/4nm from carrier)
    GetDevice(34):performClickableAction(3021, 0)
    LoSetCommand(317)--317 decrease/316 increased
    --Step 3. Set Landing Gear Lever-DOWN, Flaps Level-FULL(DOWN)
    LoSetCommand(431)
    GetDevice(2):performClickableAction(3007, 2)

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...