1-
1+ -- Version 0.0.1
22configFile = ofs .ExtensionDir () .. " /config"
33pythonFunscriptGenerator = ofs .ExtensionDir () .. " /funscript-editor/funscript-editor.exe"
44
@@ -14,34 +14,34 @@ function funscript_generator()
1414 print (" currentScriptIdx: " , ofs .ActiveIdx ())
1515 print (" currentTimeMs: " , currentTimeMs )
1616
17- local next_action = ofs .ClosestActionAfter (script , currentTimeMs )
18- if next_action and next_action .at < currentTimeMs + 500.0 then
19- next_action = ofs .ClosestActionAfter (script , next_action .at )
17+ local next_action = ofs .ClosestActionAfter (script , currentTimeMs / 1000 )
18+ if next_action and script . actions [ next_action ] .at < ( currentTimeMs + 500 ) then
19+ next_action = ofs .ClosestActionAfter (script , script . actions [ next_action ] .at / 1000 )
2020 end
2121
2222 if next_action then
23- print (" nextAction: " , next_action .at ) -- TODO is this in seconds?
23+ print (" nextAction: " , script . actions [ next_action ] .at )
2424 else
2525 print (" nextAction: nil" )
2626 end
2727
2828 local command = ' "'
2929 .. pythonFunscriptGenerator
3030 .. ' " --generator -s '
31- .. ( next_action == nil and tostring (currentTimeMs ) or tostring (currentTimeMs ).. ' -e ' .. tostring (next_action .at ) )
31+ .. ( next_action == nil and tostring (currentTimeMs ) or tostring (currentTimeMs ).. ' -e ' .. tostring (script . actions [ next_action ] .at ) )
3232 .. ' -i "'
3333 .. video
3434 .. ' " -o "'
3535 .. tmpFile
3636 .. ' "'
3737
3838
39- print (command )
39+ print (" cmd: " , command )
4040 ofs .SilentCmd (command , false )
4141
4242 local f = io.open (tmpFile )
4343 if not f then
44- print (' lua: funscript generator output file not found' )
44+ print (' Funscript Generator output file not found' )
4545 return
4646 end
4747
0 commit comments