I did it!
Code:
int mappointer=0x4AF478;
struct objectData{
int objectId;
int data1;
int data2;
};
struct tileDef {
int stack;
objectData Data[12];
int padding1;
int padding2;
};
tileDef map[2016];
void download_map(){
ReadProcessMemory(process, (LPVOID)Read(mappointer,4), map, sizeof(tileDef)*2016, NULL);
}
void search_myself(){
int me=Read(0x4A1244,4);
for(int i=0;i<2016;i++){
for(int e=0;e<map[i].stack;e++){
if(map[i].Data[e].objectId==99 && map[i].Data[e].data1==me){
MessageBox(NULL,"You Found Me!","Found!",MB_OK);
}
}
}
}
DWORD WINAPI map_thread(LPVOID args){
int id=0;
download_map();
search_myself();
Sleep(100);
return 0;
}
It founds me
But:
Code:
void download_map(){
ReadProcessMemory(process, (LPVOID)Read(mappointer,4), map, sizeof(tileDef)*2016, NULL);
}
void search_for(int id){
download_map();
// By This I know "int id" is wright
int me=Read(0x4A1244,4);
char buff[100];
itoa(id,buff,10);
char buf[100];
itoa(me,buf,10);
MessageBox(0,buff,buf,MB_OK);
//
for(int i=0;i<2016;i++){
for(int e=0;e<map[i].stack;e++){
if(map[i].Data[e].objectId==99){
MessageBox(NULL,"Creature","Found!",MB_OK);
if(map[i].Data[e].data1==id){
MessageBox(NULL,"You Found Your Target!","Found!",MB_OK);
goingto_z = i/(14*18);
goingto_y= (i-goingto_z*14*18)/18;
goingto_x=(i-goingto_z*14*18-goingto_y*18);
go(goingto_x-1,goingto_y,goingto_z);
}
}
}
}
}
Doesnt Works (No MessageBox appears). Why?