Skip to content

Commit 490eeb8

Browse files
author
arch
committed
update install instructions
1 parent c59ee81 commit 490eeb8

File tree

3 files changed

+15
-33
lines changed

3 files changed

+15
-33
lines changed

contrib/OpenFunscripter/README.md

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
11
# Open Funscripter Integration
22

3-
A hacky lua script to use the python funscript generator scripts in Open Funscripter. Copy the lua script (`funscript_generator.lua`) to `data/lua` in your OFS directory. Then adjust the python script path in OFS or direct in the source code. Finally add an shortcut for the script in OFS. The script was only tested on Linux!
3+
A hacky lua script to use the python funscript generator script in Open Funscripter.
44

5-
## Memo for developer
5+
## Installation
66

7-
**NOTE:** We should use luasockets for the communication but i could not get them to work. I install the lua socket module with `pacman -Sy lua-socket` and compile OFS with dynamic linked library support for lua. But when i load the socket module i got an exception `Symbol not found: some_symbol_name`.
8-
9-
Below the code i used for my first lua socket test:
10-
11-
```lua
12-
package.cpath ="/usr/lib/lua/5.4/?.so;" .. package.cpath
13-
package.path = "/usr/share/lua/5.4/?.lua;" .. package.path
14-
15-
local HOST, PORT = "localhost", 9090
16-
local socket = require('socket')
17-
18-
client, err = socket.connect(HOST, PORT)
19-
client:setoption('keepalive', true)
20-
21-
-- Attempt to ping the server once a second
22-
start = os.time()
23-
while true do
24-
now = os.time()
25-
if os.difftime(now, start) >= 1 then
26-
data = client:send("Hello World")
27-
-- Receive data from the server and print out everything
28-
s, status, partial = client:receive()
29-
print(data, s, status, partial)
30-
start = now
31-
end
32-
end
33-
```
7+
1. Download the packed Python Funscript Editor from [github release page](https://github.com/michael-mueller-git/Python-Funscript-Editor/releases).
8+
2. Extract the Archiv.
9+
3. Copy the `funscript_generator.lua` script to `data/lua` in your OFS directory.
10+
4. Open the `funscript_generator.lua` file and adjust the `Settings.FunscriptGenerator` and `Settings.TmpFile` variable.
11+
5. Launch OFS.
12+
6. Navigate to `View : Special functions : Custom Functions` and select the `funscript_generator.lua` entry. Click the Button `Bind Script` (This may trigger the funscript generator, just ignore it for now).
13+
7. Navigate to `Options : Keys : Dynamic` and insert a shortcut for the funscript generator.

contrib/OpenFunscripter/funscript_generator.lua

100644100755
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Settings = {}
2-
Settings.PythonScript = "/home/arch/Repos/private/stroker-robot/Code/Python Funscript Editor/main.py"
3-
Settings.TmpFile = "/tmp/funscript_actions.csv"
2+
Settings.FunscriptGenerator = "C:\\Users\\win10\\Desktop\\funscript-editor\\funscript-editor.exe"
3+
Settings.TmpFile = "C:\\Users\\win10\\AppData\\Local\\Temp\\funscript_actions.csv"
44
SetSettings(Settings)
55

66
function GetActions(video)
77
local at = {}
88
local pos = {}
9-
local command = 'python3 "'..Settings.PythonScript..'" --generator -s '..tostring(CurrentTimeMs)..' -i "'..video..'" -o "'..Settings.TmpFile..'"'
9+
local command = Settings.FunscriptGenerator..' --generator -s '..tostring(CurrentTimeMs)..' -i "'..video..'" -o "'..Settings.TmpFile..'"'
1010
print(command)
1111
os.execute(command)
1212
local f = io.open(Settings.TmpFile)
@@ -30,7 +30,8 @@ function GetActions(video)
3030
end
3131

3232
print('start funscript generator')
33-
local video = VideoFilePath -- you have to set the metadata at OFS start
33+
local video = VideoFilePath -- NOTE: do not use special character in the video path!
34+
print('video file: ', video)
3435
local actions = {GetActions(video)}
3536
for i = 1, #actions[1] do
3637
CurrentScript:AddActionUnordered(tonumber(actions[1][i]), tonumber(actions[2][i]), true, 0)

funscript_editor/ui/minimal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(self, video_file, start_time, output_file):
4949
sys.exit()
5050

5151
if not os.path.exists(video_file):
52+
if video_file == "": video_file = "EMPTY"
5253
self.__logger.error("Video file not found: %s", video_file)
5354
self.__show_message("Video file not found ({})".format(video_file))
5455
sys.exit()

0 commit comments

Comments
 (0)