Login Register






[C++] [Release] Lua C API - Printing a string filter_list
Author
Message
[C++] [Release] Lua C API - Printing a string #1
Download
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 Confidential)");    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 infiniteLoop(time) local second = tonumber(os.clock() + time) while (os.clock() < second) do print("This text was printed to the console using the Lua C API!") end end infiniteLoop(5)
(This post was last modified: 02-04-2019, 02:22 AM by Confidential.)

Reply





Messages In This Thread
[C++] [Release] Lua C API - Printing a string - by Confidential - 04-29-2018, 04:45 AM