Mob appear code, problem with bot IQ

08/28/2009 23:27 Xorg#1
Hello,
I've got problem with my bot IQ. Sometimes he is trying to attack mobs on map that are not visible (used 2nd kal client to check it).
Sometimes he dont see the nearest mob near him. Especially when aggresive mobs attack my bot.

I've filtered the mob list and when X or Y are inproper like:
Code:
Mob: ID 19351432 X 233 Y 256555 Z 0 HP 207
Mob: ID 1483628888 X 16805481 Y 260840 Z 0 HP 3
Mob: ID 19298786 X -66 Y 257724 Z 0 HP 243
My function deletes this mobs from SMob structure.

I've also filtered the mob list from same IDs
Code:
Mob: ID 19302355 X 261352 Y 255760 Z 0 HP 207
Mob: ID 19302355 X 261352 Y 255760 Z 0 HP 207
Mob: ID 19302355 X 261352 Y 255760 Z 0 HP 207
Mob: ID 19724907 X 262477 Y 256524 Z 0 HP 314
Mob: ID 19655734 X 262432 Y 257649 Z 0 HP 168
Mob: ID 19655734 X 262432 Y 257649 Z 0 HP 168
Its my mob appear code:
PHP Code:
if (packet[2] == 0x33)
{

    for (
inti=0;i<500;i++)
    {
        
//check if x =0
        
if (Mob[i].== 0)
        {        
            
DWORD id;
            
memcpy((void*)&id,(void*)((DWORD)packet+3+2),4);
            
Mob[i].MID=id;
            
memcpy((void*)&(Mob[i].Classe),(void*)((DWORD)packet+3),2);
            
memcpy((void*)&(Mob[i].X),(void*)((DWORD)packet+3+4+2),4);
            
memcpy((void*)&(Mob[i].Y),(void*)((DWORD)packet+3+4+2+4),4);
            
memcpy((void*)&(Mob[i].HP),(void*)((DWORD)packet+3+4+2+4+4+1+1),2);


            for (
int j=0;j<500;j++)
            {
                if (
Mob[j].MID == Mob[i].MID && j!=i)
                {
                    
// Mob[j].MID=0;
                    
Mob[j].X=0// delete ;O
                    
printf("FAKE ID -> Mob Deleted\n");
                    
printf("Mob[%d].MID: %d x:%d\n",jMob[j].MIDMob[i].X);
                    
printf("Mob[%d].MID: %d x:%d\n\n",iMob[i].MIDMob[i].X);
                    
mobsx-=1;
                }
            }
        }
    }

My bot also uses this code:
PHP Code:
    if (Mob[i].!= && Mob[i].1000 playerx && Mob[i].X-1000 playerx &&  Mob[i].1000 playery && Mob[i].Y-1000 playery)
{
 
// mob is correct

Could you help me with your problem?

If it help, I can make video of my bot attacking.
08/29/2009 10:39 MoepMeep#2
Well, looks like you completly forgot about mob_move and mob_attack =P

Most ppl got the problem with attacking invisible mobs =P Adding a max time for killing a mob is probably the easiest way to fix it.
08/29/2009 14:12 Xorg#3
Forgot to mention. I've got also implemented mob_move code that works well ;).
What you mean by mob_attack? 0x3E?

I've got already max time for killing mob, but its annoying when my bot slows down.
08/29/2009 16:46 katze123#4
Quote:
Originally Posted by Xorg View Post
Forgot to mention. I've got also implemented mob_move code that works well ;).
What you mean by mob_attack? 0x3E?

I've got already max time for killing mob, but its annoying when my bot slows down.
he means your thread with attacking the monster..
08/29/2009 18:49 MoepMeep#5
Quote:
Originally Posted by Xorg View Post
Forgot to mention. I've got also implemented mob_move code that works well ;).
What you mean by mob_attack? 0x3E?

I've got already max time for killing mob, but its annoying when my bot slows down.
Not sure which header is the mob attack one, just sniff it.

And a max time for killing a mob won't slow down ur bot.
Do it like this:
Attack mob till dead OR timeover ;D
08/29/2009 18:59 syntex#6
0x3e = Mob attack (target that attacks you)!
08/29/2009 19:03 atlas95#7
Quote:
Originally Posted by MoepMeep View Post
Not sure which header is the mob attack one, just sniff it.
Yes its 0x3E, and better you do it like if packet[2]==0x3E
attack this mob first and if packet[]!=0x3E search for other packetheaders
like 0x24,mob move packet and so on (will protect your char and u will better ks other ppl so they leave your spot x)
08/29/2009 22:36 bluepoison638#8
soo many bots and none released...fail forum
08/30/2009 00:51 katze123#9
Quote:
Originally Posted by bluepoison638 View Post
soo many bots and none released...fail forum
you are the fail, leecher
08/30/2009 03:03 meak1#10
but with 0x3E it sucks i think, because if u dodge his attack u dont become a packet i think.
and bluepoison u sucks, make a thread for helping if u dont understand something and u have your own bot lOL
08/30/2009 10:26 MoepMeep#11
Even if you dodge, a mob_attack packet should be send to you, probably just the same with a different parameter =P

btw, anyone wanna send me a working source? Im too lazy :p
08/30/2009 10:55 katze123#12
nope moep, noone wants.

"if u dodge his attack u dont become a packet i think."
wenn du seiner attacke ausweicht wirst du kein packet xDDDDD
genau wie "i become a hamburger" XD

doch man bekommt ein packet.
08/30/2009 15:02 meak1#13
ja achne deutsches forum ftw