Wikia

CHDK Wiki

Execute Lua scripts with hostlua & notepad++

584pages on
this wiki
Talk0

Project CHDK hostlua for Windows with the editor Notepad++

Software of other developers included in the packageEdit

Requirements:Edit

Installation:Edit

  • Unzip the folder "hostlua" from hostlua.zip to any destination.
  • Note that this installation procedure will not work if any of the file paths have spaces or special characters in them.
  • Configuration of Notepad++ console: select A or B

A Local Notepad++ Portable (directory: hostlua\Notepad++Portable)Edit

New installation Notepad++ PortableEdit

ConfigurationEdit

  • Run file "local_config.cmd in subfolder "hostlua\plugin_NppExec"

Start of local Noptepad++ PortableEdit

  • via the "Start Notepad++" in the main folder hostlua\

B with installed Notepad++ or Notepad++ Portable (not unpacked as point A)Edit

  • Run file "create_config.cmd" in subfolder "hostlua\plugin_NppExec".
  • select C: or D:

C First use of NppExec:Edit

  • Installation of the Plugin via Notepad ++ menu "Settings > Import > import Plugin(s)..."select "hostlua\plugin_NppExec\NppExec.dll"
  • Close Notepad++
  • Copy all files from subdir "hostlua\plugin_NppExec\config" to:
  • select E: or F:
  • E: installed Notepad++: "C:\Users\<user name>\AppData\Roaming\Notepad++\plugins\config"
  • F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"

D NppExec is already in use:Edit

  • Close Notepad++
  • Add/Update the content of "hostlua\plugin_NppExec\config\npes_saved.txt" in the file npes_saved.txt in ...
  • select E: or F:
  • E: installed Notepad++: "C:\Users\<user name>\AppData\Roaming\Notepad++\plugins\config"
  • F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"
  • Check the setting in Notepad++ menu "Pugins => NppExec => Console Output...{ANSI/ANSI}"
  • Recommendation: activate the setting in Notepad++ menu "Plugins => NppExec => Save all files on Execute"

OperationsEdit

GeneralEdit

Lua files are always subjected to a simple syntax examination. File locations:

  • CHDK files: "hostlua\A\CHDK\..."
  • Lua libraries: "hostlua\A\CHDK\LUALIB\"
  • Lua scripts: accepted from all folders, copy to the camera "A\CHDK\SCRIPS\".
  • PTP command files have the extension ".ptp", accepted from all folders.

Available commands in Notepad++ console:

  • CHDK LUA local

> Execute Lua scripts in the CHDK script emulator.

  • CHDK LUA local keypad

Draw test keypad

> Execute Lua scripts in the CHDK script emulator with virtual keyboard and display. > GUI keypad usage:

         shortcut    | description
     ---------------------------------
     [CTRL]+[UP]     | button UP
     [CTRL]+[DOWN]   | button DOWN
     [CTRL]+[RIGHT]  | button RIGHT
     [CTRL]+[LEFT]   | button LEFT
     [CTRL]+[ENTER]  | button FUNC/SET
     [CTRL]+[h]      | button SHOOT HALF
     [CTRL]+[s]      | button SHOOT FULL
     [CTRL]+[v]      | button VIDEO
     [CTRL]+[+]      | button ZOOM IN
     [CTRL]+[-]      | button ZOOM OUT
     [CTRL]+[m]      | button MENU
     [CTRL]+[d]      | button DISP.
     [CTRL]+[1]      | button RC1
     [CTRL]+[2]      | button RC2
     [CTRL]+[3]      | button RC3
     [CTRL]+[4]      | button RC4
     [F2]            | toggle LCD width
     [F3]            | LCD width 360 px
     [F4]            | LCD width 480 px
     [ESC]           | EXIT - break runnig script and close keypad
     context menu:
     "LCD Width" ------+-- "LCD 360 px"
                       +-- "LCD 480 px"
     "Code Page" ------+-- "1250"
                       +-- "1251"
                       +-- "1252"
                       +-- "1253"
                       +-- "1254"
                       +-- "1257"
     "GUI Close Type" -+-- "On Exit Script"
                       +-- "After 10 Seconds"
                       +-- "On Lost Focus"
     "Exit"
  • CHDK LUA remote

> Transferring files to the camera and run Lua scripts on the camera.

> The Lua command set_record() can be used despite PTP connection.

  • CHDK LUA remote output

> The same as "CHDK LUA remote".

> In addition, the outputs of the script console output to the Notepad++ console at script end.

> Scripts will run a bit slower compared to "LUA CHDK remote".

  • CHDK PTP

> Processing of PTP commands with chdkptp. Command list under "hostlua\bin\chdkptp_USAGE.TXT" or usage.txt.

UsageEdit

  • Open a CHDK Lua file in Notepad++.
  • Start console command in Notepad++ menu "Macro"
  • Repeat last console command: CTRL+F6

LinksEdit

Around Wikia's network

Random Wiki