-
Couldn't load subscription status.
- Fork 7
Home
Welcome to the python-lua wiki!
This page lists what the transpiler does and how you can use it to your advantage for maximum accuracy.
No condition replacements
These are things that get parsed with no condition required.Reading Format:
"trigger": "replacement"trigger is the thing written.Eg:
True transpiles into `true` in all cases.
For example, tTrue becomes ttrue "True": "true"
"False": "false"
"#end": "end"
"#class": "}"
"def": "local function"
"None": "nil"
"str(": "tostring("
"int(": "tonumber("
"!=": "~="
"#": "--"
"eval(": "loadstring("
"exec(": "loadstring("
" + ": " .. "
"elif": "elseif"
"time.sleep(": "wait("
"random.randint(": "math.random("
"random.randrange(": "math.random(",
".replace(": ":gsub(",
".format(": ":format("Conditioned Replacements
These are replacements that have a condition, if a certain character/word is in a line.
Tab = tab character.
indent = 2 spaces, or more.
If trigger in a line:
#exclude: Remove line from the entire script. This doesn’t avoid parsing, it removes the line completely.
while: Replaces : in current line with do.
if: Replaces : in current line with then.
class : Replaces class with local, replaces : with = {
= and no tab or indent: Replaces entire line with "local" + line. Adds local to line start. Aim: first declaration of variable.
else:: Removes : from else
max( and ): Replaces max( with math.max(
min( and ): Replaces min( with math.min(
for and :: Replace : in line with do
Information not found? See README.md or ask in the discord server.