--[[@title CHDK Config Backup @param b Action @default b 1 @values b Restore Backup--]]require("drawings")local core=require("gen/cnf_core")local osd=require("gen/cnf_osd")local user=require("gen/cnf_user")local gps=require("gen/cnf_gps")------------------------------------------------------------------set_draw_title_line(0) -- title offsleep(100)if get_mode() == true then set_record(false) sleep(1000) while get_mode() do sleep(10) endendif (b==1) then --- BACKUP save_config_file(core._config_id, "A/CHDK/_CORE_BKP.CFG") save_config_file(osd._config_id, "A/CHDK/_OSD_BKP.CFG") save_config_file(user._config_id, "A/CHDK/_USER_BKP.CFG") save_config_file(gps._config_id, "A/CHDK/_GPS_BKP.CFG") for i=0,30,1 do draw_string( 40, 150, (" BACKUP DONE "), 258, 263, 2, 2) sleep(100)endelse --- RESTORE load_config_file(core._config_id, "A/CHDK/_CORE_BKP.CFG") save_config_file(core._config_id) load_config_file(osd._config_id, "A/CHDK/_OSD_BKP.CFG") save_config_file(osd._config_id) load_config_file(user._config_id, "A/CHDK/_USER_BKP.CFG") save_config_file(user._config_id) load_config_file(gps._config_id, "A/CHDK/_GPS_BKP.CFG") save_config_file(gps._config_id) for i=0,30,1 do draw_string( 40, 150, (" RESTORE DONE "), 258, 263, 2, 2) sleep(100)end draw.clear() play_sound(7) for i=0,20,1 do draw_string( 40, 150, (" REBOOTING... "), 258, 259, 2, 2) sleep(100)endendif (b==0) then reboot() enddraw.clear()set_record(true)exit_alt() -- done
OK, i got a bad mark ... and accused of robbery and to be out of date.
The above script was based on info got on the wiki and from the philmoz post. Maybe i should have had to report this last bibliographic note, but my script looks to me (in my naiveness) a good development of his hint, not a stealing of his code.
Please consider that i'm far away to be an expert in scripting, neither i want to compete against gurus. So i apologize to all of you and promise to stop posting from now.
Started by kdeal Feature Requests
Started by ntstatic « 1 2 » Script Writing
Started by msl LUA Scripting
Started by Microfunguy Script Writing
Started by pigeonhill General Help and Assistance on using CHDK stable releases