[Hilfe] Packets Mob Walk

05/28/2009 09:57 Doofy#1
Hello all,
after arround 4-5 Hours of hard learning, my bot works very simple.
Now i try to fix, that my Bot beheads all died mobs arround me...
There should be something like a range arround 50.
For Pick, it works. difference between x,y and some math ^^.

After a Mobs spawn / apear, i get x,y coords. But they walk arround. And thats the Problem. I recive 1 Packet (for exampe: Mob move: x=2 y=4) 3-4 times. How can i fix that problem?
My Try:
PHP Code:
if(lastMoveId!=id || lastMoveX != || lastMoveY != y//|| GetTickCount()< (lastMoveTime+150)) 
but i think i miss / count to much or less packets.

after getting aggro, i run around a little bit, kill the mob nearly me, and difference x is arround 8000

... Hope u can understand my english
05/28/2009 10:57 kalhacker9000#2
why you don't do it with target behead? oO
sniff the mobid which you attack, then check if the died mob == target and then send the beheadpacket.
05/28/2009 11:33 cheater-.-#3
i think his problem is, that he gets the right coordinates for a mob, if he spawns.

but if the mob walks around, the packet, that the mob walks is recieved more than once.
if u add all movements of the mob, u get the wrong coordinate because some packets are recieved too much..

that is my problem, too. but i dont want to behead, i want to walk to a mob.. but i cant walk to the right position ^^
05/28/2009 12:33 Doofy#4
Quote:
Originally Posted by kalhacker9000 View Post
why you don't do it with target behead? oO
sniff the mobid which you attack, then check if the died mob == target and then send the beheadpacket.
ill try a splashybot.. but i dont want to behead alls mobs in d1 ^^. Only mobs arround me.

so i have no "targetmob"
05/28/2009 13:02 katze123#5
Quote:
Originally Posted by Doofy View Post
Hello all,
after arround 4-5 Hours of hard learning, my bot works very simple.
Now i try to fix, that my Bot beheads all died mobs arround me...
There should be something like a range arround 50.
For Pick, it works. difference between x,y and some math ^^.

After a Mobs spawn / apear, i get x,y coords. But they walk arround. And thats the Problem. I recive 1 Packet (for exampe: Mob move: x=2 y=4) 3-4 times. How can i fix that problem?
My Try:
PHP Code:
if(lastMoveId!=id || lastMoveX != || lastMoveY != y//|| GetTickCount()< (lastMoveTime+150)) 
but i think i miss / count to much or less packets.

after getting aggro, i run around a little bit, kill the mob nearly me, and difference x is arround 8000

... Hope u can understand my english
lastmoveid!=id ... so if the mob moves again, it wont be recorded, delete that thing... because we can say:
Mob1 moves 3x and 2y
Mob1 moves -3x and 5y
-> same mobid... so delete "lastmoveid!=id"...
05/28/2009 13:18 meak1#6
the same thread started here again, w8 i search thread

EDIT: i have it ^^

PHP Code:
if(prevxplayer!=|| prevyplayer != || prevPID!=Player[i].PID)
                {
                
prevxplayer=x;
                
prevyplayer=y;
                
prevPID=Player[i].PID;

                
Player[i].X+=x;
                
Player[i].Y+=y;
                
Player[i].Z+=z;
                } 
the same u can make with mobs ;>
05/28/2009 14:09 Doofy#7
Quote:
Originally Posted by katze123 View Post
lastmoveid!=id ... so if the mob moves again, it wont be recorded, delete that thing... because we can say:
Mob1 moves 3x and 2y
Mob1 moves -3x and 5y
-> same mobid... so delete "lastmoveid!=id"...
if id is the same, but x or y is different it execute the if-block..

@meak1 danke. ist doch genau das was ich auch mach oder?
gibt nicht irgendwie eine id, die mitgesendet wird? kal-client muss es ja auch erkennen... ich sniff nochmal mit. vllt finde ich ja sowas


edit:
PHP Code:
for (int i=0;i<500;i++)
        {
            if (
mob[i].MID == id)
            {
                
signed char x,y;
                
memcpy((void*)&(x),(void*)((DWORD)buf2+3+4),1);
                
memcpy((void*)&(y),(void*)((DWORD)buf2+3+4+1),1);
                
//if(debug==0) { printf("Mob move, old:ID:%d x%d y%d\n",lastMoveId,lastMoveX,lastMoveY); }
                
                
if(lastMoveId!=id || lastMoveX != || lastMoveY != y//|| GetTickCount()< (lastMoveTime+150))
                
{
                    if(
debug==1) { printf("Mob move, change:ID:%d x%d y%d\n",id,x,y); }
                    
mob[i].X+= (lastMoveX=x);
                    
mob[i].Y+= (lastMoveY=y);
                    
lastMoveId=id;                            
                }
                else { if(
debug==1) {printf("dropped: ID:%d x%d y%d\n",id,x,y); } }
                break;
            }
        } 
ich verlier oder zähl immernoch doppelt...
05/28/2009 15:34 meak1#8
PHP Code:
if(PrevMobx!=|| PrevMoby != || PrevMID!=Mob[i].MID)
                {
                
PrevMobx=x;
                
PrevMoby=y;
                
PrevMID=Mob[i].MID;

                
Mob[i].X+=x;
                
Mob[i].Y+=y;
                } 
05/29/2009 15:44 katze123#9
und was ist wenn sich ein mob 2 ma hintereinander bewegt? >.>
05/29/2009 15:48 meak1#10
es läuft glaube nie gleich glaube ;O X: +1 Y:+1 > X: +2 Y:+1 bin mir nich 100% sicher aber wenn ichs so mache läuft er immer richtig zum mob...
05/29/2009 16:12 katze123#11
nein.. ich meine wenn einfach das selbe mob rennt.. also ID bleibt gleich, xy nich...
d.h. dann ja dass er das auch nich zählt :P
05/29/2009 17:09 meak1#12
ja als ob ich dich nich verstehe^^ ich meinte nur der mob läuft nicht immer gleich große schritte zu dir glaube ich aber wie gesagt nich 100% sicher , aber es klappt damit super also er läuft eig. immer richtig zum mob ;O
05/29/2009 17:25 cheater-.-#13
Quote:
Originally Posted by meak1 View Post
PHP Code:
if(PrevMobx!=|| PrevMoby != || PrevMID!=Mob[i].MID)
                {
                
PrevMobx=x;
                
PrevMoby=y;
                
PrevMID=Mob[i].MID;

                
Mob[i].X+=x;
                
Mob[i].Y+=y;
                } 
wtf.. irgendwie lese ich die mobbewegung immernoch falsch mit..ich habe mehreres ausprobiert.. aber manche mobs stehen bei mir anders, als sie wirklich stehen .. wäre es sinnvoll die if-abfrage zu verändern:
PHP Code:
if((PrevMobx!=|| PrevMoby != y) && PrevMID!=Mob[i].MID)
{...} 
somit ollte ich ja nurnioch die bewegungen mitschreiben, die NICHT doppelt kommen, denn es muss eine bewegungsrichtung (x oder y) unterschiedlich sein UND die mobid darf nicht die selbe sein..

stimmt meine überlegung?!.. oder logge ich so wieder doppelte bewegungen oder so mit?.. bitte helfen :)
05/29/2009 23:02 cheater-.-#14
*push*
ich hba eine funktion mobMovement.. aber ich bekomme nicht hin, dass ich richtig das Laufen der Mobs mitlogge.. wenn ich dan den mob, der am nähsten bei mir ist attacken wil lande ich immer bei nem falschen..
PHP Code:
void mobMovement(){
    
DWORD id;
    
DWORD x,y;
    
memcpy((void*)&id,(void*)((DWORD)buf2+3),4);
    
memcpy((void*)&(x),(void*)((DWORD)buf2+3+4),1);
    
memcpy((void*)&(y),(void*)((DWORD)buf2+3+4+1),1);
    if((
prevMobx!=|| prevMoby != y) || prevMID!=id){
              
//Mob in meinem Array finden und aktualisieren
        
}

liege ich da so richtig? zu info: prevMob* und prevMID sind globale variablen und werden bei jedem aktualisieren der daten gescheichert .. durch die if abfrage soll das doppelte aktualisieren von einträgen verhindert werden..
05/30/2009 00:17 katze123#15
PHP Code:
if(PrevMobx!=|| PrevMoby != y/* || PrevMID!=Mob[i].MID*/)
                {
                
PrevMobx=x;
                
PrevMoby=y;
            
//    PrevMID=Mob[i].MID;

                
Mob[i].X+=x;
                
Mob[i].Y+=y;
                } 
Machs so...
Denn: Stell dir vor du siehst nur ein monster. Es bewegt sich, sagen wir es hat die ID 123.
Und da bewegt es sicher wieder! aber was ist? es wird nicht gerechnet. Warum? Weil die gleiche ID sich bewegt. Also rausdamit.
2. Fall.
Es gibt 2 Mobs.
Eins bewegt sich mit x5 y4.
Das zweite bewegt sich nun mit x5 y-3.
Huch, die x5 sind gleich. Es wird wieder nichts gerechnet.
=> Speicher für jedes Mob den vorherigen schritt, nicht für alle allgemein.
... Mehr tips geb ich nicht ;]

p.s.
3. Fall:
2 Mobs vorhanden.
1. Mob bewegt sich mit x5 y4.
2. mit ---------------- x3 y4.
Das ist nicht derselbe schritt, aber er würde nach dem obigen code nich berechnet werden. also mach aus dem || ein && .
Also sodass prevx und prevy gleich sein müssen, damits nich berechnet wird.

hoffe das reicht... sonst schreib mir ne PN...