Advertisement
Guest User

b407_toggle_ties.lua

a guest
Mar 21st, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. if PLANE_ICAO == "B407" then
  2.     dataref("InletCap", "Equip/InletCap", "writable")
  3.     dataref("OutletCap", "Equip/OutletCap", "writable")
  4.     dataref("PitotCap", "Equip/PitotCap", "writable")
  5.     dataref("Tie0", "Equip/Tie0", "writable")
  6.     dataref("Tie1", "Equip/Tie1", "writable")
  7.     dataref("Tie2", "Equip/Tie2", "writable")
  8.     dataref("Tie3", "Equip/Tie3", "writable")
  9.  
  10.     function toggle()
  11.         if not button(17) and last_button(17) then
  12.             InletCap = InletCap == 0 and 1 or 0
  13.             OutletCap = OutletCap == 0 and 1 or 0
  14.             PitotCap = PitotCap == 0 and 1 or 0
  15.             Tie0 = Tie0 == 0 and 1 or 0
  16.             Tie1 = Tie1 == 0 and 1 or 0
  17.             Tie2 = Tie2 == 0 and 1 or 0
  18.             Tie3 = Tie3 == 0 and 1 or 0
  19.         end
  20.     end
  21.  
  22.     do_every_frame("toggle()")
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement