Du musst schaun an welcher Stelle auf dem Monitor welche Farbe existiert und wieviel Leben du dann noch hast.
Wenn du dir den Punkt für fast 0% Leben und den Punkt für 100% Leben holst dürfte es ein leichtes sein damit die aktuellen Lebenspunkte zu ermitteln
Schau dir halt den Code an ist ja Open Source.
In der DLL sind ja Die Funktionen definiert.
Code:
int FindPixel(int width, int height, int pixelR, int pixelG, int pixelB) {
COLORREF pixel;
HDC dc;
for(int x = 0; x < width; x++) {
for(int y = 0; y < height; y++) {
pixel = GetPixel(dc, x, y);
if((GetRValue(pixel) == pixelR) &&
(GetGValue(pixel) == pixelG) &&
(GetBValue(pixel) == pixelB)) {
return x, y;
} else {
return NULL, NULL;
}
}
}
}
Wie du siehst gibt die Funktion die Koordinaten des Pixels
zurück mit der vorher als Paramter übergeben Farbe.
Halt als x,y werte.
PS:
Ich fände es toll wenn die epvp coder Sektion sowas ähnliches
starten würde.
Halt jeder gibt seinen Senf (Funktion) dazu und das wird nachher ne
riesige Bot Tools dll.
Huh?
Geht das wirklich?
Eine Funktion gibt einen dopellten return wert zurück und du speicherst
ihn in 2 Int Variablen? Wusste nicht das das geht muss ich mal austesten.
Achja schau dir die Funktion nochmal genau an .
Er scannt glaube ich von rechts unten nach links oben.
D.h er hat halt an 2/0 einen passenden Punkt gefunden.
Du machst nichts falsch ! (Glaube ich :P)
Oder wie gesagt die dopellte int zuweisung der return werte der Funktion klappt nicht
und teilt nur dem ersten wert einen wert zu also in deinem Falle x.
Teste es einfach mal aus setzt y mal nach vorne...
MfG,
CracKPod
PS:
Ich glaube Sleep(1000) ist keine so gute idee oder?
Weil das Programm dann ziemlich stocken sollte afaik.
EDIT:
So habs getestet, sorry für den unsauberen Code (falls er es ist)
Code:
#include <iostream>
using namespace std;
int add(int a,int b,int c,int d);
int main (void)
{
int x,y;
x,y = add(5,5,10,10);
cout << "test1: " << x << "ntest2: " << y; // Der Schrägstrich für die Escape Sequenz verschwindet in den code tags @_@!
cin.get();
cin.get();
}
int add(int a,int b,int c,int d)
{
int x,y;
x=a+b;
y=a+b;
return x,y;
}
Das ergebnis lautet:
test1: 2
test2: 10
Also wie du siehst nicht das erwartet wird.
D.h du könntest dich jetzt mit struct befassen (Ich kann es selber nicht)
oder du schreibst die funktion um.
Ich muss mal schauen ob ich das kann/lust habe.
*Edit* I apologize for my bad mood.
You should better remove small wrapper functions like GetCursorX / Y because GetCursorPos is almost the same and doesn't require multiple calls to GetCursorPos.
You call this piece of *censored* a bot api ?
It's just a bunch of functions. If you would attach a .cpp / .h file to your post, then someone could learn something from it but this is just ****.
//flame
U are the piece of **** here - my friend! .
I hate people who are acting like Smartasses (You).
U didnt even read the source and call this Library a piece of ****.
Im just somehow sure u cant do better.
Ahh
And for the attribute "****" u got **** in ur brain for NOT Readin the first post.
//flame
1. It isnt written in C++ most likely in LUA , isnt it?
2. I wont just thorugh things in the room like "It´s a fake and so on"
3. I believe u thats its possible to do that but since
4. its LUA are u really able to activate a Speedhack Ingame?
5. I mean how do u do call these functions up with just LUA.
I noticed that u got some c++ skills in ur other posts so i wont say its a fake
but please stop just saying its bullcrap - sine u already apologized im srry
aswell.
MfG,
CracKPod (Warum reden wir nicht deutsch -.-?)
int foo(int a,int b) { int x=a+b; int y=a-b; return x,y; }
int x,y;
x,y=foo(1,2);
ist absolut unsauber. Da hat jemand zuviel LUA programmiert. Tatsächlicherweise ist x in diesem Falle GAR NICHT initialisiert, und hat einen Zufallswert (der vorher so auf dem Platz im Stackframe vorhanden war).
Saubere Lösungen:
void foo(int a, int b, int& x,int& y) { x=a+b; y=a-b; }
int x,y;
foo(1,2,x,y);
oder:
struct XY { int x,int y };
void foo(int a,int b,XY& result) { result.x=a+b; result.y=a-b; }
XY xy;
foo(1,2,xy);