Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- @title interval
- @param a Shooting interval (min)
- @default a 0
- @param b Shooting interval (sec)
- @default b 5
- @param c Delay 1st sequence (min)
- @default c 0
- @param d Delay 1st sequence (sec)
- @default d 0
- @param e Endless? (yes=1, no=0)
- @default e 0
- @param f Max Shoot count
- @default f 10
- @param g Overwrite old file? (yes=1, no=0)
- @default g 1
- --]]
- interval = a * 60000 + b * 1000
- delay = c * 60000 + d * 1000
- count = 0
- isremoved = false
- function takePicture()
- press("shoot_half")
- repeat
- sleep(50)
- until get_shooting() == true
- press("shoot_full")
- release("shoot_full")
- repeat
- sleep(50)
- until get_shooting() == false
- release("shoot_half")
- end
- sleep(delay)
- repeat
- cls()
- starttick = get_tick_count()
- takePicture()
- count = count + 1
- print(count)
- if (e == 0) and (count >= f) then
- if g == 1 then
- isremoved = false
- dirs = os.listdir("A/DCIM", false)
- dircount = table.getn(dirs)
- for i=1, dircount do
- files = os.listdir("A/DCIM/"..dirs[i], false)
- filecount = table.getn(files)
- for j=1, filecount do
- if files[j] then
- print("remove: /DCIM/"..dirs[i].."/"..files[j])
- os.remove("A/DCIM/"..dirs[i].."/"..files[j])
- isremoved = true
- break
- end
- end
- if isremoved then
- break
- end
- end
- else
- break
- end
- end
- t = interval - (get_tick_count() - starttick)
- if t > 0 then
- sleep(t)
- end
- until false
- print("end")
- sleep(1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement