From e04556e527ac36a002c4cdbf081dc2c7060b6dcd Mon Sep 17 00:00:00 2001 From: Dregu Date: Thu, 4 Mar 2021 07:31:31 +0200 Subject: [PATCH] lets make that 1 billion --- src/injected/script.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/injected/script.cpp b/src/injected/script.cpp index ffc83a604..83e61f034 100644 --- a/src/injected/script.cpp +++ b/src/injected/script.cpp @@ -32,7 +32,7 @@ Say get_say() } void infinite_loop(lua_State* argst, lua_Debug * argdb) { - luaL_error(argst, "Reached the script execution amount."); + luaL_error(argst, "Hit Infinite Loop Detection of 1bln instructions"); }; Script::Script(std::string script, std::string file, bool enable) @@ -685,6 +685,7 @@ bool Script::run(ImDrawList *dl) return true; if (changed) { + result = ""; changed = false; // Compile & Evaluate the script if the script is changed try @@ -706,6 +707,7 @@ bool Script::run(ImDrawList *dl) lua["on_win"] = sol::lua_nil; lua["on_screen"] = sol::lua_nil; auto lua_result = lua.safe_script(code); + result = "OK"; } catch (const sol::error &e) { @@ -716,7 +718,7 @@ bool Script::run(ImDrawList *dl) try { lua_sethook(lua.lua_state(), NULL, 0, 0); - lua_sethook(lua.lua_state(), &infinite_loop, LUA_MASKCOUNT, 100000000); + lua_sethook(lua.lua_state(), &infinite_loop, LUA_MASKCOUNT, 1000000000); drawlist = dl; sol::optional meta_name = lua["meta"]["name"]; sol::optional meta_version = lua["meta"]["version"];