Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Little Console Bot - source code


Rekomendowane odpowiedzi

Opublikowano

Daje wam source do LCB (little console bot) do Tibii 8.6

Nie działa on jakoś znakomicie, ale to mój pierwszy "cheat" był (pisany w wakacje).

 

Jak działa ? Wszystko w tym bocie polega na operacjach w notatniku - tak, w notatniku. Odpalamy config i edytujemy wedle własnych upodobań. Następnie odpalamy plik EXE i cheat nam działa. Pamiętaj, aby najpierw zalogować się na postać. Jeśli chcemy dokonać zmian, wystarczy że zmienimy w notatniku dane i zapiszemy, bot automatycznie wczyta nowe dane.

 

Funkcje autohealth[hotkey], automana[hotkey], utamo vita[hotkey, zrobiona prowizorycznie bo nie miałem adresu]

 

main.cpp

 

 

#include "cheat.h"

int main()
{
BaseTibiaCheat bejs;
bejs.ParseConfig();
while(1)
{
 bejs.ParseConfig();
 bejs.BasicBot();
 Sleep(500);
}
return 0;
}

 

 

cheat.h

 

 

#include <iostream>
#include <string>
#include <Windows.h>
#include <ctime>
#include <vector>
using namespace std;
extern vector <string> fileLine;

extern DWORD AnaliseKey(string k);

class BaseTibiaCheat
{
private:
 DWORD processID;
 HWND hWnd;
 HANDLE hProcess;
 int currentMana, currentHp;
 int maxMana, maxHealth;
 short timeUtamo;
 int percentMana, percentHealth, manaCost;
 string ManaHotkey, HealthHotkey, UtamoHotkey, SpellHotkey;
 bool HealthRestore, ManaRestore, AutoUtamo, SpellSpam;
 string parseFile;
 int fileCount;
 bool loadConfig();
public:
 BaseTibiaCheat();
 ~BaseTibiaCheat();
 void ParseConfig();
 void BasicBot();
 void Potions();
 void AutoRotate();
};

 

 

Cheat.cpp

 

 

#include "cheat.h"
#include <fstream>
#include <cstdlib>
// <---ADDRESSESS--->
DWORD currMana = 0x0063FE78;
DWORD currHP = 0x0063FE94;
DWORD maxMP = 0x0063FE74;
DWORD maxHP = 0x0063FE90;
// <---END--->
vector <string> fileLine;
BaseTibiaCheat::BaseTibiaCheat()
{
hWnd = FindWindow(NULL, "Tibia");
if(!hWnd)
 cout << "Cannot found Tibia.exe\n";
else
 cout << "Tibia.exe [OK]\n";
GetWindowThreadProcessId(hWnd, &processID);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);

