-
I currently have a binding that runs the
It seems to sometimes have issues with I guess a Lua plugin that runs this script could solve this issue, e.g.:
Can someone provide an example how to pass
I want bindings like: That would hardcode those arguments, I want to define multiple bindings with arbitrary number of arguments, e.g.:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is a lua thing and not an mpv thing. Your mp.register_script_message("my-message", function (first, ...)
print("first:", first)
for i,v in ipairs(arg) do
print(i .. ": " .. tostring(v))
end
end) See more info here https://www.lua.org/pil/5.2.html |
Beta Was this translation helpful? Give feedback.
-
mp.register_script_message("trash-video", function (first, second, third)
mp.command_native({
name = "subprocess",
args = { "trash-video", unpack({first, second, third})},
})
end) |
Beta Was this translation helpful? Give feedback.
You're right, sorry. It changed between lua version and it's still supported in my version (5.1), but no longer in 5.2 or luajit.
My link was for Lua 5.0, but because it was chapter 5.2 of that book I thought it's the manual of lua 5.2, and it's not.
That's the manual of Lua 5.2: https://www.lua.org/manual/5.2/manual.html#3.4.10 and you should always refer to it when you don't know something in Lua.
Anyway, the answer is this: