Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save_mis(text)
- local fdir = lfs.writedir() .. [[Logs\Save_tool\]] .. text
- local f,err = io.open(fdir,"w")
- if not f then
- local errmsg = 'Error: Need to create new folder in the Logs folder with the name' .. 'Save_tool . sample: C:\Users\youname\Saved Games\DCS\Logs\Save_tool'
- trigger.action.outText(errmsg, 10)
- return print(err)
- end
- f:write('ALIVEDB = \n')
- f:write(mist.utils.oneLineSerialize(mist.DBs.aliveUnits))
- f:close()
- timer.scheduleFunction(save_mis, name_miz .. timer.getTime() .. '.lua', timer.getTime() + 60)
- trigger.action.outText('File saved to: ' .. lfs.writedir() .. [[Logs\Save_tool\]] .. text, 15)
- end
- if env.mission then
- if env.mission.sortie then
- name_miz = env.mission.sortie
- else
- name_miz = 'save_mission_default.txt'
- end
- else
- name_miz = 'save_mission_default.txt'
- end
- timer.scheduleFunction(save_mis, name_miz .. timer.getTime() .. '.lua', timer.getTime() + 60)
- trigger.action.outText('End Load Save Tool' , 15)
- if lfs and io then
- else
- local errmsg = 'Error: insufficient permission you must disable the sanitization of the io and lfs libraries in ./Scripts/MissionScripting.lua'
- trigger.action.outText(errmsg, 10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement