Open kannibalox opened 5 months ago
This looks interesting. What do you use this for personally?
I converted my config to Lua, but that was more to test any edge cases. More regularly I find myself using it to do complicated client-side filtering.
My main goal was to start out with making methods/events more structured, since that proves to be a major source of confusion when new people are learning the rTorrent scripting language. Currently I think it needs a better syntax than the one I provided above, so I'm still playing around with that a little. If you're looking for ideas, luarocks has a lot of neat packages that could extend rtorrent to do pretty much anything.
This was tested on Lua 5.4, since while there shouldn't be any version-specific features in use, the lack of native 64-bit integer support in versions before 5.3 seems like a deal breaker.
There are three RPC commands added:
lua.execute
, which allows executing Lua code, with artorrent
package that has basic support for making direct RPC calls from a file:That's a little verbose to be a replacement for
rtorrent.rc
, so there's alsolua.import
, which uses the same "autocall" Lua magic for a simpler syntax:lua.execute.str
is mainly to allow events, but could it definitely use a more convenient syntax:Implements https://github.com/rakshasa/rtorrent/issues/490