Download
VirusTotal
[spoiler=Lua Interpreter.cpp]
[/spoiler]
[spoiler=Test.lua]
[/spoiler]
VirusTotal
[spoiler=Lua Interpreter.cpp]
Code:
#pragma comment(lib, "lua5.1.lib")
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <Windows.h>
extern "C"
{
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
using namespace std;
int main(void)
{
SetConsoleTitleA("Lua C API - Printing a string (Made by IcyJake)");
lua_State *L = luaL_newstate(); // Creates our environment
luaL_openlibs(L); // Loads the libraries
luaL_dofile(L, "Test.lua"); // Runs the Lua file
lua_close(L); // Exits our environment
system("pause");
return 0;
}
[spoiler=Test.lua]
Code:
function printMessage()
print("This text was printed to the console using the Lua C API!")
end
printMessage()