multicam.lua print return from camera command - Script Writing - CHDK Forum supplierdeeply

multicam.lua print return from camera command

  • 2 Replies
  • 2753 Views
*

Offline mrred

  • *
  • 13
multicam.lua print return from camera command
« on: 04 / January / 2019, 14:44:08 »
Advertisements
Hi, I don't understand how to have the return of a camera command with chdkptp / multicam.lua


like get_focus()


Code: [Select]
!return mc:cmdwait('get_focus()')
result:

Code: [Select]
[5]={

  status={
   status=false,
   cmd="get_focus",
   msg="unknown",
  },
  done=true,
  failed=false,
 },
}




doesn't return value about focus


thx alot.

*

Offline reyalp

  • ******
  • 14080
Re: multicam.lua print return from camera command
« Reply #1 on: 04 / January / 2019, 22:49:56 »
In multicam, mc:cmd/mc:cmdwait accept named commands that are defined in the multicam script. That's what the 'unknown' in your example is about.

To run lua code, you have to use the call or pcall commands like
Code: [Select]
!return mc:cmdwait('call return get_focus()')
Return values from you code will be returned in the inner status member as an array.

You can see the pre-defined commands at the bottom of the multicam script, around
Code: [Select]
local function init()
Don't forget what the H stands for.

*

Offline mrred

  • *
  • 13
Re: multicam.lua print return from camera command
« Reply #2 on: 08 / January / 2019, 09:52:11 »
thx alot for your help

 

Related Topics