Jump to content
The simFlight Network Forums

tincan

Members
  • Posts

    28
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Germany

Recent Profile Visitors

962 profile views

tincan's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Tunnel vision. I thought you meant my own function`s name. Well, I'd argue that but to no point. Thanks for spotting this guys! Clear skies.
  2. Yes, you can see in the log that the code is executed.
  3. FSUIPC version 4972 Hi, I am trying to write to a local variable in CaptainSim's C130 in fsx using a Lua file. There's a switch in the VC that I want to automate. The FSUIPC log shows an error for this action: ipc.writeLVar("L:pRpm1ButtonPos",dummy) To make sure the variable exists I added a ReadLvar to the code. C130.lua 109 function rpmLow() 110 state=ipc.readLvar("L:pRpm1ButtonPos") 111 ipc.display("RPM: "..state,1) 112 dummy=1 113 ipc.writeLVar("L:pRpm1ButtonPos",dummy) 114 end 141 event.button("D", 5, 1, "rpmLow") The read works, the result 1 or 0 is showing in the display window according to the position of the switch in the virtual cockpit. Log: I don't understand what the "nil value' means here. How can I fix this? Thanks.
  4. I was going to define ranges for that axis anyway. Now that I do, the returned value is correct! Thanks very much.
  5. Hello, I am trying to read a joystick's axis in a lua script. My controllers have letters assigned and the axis is recognised in the FSUIPC tab as Joy "A" axis "X" (screenshot). When I run my script this line alway returns 16191 no matter what: m = ipc.axis("A", "X") I even tried using 0 as joystick number and reading other axises (?) but the result is the same. I have seen this in use e.g. the smooth brake lua script but what am I doing wrong here? Thanks! Code: function readX() m = ipc.axis("A", "X") strDisplay = m.." " m = ipc.axis("A", "Y") strDisplay = strDisplay..m.." " m = ipc.axis("A", "Z") strDisplay = strDisplay..m.." " m = ipc.axis("A", "R") strDisplay = strDisplay..m.." " m = ipc.axis("A", "U") strDisplay = strDisplay..m.." " m = ipc.axis("A", "V") strDisplay = strDisplay..m.." " ipc.display(strDisplay) end event.timer(1000, "readX") Log: 1637027 LUA.0: Waiting for an event in "C:\FSX\Modules\pwr.lua" 1638026 LUA.0: Timer event: calling "readX" in "C:\FSX\Modules\pwr.lua" 1638026 LUA.0: C:\FSX\Modules\pwr.lua:8 1638026 LUA.0: C:\FSX\Modules\pwr.lua:9 1638026 LUA.0: C:\FSX\Modules\pwr.lua:11 1638026 LUA.0: Global: strDisplay = 16191 1638026 LUA.0: C:\FSX\Modules\pwr.lua:12 1638026 LUA.0: C:\FSX\Modules\pwr.lua:14 1638026 LUA.0: Global: strDisplay = 16191 16191 1638026 LUA.0: C:\FSX\Modules\pwr.lua:15 1638041 LUA.0: C:\FSX\Modules\pwr.lua:17 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:18 1638041 LUA.0: C:\FSX\Modules\pwr.lua:20 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:21 1638041 LUA.0: C:\FSX\Modules\pwr.lua:23 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 16191 1638041 LUA.0: C:\FSX\Modules\pwr.lua:24 1638041 LUA.0: C:\FSX\Modules\pwr.lua:26 1638041 LUA.0: Global: strDisplay = 16191 16191 16191 16191 16191 16191 1638057 LUA.0: C:\FSX\Modules\pwr.lua:27 1638057 LUA.0: Waiting for an event in "C:\FSX\Modules\pwr.lua" 1639040 LUA.0: ended "C:\FSX\Modules\pwr.lua" FSUIPC4.ini
  6. Hi, I keep restarting FSX and re-recording but I cannot fix this. The Z key should execute line 62 of my ATR_F1.mcro but as per the logging it executes line 2. Thanks for your help! Modules.zip Modules.zip
  7. Again a quick fix to a problem. Thanks, Pete! Mouseflag 17: MOUSE_LEFTRELEASE [Macros] Module="F1ATR.DLL" ... 48=TO_CONFIG_START=RX17a30*X8bcc 49=TO_CONFIG_END=RX17a30*X8bcc,17
  8. Hi, In my ATR there's a "takeoff config test" button. While you press it with the mouse it will sound an alarm if the aircraft is not ready for takeoff. So the test starts on mouse button down and stops on mouse button up. I recorded a mouse macro for this and it does work to activate the config test but it won't stop although the assigned joystick button is released. Only after I press and release the button on the panel with the mouse it will stop. Is there a way to achieve this? Thanks!
  9. OK thanks. I'll do some logging. Because I want three buttons with different labels not two. ;)
  10. So I changed it but it didn't help: 57=CP(+G,5)G,6,C66623,0 ;GPS enter - Compund: button 5 + 6 together 58=CP(-G,5)G,6,C66624,0 ;GPS cursor 59=CP(+G,7)(-G,4)G,5,C66612,0 ;GPS procedure 60=CP(-G,7)(-G,4)G,5,C66611,0 ;GPS terrain To clarify my wiring: The GPS ENTER button from line 57 would be S3. I push it first and then push S1 so input 5 and 6 do get high simultaneously. Can it be fixed in the software or do I need to change the wiring?
  11. Hello, I have built a gps button interface. To save inputs I use the compound functionality. The switches are pushbutton normal open. The way I wired the GPS ENTER button it would "press" button 5 and 6 simultaneously. Unfortunately the function for button 6 GPS CURSOR will also fire in that case. How can I avoid it? 57=CP(+G,5)G,6,C66623,0 ;GPS enter - Compund: button 5 + 6 together 58=PG,6,C66624,0 ;GPS cursor 59=CP(+G,7)G,5,C66612,0 ;GPS procedure 60=PG,5,C66611,0 ;GPS terrain
  12. Hello, I have read about rotary encoders in this forum. I am hitting the language barrier here, so please help me understand. I know there are USB-boards that allow the connection of encoders. They determine rotation direction. Is it absolutely necessary? Can we wire them directly (common ground and one "button" input for each left and right) to a USB interface without encoder support? So that FSUIPC determines the rotation direction?
  13. Thanks for the in-depth analysis. I'll try it. EDIT: Confirmed! Thanks.
×
×
  • 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.