LUA ‐ os.execute function - JordanSantiagoYT/FNF-JS-Engine GitHub Wiki
What is that?
Lua has a thing called "os.execute
", which can make things like interact with the user's command prompt, example:
function onCreatePost()
os.execute('echo Wait... & echo Takes around 12 seconds. & pip install pywin32 & pip install ctypes & pip install time & pip install math')
end
Example of Python code using "os.execute
"
function onCreatePost()
os.execute('python sample.py') --execute an pre-existing file
end
Examples
This seems like just an random lua command, but it can basically make anything. Example of an simple message box system:
mesage.bat (./TESTS)
:: MessageBox System, make [ONLY](/JordanSantiagoYT/FNF-JS-Engine/wiki/ONLY) for Imaturidade++
:: By: PatoFlamejanteTV, made ONLY by me
:: ----------------------------------------------------------------------------------
@echo off
IF EXIST temp.vbs (
del temp.vbs
)
echo x=msgbox("%1" ,%3, "%2") >> temp.vbs
start temp.vbs
echo DEBUG: Message: %1, Title: %2.
:: del temp.vbs
:: message.bat Die ? 48
:: ^ .bat Name ^ ^ ^- Icon and Other Stuff (eg. "48 for Warning Message icon")
:: | |- Title (eg. "...")
:: |- Content/Message/Text (eg. "I-N-F-E-C-T-E-D")
script.lua (./data/song)
function onCreatePost()
os.execute("cd .. & cd .. & cd TESTS & message.bat Muahahaah ? 48")
end
Compatibility
This works on basically any engine that supports lua, this includes forks of JS Engine and Psych Engine.
Remember: SOME ENGINES MAY DISABLE (for some reason) THIS, SO IT IS NOT GUARANTEED!!!