AFK feature request

Post any technical issues here. This forum gets priority from our staff.
new reply
User avatar
zazaboeing
Senior Airman
Posts: 213
Joined: 24 May 2014, 17:55
Location: Sao Paulo - Brazil
Contact:

AFK feature request

Post by zazaboeing »

Hi guys!

I love the Away From Keyboard options so we can still live our lives while making long flights. Family thanks you for that! :D

But, we can ALMOST be away from the PC in long flights, due to the fact we need to change fuel selectors from time to time and manage tip tanks transfers in the case of the Bonanza.

Can we have an "automatic" fuel management (balance) while AFK?

Thanks!

Rafael

User avatar
Piper_EEWL
Chief Master Sergeant
Posts: 4544
Joined: 26 Nov 2014, 14:14
Location: Germany

Re: AFK feature request

Post by Piper_EEWL »

I would like that too!
B377&COTS, J3 Cub, B-17G, Spitfire, P-40, P-51D, C172, C182, Pa28, Pa24, T-6 Texan, L-049&COTS, Bonanza V35B

User avatar
zazaboeing
Senior Airman
Posts: 213
Joined: 24 May 2014, 17:55
Location: Sao Paulo - Brazil
Contact:

Re: AFK feature request

Post by zazaboeing »

Polite bump :mrgreen:

User avatar
Nick - A2A
A2A Captain
Posts: 13734
Joined: 06 Jun 2014, 13:06
Location: UK

Re: AFK feature request

Post by Nick - A2A »

Hi Rafael,

Apologies for the rather slow response. Interesting suggestion and one we'll keep in mind for future, though I can't promise anything.

If I recall correctly you're an FSUIPC user. If so, it should be possible to create a fairly simple Lua script to periodically switch the fuel tank selector. Is this something you'd be interested in?

Cheers,
Nick

User avatar
zazaboeing
Senior Airman
Posts: 213
Joined: 24 May 2014, 17:55
Location: Sao Paulo - Brazil
Contact:

Re: AFK feature request

Post by zazaboeing »

Nick - A2A wrote:Hi Rafael,

Apologies for the rather slow response. Interesting suggestion and one we'll keep in mind for future, though I can't promise anything.

If I recall correctly you're an FSUIPC user. If so, it should be possible to create a fairly simple Lua script to periodically switch the fuel tank selector. Is this something you'd be interested in?

Cheers,
Nick
Hi again Nick! You’re right, I’m a licensed FSUIPC user. Is it really possible to create that Lua script? I’m totally interested in it, if you could provide some clues on how to do it, then we could be REALLY AWAY FROM KEYBOARD!

Thanks

User avatar
Nick - A2A
A2A Captain
Posts: 13734
Joined: 06 Jun 2014, 13:06
Location: UK

Re: AFK feature request

Post by Nick - A2A »

Yes, I think it should be possible Rafael. Give me a few days, and when I'm back home I'll take a look and get back to you. :)

Cheers,
Nick

kielsf4
Airman First Class
Posts: 63
Joined: 21 Jan 2012, 17:24

Re: AFK feature request

Post by kielsf4 »

Hi guys, did you make it work? I'd be very interested in the lua script as well! :D

User avatar
Nick - A2A
A2A Captain
Posts: 13734
Joined: 06 Jun 2014, 13:06
Location: UK

Re: AFK feature request

Post by Nick - A2A »

Sorry guys - I'm afraid I completely forgot about this until kielsf4's post. :oops:

For registered FSUIPC users, a simple Lua script as follows should start by switching the fuel selector to the left tank, and then continue swapping between the two tanks every 15 minutes.

Code: Select all

while 1 do  -- Loop until stopped with LuaKill
   ipc.writeLvar('FSelBonanzaState', 1)
   ipc.sleep(900000)
   ipc.writeLvar('FSelBonanzaState', 2)   
   ipc.sleep(900000)
