Script Runs Backwards - Script Writing - CHDK Forum

Script Runs Backwards

  • 12 Replies
  • 3343 Views
*

Offline NSS

  • *
  • 26
Script Runs Backwards
« on: 14 / September / 2010, 13:29:17 »
Advertisements
I have an  A560

And I have a simple script to make times Videos.

press "shoot_full"
release "shoot_full"
sleep 10000
press "shoot_full"
release "shoot_full"
sleep 5000                
press "shoot_full"
release "shoot_full"
sleep 10000
press "shoot_full"
release "shoot_full"

It works fine  except it runs backwards,  it records for 5 seconds and pauses for ten,

I have switched the numbers back and forth and it doesn't change.

any suggestions?

Joe

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Script Runs Backwards
« Reply #1 on: 14 / September / 2010, 14:33:53 »
Some things to try:
replace each

press "shoot_full"
release "shoot_full"

with

shoot

or

click "shoot_full"

or

press "shoot_full"
sleep 300
release "shoot_full"

or

press "shoot_half"
sleep 300
press "shoot_full"
sleep 300
release "shoot_full"
release "shoot_half

*

Offline NSS

  • *
  • 26
Re: Script Runs Backwards
« Reply #2 on: 14 / September / 2010, 14:48:08 »
The Plain shoot does nothing,

The other two versions work,  but still play backwards.

record 5  pause 10

Crazy!

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Script Runs Backwards
« Reply #3 on: 14 / September / 2010, 14:53:41 »
There were 4 options, really. But anyway it sounds a bit like you're actually starting the script during video record. And even if you aren't you should try that because it should invert the script operation...


*

Offline NSS

  • *
  • 26
Re: Script Runs Backwards
« Reply #4 on: 14 / September / 2010, 15:00:22 »
Maybe it's as simple as I'm starting the script wrong?

Please tell me the proper method of starting the script.

I really am grateful for this help by the way.

Joe

*

Offline reyalp

  • ******
  • 13061
Re: Script Runs Backwards
« Reply #5 on: 14 / September / 2010, 16:11:44 »
Maybe it's as simple as I'm starting the script wrong?

Please tell me the proper method of starting the script.

I really am grateful for this help by the way.

Joe
Put in a wait before the first press shoot_full

If you don't do this, I believe it gets confused by the real press which initiated the script.
Don't forget what the H stands for.

*

Offline NSS

  • *
  • 26
Re: Script Runs Backwards
« Reply #6 on: 14 / September / 2010, 17:33:36 »
I tried that too,  I put as\ sleep in there

like sleep 30000

 tats 30 seconds and made no difference, (other than taking 30 seconds to get started.
Joe

*

Offline reyalp

  • ******
  • 13061
Re: Script Runs Backwards
« Reply #7 on: 14 / September / 2010, 17:58:40 »
I tried that too,  I put as\ sleep in there
Strange.

Your script isn't running backwards, that is impossible. The only thing that makes sense is that the first shoot_full isn't being recognized. You could try a shoot_half, wait, shoot_full wait release instead.

I have successfully used the following lua script to shoot video at intervals, if you want to try it
Code: [Select]
--[[
@description video interval
@param a rec minutes
@default a 0
@param b rec seconds
@default b 10
@param c sleep seconds
@default c 2
@param d count
@default d 2
--]]

rec_time= a*60*1000 + b*1000
sleep_time = c*1000

-- need to wait a bit before start
sleep(1000)
while d > 0 do
press("shoot_half")
sleep(500) -- give AF a chance
press("shoot_full")
release("shoot_full")
release("shoot_half")
sleep(rec_time)
click("shoot_full")
sleep(sleep_time)
d = d - 1
end
Don't forget what the H stands for.


*

Offline NSS

  • *
  • 26
Re: Script Runs Backwards
« Reply #8 on: 14 / September / 2010, 18:05:30 »
This one did a like two second recording, then a wait for maybe what ten ( i diddn't time it)  but then it started again recording but never stopped.

Joe  UG!

*

Offline reyalp

  • ******
  • 13061
Re: Script Runs Backwards
« Reply #9 on: 14 / September / 2010, 18:10:15 »
Sounds like the same behavior of missing the first click. I guess it if it always does this you should be able to just put an extra press and release at the start of the script.

Don't understand why it would be this way.
Don't forget what the H stands for.

 

Related Topics