lolautoaccept/include/lolautoaccept.h

66 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include "scaleableinputs.h"
#include "screen.h"
#include "matcher.h"
#include <xinputsimulator.h>
2022-04-21 00:47:57 +02:00
#include <thread>
class LolAutoAccept {
private:
2022-04-20 00:54:10 +02:00
ScreenShot* screen = nullptr;
Matcher acceptmatcher;
Matcher arrowmatcher;
2022-03-10 00:31:51 +01:00
Matcher banmatcher;
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-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
enum class State {
LOBBY,
PREPICK,
BAN,
PICK,
GAME
};
State state = State::LOBBY;
void checkForGame();
2022-03-10 00:31:51 +01:00
void checkForBan();
void performClick(uint32_t nr);
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-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
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();
};