Jump to content
The simFlight Network Forums

Recommended Posts

Hello,

 

i have a little Lua Script which should set a offset when i start the sim .

function LightsCLEAR()
   ipc.display("LightsCLEAR")
	ipc.setbitsUB(0x5301, 1)
	ipc.setbitsUB(0x5301, 2)
	ipc.setbitsUB(0x5301, 4)
	ipc.setbitsUB(0x5301, 8)
	ipc.setbitsUB(0x5301, 16)
	ipc.setbitsUB(0x5301, 32)
	ipc.setbitsUB(0x5301, 64)
	ipc.setbitsUB(0x5301, 128)
end
event.sim(ANY, "LightsCLEAR")

but it is only running, when i change the Time in the sim, as example from Day to Night.

Why is the script not running when i start the sim?

Or how can i run a script, when the sim starts?

 

thx

MR

Share this post


Link to post
Share on other sites

Hi MR,

Lua questions should really be posted in the main support forum. This sub-forum is for programming with .NET languages.

However, looking at the documentation, event.sim doesn't fire when the sim loads. Only on CLOSE, FLIGHTLOAD, FLIGHTSAVE and AIRCRAFTCHANGE.

You can run a LUA script when the sim has finished loading and is ready to fly by naming your LUA file 'ipcready.lua'. That might be useful to you.

I'm not an expert on LUA so if you need more help please ask in the main forum.

Kind Regards,

Paul

Share this post


Link to post
Share on other sites

Hello,

 

oh, i am sorry about posting in the wrong section, maybe a admin can move the topic.

Thanks for the answer, i will try...

 

MR

 

.... it works...thx

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.