Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Converting LINDA Lua script to FSUIPC script?

Featured Replies

I'm as useful at coding as an eye dropper at a forest fire.

I'm trying to perform a simple toggle: Toggle open/close the front door

Note:the default FSX door toggle key command map does not work in this plane and I do not want to use a mouse for this

 

Is anyone good at Lua coding FSUIPC that can help please?

The LINDA code below works with a button within LINDA but I want to map a keyboard press within FSUIPC.

function DC6_ExitFwd_open ()

    ipc.writeLvar("dc6_446_obj", 1)
    DspShow ("Frnt", "open")
end

function DC6_ExitFwd_close ()

    ipc.writeLvar("dc6_446_obj", 0)
    DspShow ("Frnt", "clse")
end

function DC6_ExitFwd_toggle ()
	if _tl("dc6_446_obj", 0) then
       DC6_ExitFwd_open ()
	else
       DC6_ExitFwd_close ()
	end
end

 

Edited by VeryBumpy
syntax

  • Author

For info sake to others....after much, much research and suggestions from John Dowson, this is a working answer:

function DC6_ExitFwd_open ()
    ipc.writeLvar("dc6_446_obj", 1)
    ipc.display("Front door OPEN")
    ipc.sleep(4000)
end

function DC6_ExitFwd_close ()
    ipc.writeLvar("dc6_446_obj", 0)
    ipc.display("Front door CLOSED")
    ipc.sleep(4000)
end

function DC6_ExitFwd_toggle ()
    if ipc.readLvar("dc6_446_obj") == 0 then
       DC6_ExitFwd_open ()
    else
       DC6_ExitFwd_close ()
    end
end
 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.