Skip to content

Commit

Permalink
Add toggle macro
Browse files Browse the repository at this point in the history
  • Loading branch information
AviationSFO committed Apr 30, 2022
1 parent 3096f40 commit d569db2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Resources/plugins/FlyWithLua/Scripts/ExportXP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

local data = {}

-- Adding toggle macro
active = false
add_macro("Toggle ExportXP", "active = true", "active = false", "deactivate")

-- this function retrieves the current aircraft's data and stores it in a table
-- from X-Plane's API for later export
function getData(data)
Expand Down Expand Up @@ -51,9 +55,11 @@ function exportData(data)
end

function main()
data = {}
data = getData(data)
exportData(data)
if(active) then
data = {}
data = getData(data)
exportData(data)
end
end

do_every_draw("main()")

0 comments on commit d569db2

Please sign in to comment.