Is there a way? - General Help and Assistance on using CHDK stable releases - CHDK Forum

Is there a way?

  • 2 Replies
  • 1970 Views
Is there a way?
« on: 14 / September / 2023, 05:53:30 »
Advertisements
I'm hopeful someone can provide assistance with this. At the moment, I'm using set_exit_key("down") to exit my script in ALT mode. However, I also need to invoke a function to perform some cleanup tasks, which I've defined elsewhere in the script. So, my question is: is there a way in CHDK Lua to automatically call one of my functions when the script terminates? I'm aware that I could use a version of set_exit_key("no_key") and manually handle the down button to achieve this, but I'm wondering if CHDK Lua offers an option to call a user-defined function upon script termination. Thanks! G

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Is there a way?
« Reply #1 on: 14 / September / 2023, 07:14:58 »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Is there a way?
« Reply #2 on: 15 / September / 2023, 10:23:03 »
https://chdk.fandom.com/wiki/Script_commands#restore

Of course, using the a recently updated version of CHDK is probably a good idea when using the Lua restore function?

link > Lua restore broken for non-trivial functions before trunk r6253
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal