Unfortunately, it now throws an error saying it's not an integer type. A line in luascript.c was change from: script_print_screen_statement( luaL_checknumber( L, 1 )+1000);to script_print_screen_statement( luaL_checknumber( L, 1 ));Apparently, the old way converts the argument to (int) before calling the function, while the new way doesn't.
Quote from: lapser on 27 / November / 2012, 20:49:40Unfortunately, it now throws an error saying it's not an integer type. A line in luascript.c was change from: script_print_screen_statement( luaL_checknumber( L, 1 )+1000);to script_print_screen_statement( luaL_checknumber( L, 1 ));Apparently, the old way converts the argument to (int) before calling the function, while the new way doesn't.With all due respect, it looks like you were passing a string to a function expecting an integer, and a bug / side effect in the old code allowed that ? Reyalp can probably better explain how mixed types are handled in Lua ...
connected: Canon PowerShot D10, max packet size 512con 15> =print_screen(os.date('%H%M')) ; print('hi') print_screen(0)con 1> ls CHDK/LOGS...LOG_2208.TXTcon 2> =r='';for s in io.lines('A/CHDK/LOGS/LOG_2208.TXT') do r=r..s end return r3:return:'hi'con 3>
I probably triggered something by closing and reopening the file too much, using the new append mode, to avoid losing the log with battery shut down. I did try all the tonumber stuff, and nothing worked, when I saw the bug.
I ran into the same problem with some similar code. In discussion with reyalp on IRC, he pointed out that its the same problem SticK was having. Its an issue with doing the shoot() and print_screen print() too close together - the system apparently runs out of file handles. When I slowed down the shooting loop by about 1 second (from 3 seconds to 4) then the crash stopped. And I'm doing thousands of write operations like that over a 4 to 8 hour period so its not the quantity - its the timing.
Quote from: lapser on 28 / November / 2012, 13:29:03I probably triggered something by closing and reopening the file too much, using the new append mode, to avoid losing the log with battery shut down. I did try all the tonumber stuff, and nothing worked, when I saw the bug. I ran into the same problem with some similar code. In discussion with reyalp on IRC, he pointed out that its the same problem SticK was having. Its an issue with doing the shoot() and print_screen print() too close together - the system apparently runs out of file handles.
I recall a discussion of memory problems when leaving a camera running for days at a time. Canon uses memory for each picture on the card, and didn't expect multi gigabyte card, I suppose. I noticed the system slowing down with too many picture on card. Also, 2 weird bugs showed up that went away when I deleted pictures:
#define CAM_STARTUP_CRASH_FILE_OPEN_FIX 1
Started by Asterda « 1 2 » Script Writing
Started by drew_cady Script Writing
Started by acseven « 1 2 » Archived Issues
Started by oronocova Creative Uses of CHDK
Started by lapser Script Writing