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.

How to display something in a Lua window

Featured Replies

Hello,

This seems to be a quite odd question but I can' get anything to display in a Lua window.

My lua file contains only one line

ipc.display("This is my text")

but it doesn't display anything.

I tried this

ipc.display("")
ipc.display("This is my text")
ipc.sleep(5000)

It works, The window stays 5 seconds.

But this doesn't work

ipc.display("")
ipc.display("This is my text", 5)

Who can help me to figure this out?

Stefan

Hello,

 

this is more a general question for the FSUIPC Forum, not especially LINDA I think?

 

However, how do you execute this script?

Is it part of a LINDA module and therefore inside a function?

 

As you can let show the display for 5 seconds using the ipc.sleep, I assume you have somewhere in your code in an other part also an ipc.display("") which closes your window immediately.

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

  • Author

I was just working in a Linda Editor window to learn how to manage scripts.

The line is in a lua file triggered by an entry in the user.lua file of the plane I was working on.

6 minutes ago, guenseli said:

As you can let show the display for 5 seconds using the ipc.sleep, I assume you have somewhere in your code in an other part also an ipc.display("") which closes your window immediately

My understanding of the syntax is:

ipc.display("string", delay) where I can set the delay for the time the message would be displayed. This doesn't work. It doesn't work either without the preceding ipc.display("") line

 

Difficult ...

But if you use it in LINDA then you have to use it inside a function, e.g.

 

function test ()

ipc.display("test")

end

 

and then execute this function.

 

As you say, ipc.display is just working, when you add ipc.sleep(5000), then my assumption is, that in the whoöe wide LINDA code something is terminating you display immediately. With ipc.sleep, you pause the whole code for 5 seconds.

I think, inside a function it should work then ...

Edited by guenseli

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

  • Author

Yes. The function is MyTrials in the user.lua file of my plane. It says: runlua('MyTrials'). MyTrials.lua is a file in my modules folder.

Ok, I got it! My way is a too complicated way. It is far more convenient to write directly in the user.lua file.

I created a function 'MyTrials', assigned it to a button, and now the line

ipc.display("I got it!", 5)

is displayed as wanted.

Thanks for the hint,

Stefan

7 hours ago, stefwei said:

MyTrials.lua is a file in my modules folder. 

Ok, I got it! My way is a too complicated way. It is far more convenient to write directly in the user.lua file.

 

 

Ah, ok, now I understand. 

ok, that was much too complicated … glad you sorted it now.

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

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.