end
Basically, you'll need to create a text file containing the above text, rename it with the ".Lua" extension, e.g. "V35B_tank_switcher.lua" and drop it into your "Modules" directory. Then start the host sim, and in FSUIPC assign a button or keystroke for "Lua V35B_tank_switcher" (to turn it on) and another for "LuaKill V35B_tank_switcher" (to stop it). The "sleep" value is in millisconds, so if you wish to swap tanks every 30 minutes, change this value to 1800000.

It should be possible to add additional functionality, such as switching on the tip tank pumps if the fuel level in the corresponding wing tank drops below a certain level. However, the basic script above should allow somewhat longer unattended flight with the AFK feature active.

Thanks,
Nick

kielsf4
Airman First Class
Posts: 63
Joined: 21 Jan 2012, 17:24

Re: AFK feature request

Post by kielsf4 »

Nick - A2A wrote:Sorry guys - I'm afraid I completely forgot about this until kielsf4's post. :oops:

For registered FSUIPC users, a simple Lua script as follows should start by switching the fuel selector to the left tank, and then continue swapping between the two tanks every 15 minutes.
Basically, you'll need to create a text file containing the above text, rename it with the ".Lua" extension, e.g. "V35B_tank_switcher.lua" and drop it into your "Modules" directory. Then start the host sim, and in FSUIPC assign a button or keystroke for "Lua V35B_tank_switcher" (to turn it on) and another for "LuaKill V35B_tank_switcher" (to stop it). The "sleep" value is in millisconds, so if you wish to swap tanks every 30 minutes, change this value to 1800000.

It should be possible to add additional functionality, such as switching on the tip tank pumps if the fuel level in the corresponding wing tank drops below a certain level. However, the basic script above should allow somewhat longer unattended flight with the AFK feature active.

Thanks,
Nick
Hi Nick, thank you very much! I tried to add automatic tip tank pump activation at 50% of the wing tanks but failed miserably since I don't really know what I'm doing :oops:
Would you mind taking a look at this?

Code: Select all

ipc.display("V35B Tank Switcher active", 4) -- Display text for 4 seconds
while 1 do  -- Loop until stopped with LuaKill
   ipc.writeLvar('FSelBonanzaState', 1)
   ipc.sleep(900000)
   ipc.writeLvar('FSelBonanzaState', 2)   
   ipc.sleep(900000)
   
LeftWingTank = ipc.readLvar("FuelLeftWingTankPct")
   if LeftWingTank < 50 then
      ipc.writeLvar('TipTankLeftPumpSwitch', 1)
RightWingTank = ipc.readLvar("FuelRightWingTankPct")
   if RightWingTank < 50 then
      ipc.writeLvar('TipTankRightPumpSwitch', 1)
end
Thanks,
Jan

User avatar
Nick - A2A
A2A Captain
Posts: 13734
Joined: 06 Jun 2014, 13:06
Location: UK

Re: AFK feature request

Post by Nick - A2A »

Hi Jan,

Give it a try with this small change (an 'end' for each 'if' statement)...

Code: Select all

ipc.display("V35B Tank Switcher active", 4) -- Display text for 4 seconds
while 1 do  -- Loop until stopped with LuaKill
   ipc.writeLvar('FSelBonanzaState', 1)
   ipc.sleep(900000)
   ipc.writeLvar('FSelBonanzaState', 2)   
   ipc.sleep(900000) 
LeftWingTank = ipc.readLvar("FuelLeftWingTankPct")
   if LeftWingTank < 50 then
      ipc.writeLvar('TipTankLeftPumpSwitch', 1)
   end
RightWingTank = ipc.readLvar("FuelRightWingTankPct")
   if RightWingTank < 50 then
      ipc.writeLvar('TipTankRightPumpSwitch', 1)
   end
end
Thanks,
Nick

new reply

Return to “Bonanza Tech Support”

Who is online

Users browsing this forum: No registered users and 10 guests