X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/4f269f63da58583aa27459abdfff168df046dbac..0a85b72549d294b127c3224610870be4f9382f9a:/client/scripting.c diff --git a/client/scripting.c b/client/scripting.c index ae11d7ca..9e3ff4e3 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -136,6 +136,18 @@ static int l_ukbhit(lua_State *L) lua_pushboolean(L,ukbhit() ? true : false); return 1; } +/** + * @brief Calls the command line parser to deal with the command. This enables + * lua-scripts to do stuff like "core.console('hf mf mifare')" + * @param L + * @return + */ +static int l_CmdConsole(lua_State *L) +{ + CommandReceived((char *)luaL_checkstring(L, 1)); + return 0; +} + /** * @brief Sets the lua path to include "./lualibs/?.lua", in order for a script to be @@ -172,6 +184,7 @@ int set_pm3_libraries(lua_State *L) {"foobar", l_foobar}, {"ukbhit", l_ukbhit}, {"clearCommandBuffer", l_clearCommandBuffer}, + {"console", l_CmdConsole}, {NULL, NULL} };