|
1 | 1 | # Open Funscripter Integration |
2 | 2 |
|
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. |
4 | 4 |
|
5 | | -## Memo for developer |
| 5 | +## Installation |
6 | 6 |
|
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. |
0 commit comments