给点思路即可。现在如果点击开启打怪,它会自动打身边的怪,如果点寻路后,就只寻路不打怪了,如何保证在寻路的同时打怪呢?对DEPHI才接触23天,不熟,请路过的兄弟朋友们指点一下!!!给个思路即可 

解决方案 »

  1.   

    做个定时器了。打怪call和寻路call反复切换用...
      

  2.   

    切换吧
    用计时器,寻路一段时间后自动切换到打怪call,打怪call没对象了在换回寻路call
      

  3.   

    //以上代码实现了:有怪时打怪,但非得手动让游戏人物停(例如:鼠标点一下,此时游戏中人物会自动清除周围怪后寻路),无怪时可以寻路了
    //如何解决寻路计时器关掉后,人物游戏也停止呢?
    procedure TForm1.Auto_PlayMonTimer(Sender: TObject);
    var
     i,monNum:integer;
     curType:PByte;
     temp,temp2,temMonObj:dword;
     playBase,pt,curRole,pmonNum,curRoleX,curRoleY,curRoleLD,temp1:PDWORD;//^integer ^Dword;
     ws:pchar;
     s,tempStr,tempTypeStr,tempStr1:string;
    begin
        self.Memo2.Clear;
        playBase:=Pointer($63E7C4);
    playBase:=Pointer(playbase^+$5FB5C);
        pmonNum:=Pointer(playbase^+$8);//周围怪物数量
      playBase:=Pointer(playbase^+$4);
     for  i:=0 to pmonNum^-1 do
    begin
        try
    curRole:=Pointer(playBase^+i*4);//对象基址
          temMonObj:=curRole^;
          curType:=Pointer(curRole^+$e); //表示怪物类型
          if (curType^= 0) then continue;//如果是0,表示不是怪物
    if (curRole=nil) then continue;
    if (curRole^=0) then continue;
           pt:=Pointer(curRole^+$24); //表示名称指针
           curRoleLD:=Pointer(curRole^+$16); //最后一位为1生0死表示怪物生死
           curRoleX:=Pointer(curRole^+$E0); //表示怪物X坐标
           curRoleY:=Pointer(curRole^+$E4); //表示怪物Y坐标
           temp:=curRoleLD^;
           tempStr:=copy(IntToHex(temp,8),8,8);                begin
                       if (tempStr='0')   then //如果怪物是活的并且周围有怪时,则
                         begin
                         Auto_GoRoad.Enabled:=false;//有怪时关掉计时器
                         //但疑问是关掉计时器后人物寻路不会自动停止
                          ws:=Pointer(pt^);//表示名称
                    s:=strpas(ws);
                          self.Memo2.Lines.Add('怪物对象基址:'+IntToHex(curRole^,8)+'怪物名称:'+S+'怪物类型:'+IntToHex(curType^,8));
                          f1_f12(3,curRole^); //传入参数,3表示技能数组下标,curRole^表示怪物对象,调用技能打怪CALL
                         end
                    end;
        except
        continue;
        end;
    end;
        //此处判断周围是否无怪,无怪就寻路
        tempStr1:=self.Memo2.Text;
        if tempStr1='' then
        begin
               flag:=true;
              // goRoadMir($000000df,$00000165); //寻路函数
               Auto_GoRoad.Enabled:=true; //开启寻路计时器
        end;end;procedure TForm1.goRoadMir(x,y:DWORD);
      

  4.   

    能不能共享下你的call如果可以。最好能给发到[email protected]