fileCount = manaCost = timeUtamo = 0;
ManaHotkey = HealthHotkey = UtamoHotkey, SpellHotkey = "";
percentHealth = percentMana = 121212;
ManaRestore = HealthRestore = AutoUtamo = SpellSpam = false;
}
BaseTibiaCheat::~BaseTibiaCheat()
{
}
bool BaseTibiaCheat::loadConfig()
{
string tmp;
fstream plik("config.txt", ios::in);
if(!plik)
{
 cout << "Cannot open config.txt \n";
 return false;
}
while(!plik.eof())
{
 getline(plik, parseFile);
 fileCount++;
 fileLine.push_back(parseFile);
}
plik.close();
return true;
}
void BaseTibiaCheat::ParseConfig()
{
size_t found;
string tmp = "";
int lenFile = 0;
if(!loadConfig())
 cout << "Error in loadConfig() function\n";
for(int i = 0; i < fileCount; i++)
{
 tmp = "";
 lenFile = fileLine[i].length();
 if(fileLine[i].find("manaUseHotkey") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 ManaHotkey = tmp;
 }
 else if(fileLine[i].find("healthUseHotkey") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 HealthHotkey = tmp;
 }
 else if(fileLine[i].find("utamoUseHotkey") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 UtamoHotkey = tmp;
 }
 else if(fileLine[i].find("spellUseHotkey") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 SpellHotkey = tmp;
 }
 else if(fileLine[i].find("healthRestorePercent") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 percentHealth = atoi(tmp.c_str());
 }
 else if(fileLine[i].find("manarestorePercent") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 percentMana = atoi(tmp.c_str());
 }
 else if(fileLine[i].find("ManaSpellCost") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 manaCost = atoi(tmp.c_str());
 }
 else if(fileLine[i].find("HealRestore") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 if(tmp[0] == 'O' && tmp[1] == 'N')HealthRestore = true;
	 else HealthRestore = false;
 }
 else if(fileLine[i].find("ManaRestore") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 if(tmp[0] == 'O' && tmp[1] == 'N')ManaRestore = true;
	 else ManaRestore = false;
 }
 else if(fileLine[i].find("AutoUtamo") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 if(tmp[0] == 'O' && tmp[1] == 'N')AutoUtamo = true;
	 else AutoUtamo = false;
 }
 else if(fileLine[i].find("SpellSpam") != string::npos)
 {
	 found = fileLine[i].find("=");
	 for(int j = int(found)+1; j <= lenFile; j++)
		 tmp += fileLine[i][j];
	 if(tmp[0] == 'O' && tmp[1] == 'N')SpellSpam = true;
	 else SpellSpam = false;
 }
}
}
DWORD AnaliseKey(string k)
{
if(k[1] == '1' && k[2] == 0)
 return VK_F1;
else if(k[1] == '2' && k[2] == 0)
 return VK_F2;
else if(k[1] == '3' && k[2] == 0)
 return VK_F3;
else if(k[1] == '4' && k[2] == 0)
 return VK_F4;
else if(k[1] == '5' && k[2] == 0)
 return VK_F5;
else if(k[1] == '6' && k[2] == 0)
 return VK_F6;
else if(k[1] == '7' && k[2] == 0)
 return VK_F7;
else if(k[1] == '8' && k[2] == 0)
 return VK_F8;
else if(k[1] == '9' && k[2] == 0)
 return VK_F9;
else if(k[1] == '1' && k[2] == '0')
 return VK_F10;
else if(k[1] == '1' && k[2] == '1')
 return VK_F11;
else if(k[1] == '1' && k[2] == '2')
 return VK_F12;
return -1;
}
void BaseTibiaCheat::Potions()
{
if(HealthRestore)
{
 if((currentHp*100/maxHealth) <= percentHealth)
 {
	 SendMessage(hWnd,WM_KEYDOWN,AnaliseKey(HealthHotkey),0);
	 SendMessage(hWnd,WM_KEYUP,AnaliseKey(HealthHotkey),0);
 }
}
if(ManaRestore)
{
 if((currentMana*100/maxMana) <= percentMana)
 {
	 SendMessage(hWnd,WM_KEYDOWN,AnaliseKey(ManaHotkey),0);
	 SendMessage(hWnd,WM_KEYUP,AnaliseKey(ManaHotkey),0);
 }
}
}
void BaseTibiaCheat::BasicBot()
{
ReadProcessMemory(hProcess, (void*)currMana, &currentMana, sizeof(currentMana), 0);
ReadProcessMemory(hProcess, (void*)currHP, &currentHp, sizeof(currentHp), 0);
ReadProcessMemory(hProcess, (void*)maxHP, &maxHealth, sizeof(maxHealth), 0);
ReadProcessMemory(hProcess, (void*)maxMP, &maxMana, sizeof(maxMana), 0);
cout << "Mana: " << currentMana << "/" << maxMana << "\n";
cout << "Health: " << currentHp << "/" << maxHealth << "\n";
cout << "Spell mana cost: " << manaCost << "\n";

if(AutoUtamo)
{
 if(timeUtamo == 0 || timeUtamo > 95)
 {
	 SendMessage(hWnd,WM_KEYDOWN,AnaliseKey(UtamoHotkey),0);
	 SendMessage(hWnd,WM_KEYUP, AnaliseKey(UtamoHotkey),0);
	 timeUtamo = 1;
 }
}
timeUtamo++;
if(SpellSpam)
{
 if(manaCost <= currentMana)
 {
	 SendMessage(hWnd,WM_KEYDOWN,AnaliseKey(SpellHotkey),0);
	 SendMessage(hWnd,WM_KEYUP,AnaliseKey(SpellHotkey),0);
 }
}
Potions();
}

 

 

A tutaj config.txt:

 

 

<----LITTLE CONSOLE BOT v 2.0 !---->
Created by Frozen0x0(others Frozen0x0 nicks: Layflette, Czlowiek, 3dzio, Spiewak,
iLikeGood)
Contact: 3dzio (tibia.net.pl), Frozen0x0(youtube), Czlowiek(forum.tibia.tv), Spiewak
(otfans.net), iLikeGood (mpcforum)
<------hotkeys to use mana/health/spells------->
manaUseHotkey=F8
healthUseHotkey=F1
utamoUseHotkey=F2
spellUseHotkey=F6
<------health and mana restore------->
// how many percent health to use hotkey
healthRestorePercent=95
manarestorePercent=95
<----base tibia cheat option---->
HealRestore=ON
ManaRestore=ON
AutoUtamo=ON
SpellSpam=OFF
ManaSpellCost=1500
<-----------END----------->

 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...