Start in recording mode - SD4000/IXUS 300 HS - Script Writing - CHDK Forum

Start in recording mode - SD4000/IXUS 300 HS

  • 4 Replies
  • 3674 Views
Start in recording mode - SD4000/IXUS 300 HS
« on: 11 / June / 2017, 09:17:43 »
Advertisements
Hello,
I'm new to CHDK and I'm trying to run a very simple script. I know that I can get straight into Rec mode by long pressing On/Off button, but I often forget this and it's a bit annoying.

On the forums, I found the following the code:

@title SD4000 Bootup
if autostarted = 0 then goto "Exit"
if get_drive_mode = 0 then
  click "shoot_half"
  sleep 1000
  release "shoot_half"
endif
:Exit
  cls
  exit_alt
end

I've created start.bas containing this code, loaded the script and enabled autorun on startup. When I turn on the camera, the script runs. However, the camera does not switch to recording mode!

Am I doing something wrong? Do I have to enable some other features in Alt?

I don't want to get into writing nor using complex scripts, I just need this simple one for basic functionality.

Re: Start in recording mode - SD4000/IXUS 300 HS
« Reply #1 on: 11 / June / 2017, 11:06:56 »
Am I doing something wrong? Do I have to enable some other features in Alt? I don't want to get into writing nor using complex scripts, I just need this simple one for basic functionality.
Your script has several problems that are corrected below. 

First of all , I suspect that the script may run too early in the camera startup process so I added an initial sleep statement. And it needs to "press" rather than "click" the shoot_half button.   Finally, the syntax for exit_alt needs a parameter.
 
Code: [Select]
@title SD4000 Bootup
sleep 2000                                                                                                                                                                                             
if autostarted = 0 then goto "Exit"
if get_drive_mode = 0 then
  press "shoot_half"
  sleep 1000
  release "shoot_half"
endif
:Exit
  cls
  exit_alt 0
end

Tested on my ancient A560.  If it works for you, try using smaller values that 2000 (sleep 2000) to speed up your startup process.

I also have a Lua script (attached) that achieves what you want in a slightly different way
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Start in recording mode - SD4000/IXUS 300 HS
« Reply #2 on: 11 / June / 2017, 11:58:19 »
Thank you very much for your quick reply!

Your solution worked, I only changed sleep 2000 to sleep 1000 and the camera quickly goes to rec.

Now my SD4000 is ready for action.

Re: Start in recording mode - SD4000/IXUS 300 HS
« Reply #3 on: 11 / June / 2017, 15:07:12 »
One more question...
When the script autoruns, it also autoruns from playback button - this means that it is not possible to review images without extending the lens.
Is there a trick, button combination, which can abort the script, so that I can stay in playback mode?

Of course, I can always turn off script autorun when speed is not important, and then I always start in playback.

On the other hand, with script autorun, I always start in recording mode.

Re: Start in recording mode - SD4000/IXUS 300 HS
« Reply #4 on: 11 / June / 2017, 17:54:03 »
When the script autoruns, it also autoruns from playback button - this means that it is not possible to review images without extending the lens. Is there a trick, button combination, which can abort the script, so that I can stay in playback mode?
As I also posted here :

You can abort the execution of a script - including an autorun script - by fully pressing the shutter button.  So just press the shutter button when you see the script start. You might want to reset the sleep 1000 back to sleep 2000 to give yourself time to do that on startup.
« Last Edit: 11 / June / 2017, 18:09:10 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal