Skip to content

Commit 119cbe0

Browse files
author
arch
committed
fix ofs extension
1 parent bb5b7f5 commit 119cbe0

File tree

2 files changed

+12
-13
lines changed
  • contrib/OpenFunscripter/extensions

2 files changed

+12
-13
lines changed

contrib/OpenFunscripter/extensions/Funscript Generator Linux/main.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
-- Version: 0.0.1
22
configFile = ofs.ExtensionDir() .. "/config"
33
pythonScript = ""
44

@@ -14,21 +14,20 @@ 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)
23+
print("nextAction: ", script.actions[next_action].at)
2424
else
2525
print("nextAction: nil")
2626
end
27-
2827
local command = 'python3 "'
2928
..pythonScript
3029
..'" --generator -s '
31-
..( next_action == nil and tostring(currentTimeMs) or tostring(currentTimeMs)..' -e '..tostring(next_action.at) )
30+
..( next_action == nil and tostring(currentTimeMs) or tostring(currentTimeMs)..' -e '..tostring(script.actions[next_action].at) )
3231
..' -i "'
3332
..video
3433
..'" -o "'

contrib/OpenFunscripter/extensions/Funscript Generator Windows/main.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
-- Version: 0.0.1
22
configFile = ofs.ExtensionDir() .. "/config"
33
pythonFunscriptGenerator = ""
44

@@ -13,21 +13,21 @@ function funscript_generator()
1313
print("currentScriptIdx: ", ofs.ActiveIdx())
1414
print("currentTimeMs: ", currentTimeMs)
1515

16-
local next_action = ofs.ClosestActionAfter(script, currentTimeMs)
17-
if next_action and next_action.at < currentTimeMs + 500.0 then
18-
next_action = ofs.ClosestActionAfter(script, next_action.at)
16+
local next_action = ofs.ClosestActionAfter(script, currentTimeMs / 1000)
17+
if next_action and script.actions[next_action].at < (currentTimeMs + 500) then
18+
next_action = ofs.ClosestActionAfter(script, script.actions[next_action].at / 1000)
1919
end
2020

2121
if next_action then
22-
print("nextAction: ", next_action.at)
22+
print("nextAction: ", script.actions[next_action].at)
2323
else
2424
print("nextAction: nil")
2525
end
2626

2727
local command = '"'
2828
..pythonFunscriptGenerator
2929
..'" --generator -s '
30-
..( next_action == nil and tostring(currentTimeMs) or tostring(currentTimeMs)..' -e '..tostring(next_action.at) )
30+
..( next_action == nil and tostring(currentTimeMs) or tostring(currentTimeMs)..' -e '..tostring(script.actions[next_action].at) )
3131
..' -i "'
3232
..video
3333
..'" -o "'

0 commit comments

Comments
 (0)