- Moderatör
- #1
aka panic.rs
Kurucu
Gerekli bindler :
/*
Script
bind "kp_0" "dota_cycle_selected" // sonraki meepo
bind "kp_1" "dota_cycle_prev_selected" // önceki meepo
*/
boş vaktimde yapmıştım belki ilginizi çeker diye paylaşayım dedim.
/*
Script
bind "kp_0" "dota_cycle_selected" // sonraki meepo
bind "kp_1" "dota_cycle_prev_selected" // önceki meepo
*/
C++:
// MeepoCPPSpace.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#pragma comment(lib, "Winmm.lib")
using namespace std;
/*
Script
bind "kp_0" "dota_cycle_selected" // sonraki meepo
bind "kp_1" "dota_cycle_prev_selected" // önceki meepo
*/
LSKeySim sim;
struct Binds {
std::string name;
int key;
};
Binds binds[] =
{
{"copy_meepo",VK_F2},
{ "real_meepo" , VK_F1 },
{ "next_meepo" , 0x60 },
{ "prev_meepo" , 0x61 },
{ "poof_meepo" , 'W' },
{ "earth_meepo" , 'Q' },
{ "stop_meepo" , 'S' },
{"dagger_cast",0x31} // slot 1
};
class BindManager
{
public:
static int bKey(std::string name)
{
for (size_t i = 0; i < sizeof(binds) / sizeof(binds[0]); i++)
{
if (binds[i].name == name)
return binds[i].key;
}
}
static void KeyPressAndRelease(std::string key)
{
auto size = sizeof(binds) / sizeof(binds[0]);
auto keyid = bKey(key);
sim.SendKey(keyid);
}
private:
};
class MeepoSpace
{
public:
//bind "kp_0" "dota_cycle_selected;";bind "kp_1" "dota_cycle_prev_selected;"
int m_Count_Clone = 0,m_Count = 0;
bool check()
{
return sim.hwnd == GetForegroundWindow();
}
void setCount(int i)
{
m_Count_Clone = i > 0? i - 1 : 0;
m_Count = i;
printf("SetMeepo's : %d\n", m_Count_Clone);
char Rexy[255];
sprintf(Rexy, "%dmeepo.wav", m_Count_Clone);
sndPlaySound(Rexy, SND_FILENAME | SND_ASYNC);
}
void stop()
{
BindManager::KeyPressAndRelease("stop_meepo");
}
void real()
{
BindManager::KeyPressAndRelease("real_meepo");
}
void next()
{
BindManager::KeyPressAndRelease("next_meepo");
}
void prev()
{
BindManager::KeyPressAndRelease("prev_meepo");
}
void poof()
{
BindManager::KeyPressAndRelease("poof_meepo");
}
void earth()
{
BindManager::KeyPressAndRelease("earth_meepo");
}
void realTolast()
{
real();
/*
0 = real
1
2
3
4
*/
for (size_t i = 0; i < m_Count_Clone; i++)
next();
}
void lastToreal()
{
realTolast();
/*
0 = real
1
2
3
4 = last
*/
for (size_t i = 0; i < m_Count_Clone; i++)
prev();
}
void combo()
{
realTolast();
for (size_t i = 0; i < m_Count_Clone; i++)
{
poof();
prev();
}
real();
}
void cancel()
{
realTolast();
for (size_t i = 0; i < m_Count_Clone; i++)
{
stop();
prev();
}
real();
}
void daggerFast_Combo()
{
daggerTick = GetTickCount();
realTolast();
for (size_t i = 0; i < m_Count_Clone; i++)
{
poof();
prev();
}
real();
while (GetTickCount() - daggerTick < 1400 /*1.5 Channel time + hepsi aynı anda castlendigi için hepsi 1.5 saniye sürüyo 6 saniye değil avel */)
{
}
printf("Dagger Casted - tick : %d\n", GetTickCount() - daggerTick);
BindManager::KeyPressAndRelease("dagger_cast");
daggerTick = GetTickCount();
}
void EarthBind_Combo(int sleep)
{
realTolast();
for (size_t i = 0; i < m_Count_Clone; i++)
{
earth();
prev();
}
real();
}
// KOMBOLAR
private:
DWORD daggerTick;
};
class MeepoSpace_v2
{
public:
//bind "kp_0" "dota_cycle_selected;";bind "kp_1" "dota_cycle_prev_selected;"
int m_Count_Clone = 0, m_Count = 0;
bool check()
{
return sim.hwnd == GetForegroundWindow();
}
void stop()
{
BindManager::KeyPressAndRelease("stop_meepo");
}
void real()
{
BindManager::KeyPressAndRelease("real_meepo");
}
void next()
{
BindManager::KeyPressAndRelease("next_meepo");
}
void prev()
{
BindManager::KeyPressAndRelease("prev_meepo");
}
void poof()
{
BindManager::KeyPressAndRelease("poof_meepo");
}
void earth()
{
BindManager::KeyPressAndRelease("earth_meepo");
}
void select_copyMeepos()
{
BindManager::KeyPressAndRelease("copy_meepo");
}
void combo()
{
select_copyMeepos();
for (size_t i = 0; i < 5; i++)
{
poof();
prev();
}
real();
}
void cancel()
{
select_copyMeepos();
for (size_t i = 0; i < 5; i++)
{
stop();
prev();
}
real();
}
void daggerFast_Combo()
{
daggerTick = GetTickCount();
select_copyMeepos();
for (size_t i = 0; i < 5; i++)
{
poof();
prev();
}
real();
while (GetTickCount() - daggerTick < 1400 /*1.5 Channel time + hepsi aynı anda castlendigi için hepsi 1.5 saniye sürüyo 6 saniye değil avel */)
{
}
printf("Dagger Casted - tick : %d\n", GetTickCount() - daggerTick);
BindManager::KeyPressAndRelease("dagger_cast");
daggerTick = GetTickCount();
}
void EarthBind_Combo(int sleep)
{
select_copyMeepos();
for (size_t i = 0; i < 5; i++)
{
earth();
prev();
}
real();
}
// KOMBOLAR
private:
DWORD daggerTick;
};
DWORD dtick = 0;
bool IsKeyDown(int vKey)
{
auto kstate = GetAsyncKeyState(vKey);
if (kstate < 0 && GetTickCount() - dtick > 150)
{
dtick = GetTickCount();
return true;
}
return false;
}
int main()
{
SetConsoleTitleA("meepo'space");
sim.init();
MeepoSpace_v2 meepoV2;
MeepoSpace meepo;
meepo.setCount(5);
while (true)
{
if (!meepo.check())
{
Sleep(100);
continue;
}
if (IsKeyDown(VK_INSERT))
meepo.setCount(2);
if (IsKeyDown(VK_HOME))
meepo.setCount(3);
if (IsKeyDown(VK_PRIOR) )
meepo.setCount(4);
if (IsKeyDown(VK_DELETE))
meepo.setCount(5);
if (IsKeyDown(VK_END) )
meepo.setCount(6);
if (IsKeyDown('V') )
{
printf("daggerFast_Combo \n");
meepoV2.daggerFast_Combo();
}
if (IsKeyDown('C'))
{
printf("EarthBind_Combo \n");
meepoV2.EarthBind_Combo(500);
}
if (IsKeyDown('X') )
{
printf("Poof Combo \n");
meepoV2.combo();
}
if (IsKeyDown('Z'))
{
printf("Stop All \n");
meepoV2.cancel();
}
Sleep(10);
}
return 0;
}
C++:
#pragma once
class LSKeySim
{
public:
DWORD FindProcessId(const std::string & processName)
{
PROCESSENTRY32 processInfo;
processInfo.dwSize = sizeof(processInfo);
HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (processesSnapshot == INVALID_HANDLE_VALUE)
return 0;
Process32First(processesSnapshot, &processInfo);
if (!processName.compare(processInfo.szExeFile))
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}
while (Process32Next(processesSnapshot, &processInfo))
{
if (!processName.compare(processInfo.szExeFile))
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}
}
CloseHandle(processesSnapshot);
return 0;
}
void init()
{
do
{
pid = FindProcessId("dota2.exe");
hwnd = FindWindowA("SDL_app", 0);
} while (pid == 0 && hwnd == 0);
hThread = GetWindowThreadProcessId(hwnd, NULL);
}
void SendKey(int key2)
{
INPUT key;
memset(&key, 0, sizeof(INPUT));
key.type = INPUT_KEYBOARD;
key.ki.dwExtraInfo = GetMessageExtraInfo();
key.ki.wScan = static_cast<WORD>(MapVirtualKeyEx(key2, MAPVK_VK_TO_VSC, GetKeyboardLayout(0)));
key.ki.dwFlags = KEYEVENTF_SCANCODE;
SendInput(1, &key, sizeof(INPUT));
Sleep(5);
key.ki.dwExtraInfo = GetMessageExtraInfo();
key.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
SendInput(1, &key, sizeof(INPUT));
}
HWND hwnd = 0;
private:
DWORD hThread;
DWORD pid =0;
};
boş vaktimde yapmıştım belki ilginizi çeker diye paylaşayım dedim.