Mini-Help for a mini-lua script - page 2 - Script Writing - CHDK Forum

Mini-Help for a mini-lua script

  • 28 Replies
  • 6027 Views
Re: Mini-Help for a mini-lua script
« Reply #10 on: 05 / August / 2014, 00:23:53 »
Advertisements
Maybe we can add to propset5.h:
Code: [Select]
#define PROPCASE_TIMER_SHOOTS                    377        // Number of shoots for TIMER_MODE=Custom
Good idea - I'd suggest  PROPCASE_TIMER_SHOTS if you are going to add it.

Quote
Writing to those propcase (TIMER_MODE, TIMER_DELAY, "TIMER_SHOOTS"), I did not see any effect.
I did some Google searching of the forum but did not find anything relevant.  (I've given up on the Forum's built-in search engine).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #11 on: 12 / August / 2014, 06:43:02 »
Definitely the self-timer property case is Read Only, so i fell back on a less elegant, but working , script:  ::)

Code: [Select]
--[[
@title Night_Scene
]]

capmode=require("capmode")
props=require("propcase")

function selftimer()
  sleep (1000)
  click ("set")
  sleep (500)
  click ("down")
  sleep (500)
  click ("right")
  sleep (500)
  click ("down")
  sleep (500)
  click ("set")
  sleep (500)
  end

set_prop(props.FLASH_MODE, 2)                      -- flash off
selftimer()                                        -- self-timer
capmode.set("SCN_LONG_SHUTTER")                    -- Long Shutter mode
set_prop(57, 0)                                    -- JPG Superfine
exit_alt()                                         -- done

Surely a similar workaround is needed to set IS Mode to off.

Re: Mini-Help for a mini-lua script
« Reply #12 on: 12 / August / 2014, 08:06:30 »
Surely a similar workaround is needed to set IS Mode to off.
I've seen IS disabled by setting the appropriate propcase in several scripts so I believe you won't need the button pressing trick for that.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #13 on: 12 / August / 2014, 08:26:45 »
I've seen IS disabled by setting the appropriate propcase in several scripts so I believe you won't need the button pressing trick for that.
Neither set_prop(145, 4) nor set_prop(props.IS_MODE, 4) work on my cam... you know, it thinks different  :(


Re: Mini-Help for a mini-lua script
« Reply #14 on: 12 / August / 2014, 10:00:08 »
I've seen IS disabled by setting the appropriate propcase in several scripts so I believe you won't need the button pressing trick for that.
Neither set_prop(145, 4) nor set_prop(props.IS_MODE, 4) work on my cam... you know, it thinks different  :(
The ultimate.lua script uses set_prop(props.IS_MODE, 3) but I don't know if that actually does anything.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #15 on: 12 / August / 2014, 12:56:35 »
The ultimate.lua script uses set_prop(props.IS_MODE, 3) but I don't know if that actually does anything.
Doesn't work either.
I've to add a "button pressing" function to exclude the IS
Code: [Select]
function ISMode()
  ism = get_prop(145)
  if (ism ~= 4) then
  sleep (1000)
  click ("menu")
  sleep (500)
  click ("up")
  sleep (500)
  click ("up")
  sleep (500)
  click ("up")
  sleep (500)
  click ("right")
  sleep (500)
  click ("right")
  sleep (500)
  click ("right")
  sleep (500)
  click ("menu")
  sleep (500)
  click ("menu")
  sleep (500)
  end
  end

but doing so, when i powercycle the camera, IS remains off (all other parameters are restored, P mode included).
So, the night-scene script looses its purpose of "one-button multi-set". I have to manually restore the IS everytime i've run this script :(
« Last Edit: 12 / August / 2014, 15:08:23 by fabri22 »

*

Offline nafraf

  • *****
  • 1308
Re: Mini-Help for a mini-lua script
« Reply #16 on: 17 / August / 2014, 21:27:25 »
Definitely the self-timer property case is Read Only, so i fell back on a less elegant, but working , script:  ::)
You can try this alternative (it requires Lua native calls enabled):
Code: [Select]
call_event_proc("UI.CreatePublic")
call_event_proc("PTM_SetCurrentItem",0x800e,1)

Re: Mini-Help for a mini-lua script
« Reply #17 on: 18 / August / 2014, 09:49:33 »
You can try this alternative (it requires Lua native calls enabled):
Code: [Select]
call_event_proc("UI.CreatePublic")
call_event_proc("PTM_SetCurrentItem",0x800e,1)

WOW! Works like a charm. Thank you nafraf.

Just in case, do you know any magic potion of this kind to disable IS? It would be nice to definitely delete those bad "button pressing" lines from the script.
I dare not ask where to find these magic formulas :)

It maybe this workaround also could solve the set_focus issues with my camera ?
... i know ... too many questions  ::)


Re: Mini-Help for a mini-lua script
« Reply #18 on: 18 / August / 2014, 11:36:42 »
I dare not ask where to find these magic formulas :)

link > UI properties (PTM functions)
link > CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD

Quote
It maybe this workaround also could solve the set_focus issues with my camera ?
Those don't seem to be related to setting UI values ....
« Last Edit: 18 / August / 2014, 11:39:10 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Mini-Help for a mini-lua script
« Reply #19 on: 18 / August / 2014, 14:33:05 »
Those don't seem to be related to setting UI values ....

Thanks for the usefull and instructive links WWZ.

mini OT :
Just tried the call_event_proc("PTM_SetCurrentItem",0x8021,3) (focus mode = "infinity") that simply shuts down my camera ...  :(

 

Related Topics