Created
January 13, 2022 11:18
-
-
Save dacap/0c5b5f7def685194fab4526d9cf1c6c4 to your computer and use it in GitHub Desktop.
Get the current Lua script filename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function script_filename() | |
local source = debug.getinfo(2, "S").source | |
if source:sub(1, 1) == "@" then | |
return source:sub(2) | |
else | |
return "" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment