2022-03-06 01:00:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "scaleableinputs.h"
|
|
|
|
#include "screen.h"
|
|
|
|
#include "matcher.h"
|
|
|
|
|
|
|
|
#include <xinputsimulator.h>
|
2022-04-21 00:47:57 +02:00
|
|
|
#include <thread>
|
2022-03-06 01:00:19 +01:00
|
|
|
|
|
|
|
class LolAutoAccept {
|
|
|
|
private:
|
2022-04-20 00:54:10 +02:00
|
|
|
ScreenShot* screen = nullptr;
|
2022-03-06 01:00:19 +01:00
|
|
|
Matcher acceptmatcher;
|
|
|
|
Matcher arrowmatcher;
|
2022-03-10 00:31:51 +01:00
|
|
|
Matcher banmatcher;
|
2022-03-06 01:00:19 +01:00
|
|
|
Matcher::Match lastacceptmatch;
|
|
|
|
XInputSimulator& sim;
|
|
|
|
|
|
|
|
ScaleableInputs inputs;
|
|
|
|
|
|
|
|
std::string prepick;
|
|
|
|
std::string ban;
|
|
|
|
std::string pick;
|
2022-04-21 00:47:57 +02:00
|
|
|
bool autoacceptenabled = false;
|
|
|
|
bool prepickenabled = false;
|
|
|
|
bool banenabled = false;
|
|
|
|
bool pickenabled = false;
|
2022-03-06 01:00:19 +01:00
|
|
|
|
2022-04-20 00:54:10 +02:00
|
|
|
bool shouldrun = false;
|
2022-04-21 00:47:57 +02:00
|
|
|
std::thread lolaathread;
|
2022-04-20 00:54:10 +02:00
|
|
|
|
2022-03-06 01:00:19 +01:00
|
|
|
enum class State {
|
|
|
|
LOBBY,
|
|
|
|
PREPICK,
|
|
|
|
BAN,
|
|
|
|
PICK,
|
|
|
|
GAME
|
|
|
|
};
|
|
|
|
|
|
|
|
State state = State::LOBBY;
|
|
|
|
|
|
|
|
void checkForGame();
|
2022-03-10 00:31:51 +01:00
|
|
|
void checkForBan();
|
2022-04-21 19:33:46 +02:00
|
|
|
void performClick(uint32_t nr, bool movemouseaway = true);
|
2022-03-06 01:00:19 +01:00
|
|
|
void enterSearch(const std::string& text);
|
|
|
|
void pickFirst(const std::string& search);
|
|
|
|
public:
|
|
|
|
LolAutoAccept();
|
2022-04-21 00:47:57 +02:00
|
|
|
~LolAutoAccept();
|
2022-03-06 01:00:19 +01:00
|
|
|
|
2022-03-08 00:04:56 +01:00
|
|
|
void setPrePick(const std::string& prePick);
|
|
|
|
void setBan(const std::string& ban);
|
|
|
|
void setPick(const std::string& pick);
|
2022-04-21 00:47:57 +02:00
|
|
|
void setAutoAcceptEnabled(bool b);
|
|
|
|
void setPrePickEnabled(bool b);
|
|
|
|
void setBanEnabled(bool b);
|
|
|
|
void setPickEnabled(bool b);
|
2022-03-08 00:04:56 +01:00
|
|
|
|
2022-04-20 00:54:10 +02:00
|
|
|
bool init(); // returns true on success
|
2022-03-06 01:00:19 +01:00
|
|
|
void run();
|
2022-04-20 00:54:10 +02:00
|
|
|
void stop();
|
2022-04-21 00:47:57 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void stopJoinThread();
|
|
|
|
void innerRun();
|
2022-03-06 01:00:19 +01:00
|
|
|
};
|