Jump to content
The simFlight Network Forums

Macro and multi command button execution sequence


Recommended Posts

When you run a macro or more commands that are connected to a button the execution of the commands and programs lua does not occur in sequence.

This is the .ini:

[buttons.Ifly 737]

6=CP(+Y,9)Y,14,CM1:2,0

7=CP(+Y,9)Y,15,CM1:1,0

8=CP(+Y,9)Y,16,CL2:R,2

9=CP(+Y,9)Y,17,CL2:R,1

10=CP(+Y,9)Y,18,CL1:R,0

11=CP(+Y,9)Y,18,Cx02009400,x0002

12=CP(+Y,9)Y,18,CL1:R,0

13=CP(+Y,9)Y,18,Cx02009400,x0005

14=CP(+Y,9)Y,18,CL1:R,0

15=CP(+Y,9)Y,18,Cx02009400,x0008

16=CP(+Y,9)Y,19,CL1:R,0

17=CP(+Y,9)Y,19,Cx02009400,x0001

18=CP(+Y,9)Y,19,CL1:R,0

19=CP(+Y,9)Y,19,Cx02009400,x0004

20=CP(+Y,9)Y,19,CL1:R,0

21=CP(+Y,9)Y,19,Cx02009400,x0007

[MacroFiles]

1=ifly737

[LuaFiles]

1=WaitOffset

2=Ifly737LndLight

3=ipcDebug

this is the macro ifly737:

[Macros]

Module="iFly737-700.GAU"

1=LndLightOn

1.1=CL1:R

1.2=Cx02009400,x0001

1.3=CL1:R

1.4=Cx02009400,x0004

1.5=CL1:R

1.6=Cx02009400,x0007

2=LndLightOff

2.1=CL1:R

2.2=Cx02009400,x0002

2.3=CL1:R

2.4=Cx02009400,x0005

2.5=CL1:R

2.6=Cx02009400,x0008

This is lua program WaitOffset called in the macro:

while ipc.readSW (0x9400) ~= -1 do

ipc.sleep(20)

end

This is the log:

70794 Button changed: bRef=0, Joy=0 (Y), Btn=15, Pressed

70794 [buttons.iFly 737-700 (Wide screen)] 7=CP(+Y,9)Y,15,CM1:1,0

70794 .... Condition (+Y,9) = TRUE

70794 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x1

70794 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x4

70794 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x7

70794 LUA.0: beginning "E:\Programmi\Microsoft Games\Microsoft Flight Simulator X\Modules\WaitOffset.lua"

70794 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

70794 LUA.0: Global: ipcPARAM = 0

70794 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

70809 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

70809 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

70840 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

70840 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

70856 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

70856 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:3

70856 LUA.0: ended "E:\Programmi\Microsoft Games\Microsoft Flight Simulator X\Modules\WaitOffset.lua"

71043 Button changed: bRef=0, Joy=0 (Y), Btn=15, Released

81963 Button changed: bRef=0, Joy=0 (Y), Btn=19, Pressed

81963 [buttons.iFly 737-700 (Wide screen)] 16=CP(+Y,9)Y,19,CL1:R,0

81963 .... Condition (+Y,9) = TRUE

81963 [buttons.iFly 737-700 (Wide screen)] 17=CP(+Y,9)Y,19,Cx02009400,x0001

81963 .... Condition (+Y,9) = TRUE

81963 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x1

81963 [buttons.iFly 737-700 (Wide screen)] 18=CP(+Y,9)Y,19,CL1:R,0

81963 .... Condition (+Y,9) = TRUE

81963 [buttons.iFly 737-700 (Wide screen)] 19=CP(+Y,9)Y,19,Cx02009400,x0004

81963 .... Condition (+Y,9) = TRUE

81963 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x4

81963 [buttons.iFly 737-700 (Wide screen)] 20=CP(+Y,9)Y,19,CL1:R,0

81963 .... Condition (+Y,9) = TRUE

81963 [buttons.iFly 737-700 (Wide screen)] 21=CP(+Y,9)Y,19,Cx02009400,x0007

81963 .... Condition (+Y,9) = TRUE

81963 IPC Offsets Control: Ctrl=x0200, Length=2, Offset=9400, Param=x7

81963 LUA.0: beginning "E:\Programmi\Microsoft Games\Microsoft Flight Simulator X\Modules\WaitOffset.lua"

81963 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

81963 LUA.0: Global: ipcPARAM = 0

81963 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

81979 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

81994 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

82010 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

82010 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:2

82026 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:1

82026 LUA.0: ...\Microsoft Flight Simulator X\Modules\WaitOffset.lua:3

82026 LUA.0: ended "E:\Programmi\Microsoft Games\Microsoft Flight Simulator X\Modules\WaitOffset.lua"

82119 Button changed: bRef=0, Joy=0 (Y), Btn=19, Released

This is right?

Link to comment
Share on other sites

  • 3 weeks later...

This is right?

Without spending more time than I have trying to analyse what you are doing here, I cannot advise. Perhaps you could point out what you think is wrong more explicitly?

Before that, please note that Lua plug-ins run independently of everything else. Your entries merely load and start them. They are running in their own threads in their own time.

Pete

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.