-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaye.cpp
More file actions
52 lines (41 loc) · 889 Bytes
/
aye.cpp
File metadata and controls
52 lines (41 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "aye.h"
#include <filesystem>
#include <iostream>
#include <vector>
#include <mutex>
#include "file_tools.h"
//#include "../../interfaces.h"
//#include "../../utils/game_utils.h"
std::mutex run_mutex;
std::vector<std::string> codes_to_run;
std::vector<std::string> codes_to_run_safe;
void lua_features::add_code_to_run(const std::string& str)
{
codes_to_run.clear();
codes_to_run.push_back(str);
{
std::unique_lock l(run_mutex);
codes_to_run.swap(codes_to_run_safe);
}
}
void lua_features::run_all_code()
{
std::unique_lock l(run_mutex);
is_hack_call = true;
auto lua = g_pLua_Shared->GetLuaInterface(LuaInterfaceType::LUAINTERFACE_CLIENT);
if (lua)
{
for (auto i : codes_to_run_safe)
{
try
{
lua->RunString("ExecIloveYou", "", i.c_str(), true, true);
}
catch (...)
{
}
}
}
codes_to_run_safe.clear();
is_hack_call = false;
}