focusser.lua:
----------
This script calls set_focus(...) with user-defined pauses in between. It either increases the subject distance by a constant each step or follows an exponential curve. I highly recommend the latter!
My camera ignores set_focus(...) in AF and I couldn't get it switched to MF from within the script. So the default values rely on the user manually selecting MF.
Caution when using the "Reverse" mode: If you minimum focus distance is below what the camera supports you will be caught in an infinite loop. A workaround could be to abort after a number of steps during which get_focus() didn't change its return value... But I'm done with it for now.
Since my camera stopped reacting completely when I tried to start a script during video recording I added "Wait for set button?" so you can start the script beforehand without having to time the initial delay exactly.
focusdiag.lua
----------
Auxilliary tool to find useful parameters for focusser.lua. Press "set" to see the current focus value from get_focus().
I hope this helps. Feel free to ask for additional features or explanations!