⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wgface.pas

📁 网络游戏神迹脱机外挂PASCAL源码
💻 PAS
字号:
unit wgFace;
{---------无影开发小组敬告:-------------------}
{        外挂研究无罪,开放源码有理!           }
{ 希望以此献给各位想研究外挂的朋友一窥外挂之容 }
{    本代码只供研究之用,不得用于非法用途      }
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, LoopAttack, Move, WorkThread, ExtCtrls, UnitState,
  SendPack, Buttons,GameCode,PackStruct;

type
  TPopForm = class(TForm)
    Page1: TPageControl;
    Timer1: TTimer;
    TabSheet2: TTabSheet;
    TabSheet4: TTabSheet;
    TabSheet5: TTabSheet;
    GroupBox1: TGroupBox;
    GroupBox20: TGroupBox;
    CheckBox5: TLabel;
    eAutoMagic: TComboBox;
    eAutoMagicGap: TEdit;
    UpDown2: TUpDown;
    Check30: TCheckBox;
    Check65: TCheckBox;
    eAutoReply: TComboBox;
    Check67: TCheckBox;
    edAutoSay: TEdit;
    Label8: TLabel;
    UpDown1: TUpDown;
    Label9: TLabel;
    Check68: TCheckBox;
    Check69: TCheckBox;
    Check70: TCheckBox;
    Check71: TCheckBox;
    AutoSayMemo: TMemo;
    GroupBox7: TGroupBox;
    Check72: TCheckBox;
    Check73: TCheckBox;
    Check74: TCheckBox;
    Check75: TCheckBox;
    Check76: TCheckBox;
    Check77: TCheckBox;
    Label11: TLabel;
    cmFriends: TComboBox;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    Check78: TCheckBox;
    Check79: TCheckBox;
    SpeedButton12: TSpeedButton;
    SpeedButton11: TSpeedButton;
    SpeedButton10: TSpeedButton;
    cmEnemy: TComboBox;
    Label10: TLabel;
    Label13: TLabel;
    cmBlacks: TComboBox;
    SpeedButton4: TSpeedButton;
    SpeedButton5: TSpeedButton;
    SpeedButton6: TSpeedButton;
    TabSheet6: TTabSheet;
    Check81: TCheckBox;
    Check80: TCheckBox;
    Bevel1: TBevel;
    BtnClearChatHistory: TSpeedButton;
    MemoNoteBook: TMemo;
    Label12: TLabel;
    Check1: TCheckBox;
    TabSheet8: TTabSheet;
    TabSheet9: TTabSheet;
    GroupBox13: TGroupBox;
    ItemsListView: TListView;
    GroupBox14: TGroupBox;
    BtnAddBoss: TSpeedButton;
    BtnDelBoss: TSpeedButton;
    EditAddBoss: TEdit;
    BossListView: TListView;
    Check82: TCheckBox;
    AutoSayTimer: TTimer;
    BtnStopAtk: TButton;
    CBAutoAtk: TCheckBox;
    CBAutoMagic: TCheckBox;
    CBMagicName: TComboBox;
    Label7: TLabel;
    EdtMagicDelay: TEdit;
    GBGoRound: TGroupBox;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    EdtY1: TEdit;
    EdtX1: TEdit;
    EdtX2: TEdit;
    EdtY2: TEdit;
    CBGoRound: TCheckBox;
    BtnStopGoR: TButton;
    GroupBox2: TGroupBox;
    CBAutoAddHp: TCheckBox;
    CBAutoAddMp: TCheckBox;
    CBMpPotion: TComboBox;
    CBHpPotion: TComboBox;
    EdtHPMin: TEdit;
    EdtMpMin: TEdit;
    Check13: TCheckBox;
    Edit2: TEdit;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    Button1: TButton;
    ComboBox1: TComboBox;
    AutoSkillTimer: TTimer;
    CheckStatTimer: TTimer;
    ChatHistory: TMemo;
    Label1: TLabel;
    Label2: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Memo1: TMemo;
    Label16: TLabel;
    GroupBox5: TGroupBox;
    Check59: TCheckBox;
    procedure CBAutoAddHpClick(Sender: TObject);
    procedure BtnStopAtkClick(Sender: TObject);
    procedure CBGoRoundClick(Sender: TObject);
    procedure CBAutoAddMpClick(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure BtnClearChatHistoryClick(Sender: TObject);
    procedure AutoSayTimerTimer(Sender: TObject);
    procedure edAutoSayChange(Sender: TObject);
    procedure CheckStatTimerTimer(Sender: TObject);
    procedure AutoSkillTimerTimer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PopForm: TPopForm;
  SayFlag:Boolean=False;
  GameWindow2:HWND;//游戏窗口句柄
implementation

{$R *.dfm}

procedure TPopForm.CBAutoAddHpClick(Sender: TObject);
var
HPMin:Integer;
begin
if EdtHpMin.ReadOnly=false then
  begin
    try
      HPMin:=StrToInt(EdtHPMin.Text);
    except
    on EConvertError do
      begin
      ShowMessage('HP下限:请输入一个整数.');
      EdtHPMin.Text:='0';
      CBAutoAddHp.Checked:=false;
      exit;
      end;
    end;
    EdtHpMin.ReadOnly:=true;
    HpMinAdd:=HPMin;
    HpAddPotion:=CBHpPotion.Text;
  end
else
  begin
  EdtHpMin.ReadOnly:=false;
  end;
end;

procedure TPopForm.BtnStopAtkClick(Sender: TObject);
begin
StopAtk;
end;

procedure TPopForm.CBGoRoundClick(Sender: TObject);
var
x1,y1,x2,y2:Integer;
begin
if CBGoRound.Checked=true then
  begin
    try
    x1:=StrToInt(EdtX1.Text);
    y1:=StrToInt(EdtY1.Text);
    x2:=StrToInt(EdtX2.Text);
    y2:=StrToInt(EdtY2.Text);
    except
    On EConvertError do
      begin
      ShowMessage('非法坐标,请重新设定');
      exit;
      end;
    end;
    PatrolPA.X:=x1;
    PatrolPA.Y:=y1;
    PatrolPB.X:=x2;
    PatrolPB.Y:=y2;
    SetTFlag(3);
  end
else
  begin
  MoveStop;
  SetTFlag(0);
  end;
end;

procedure TPopForm.CBAutoAddMpClick(Sender: TObject);
var
MPMin:Integer;
begin
if EdtMpMin.ReadOnly=false then
  begin
    try
      MPMin:=StrToInt(EdtMPMin.Text);
    except
    on EConvertError do
      begin
      ShowMessage('MP下限:请输入一个整数.');
      EdtMPMin.Text:='0';
      CBAutoAddMp.Checked:=false;
      exit;
      end;
    end;
    EdtMpMin.ReadOnly:=true;
    MpMinAdd:=MPMin;
    MpAddPotion:=CBMpPotion.Text;
  end
else
  begin
  EdtMpMin.ReadOnly:=false;
  end;
end;

procedure TPopForm.Timer1Timer(Sender: TObject);
var
MIndex : Integer  ;
MPos   : PosPoint ;
MId    : DWORD    ;
i,cnt,n: Integer  ;
MinD   : Integer  ;
delay  : Integer  ;
begin
try
  delay:=StrToInt(EdtMagicDelay.Text);
except on EConvertError do
    begin
    ShowMessage('无效间隔时间');
    delay:=3000;
    end;
  end;
Timer1.Interval:=delay;

cnt:=MstList1.GetCnt;
if (cnt=0) or (CBAutoMagic.Checked=false) then
  begin
  exit;
  end;
MinD:=1000;
MIndex:=0;
for i:=0 to cnt-1 do
  begin
  MPos:=MstList1.GetMstPos(i);
  n:=GetDist(CharPos,MPos);
  if n<MinD then
    begin
    MinD:=n;
    MIndex:=i;
    end;
  end;
MPos:=MstList1.GetMstPos(MIndex);
MId:=MstList1.GetMstId(MIndex);
UseMagic1(MPos,MId);
end;


procedure TPopForm.BtnClearChatHistoryClick(Sender: TObject);
begin
 wgFace.PopForm.ChatHistory.Clear;//清空聊天记录列表
end;
//自动发言
procedure TPopForm.AutoSayTimerTimer(Sender: TObject);
var
  PAutoSay:TChatPack;
  Str:String;
begin
  if Check67.Checked then
  begin
    PAutoSay.Header.dwFlag:=0;
    PAutoSay.Header.wcmd:=$0BD6;
    PAutoSay.Header.w1:=0;
    PAutoSay.Header.w2:=0;
    PAutoSay.Header.w3:=0;
    Str:=AutoSayMemo.Text;
    CopyChar(PAutoSay.ChatData,@Str[1],length(Str));
    SendMyPack(PChar(@PAutoSay),length(Str)+12);//发送包
  end;
end;

//改变自动发言间隔
procedure TPopForm.edAutoSayChange(Sender: TObject);
begin
  try
    AuToSayTimer.Interval:=StrToInt(edAutoSay.Text)*1000;
  except on EConvertError do
    ShowMessage('AuToSayTimer.Interval:无效的整数');
    end;
end;

//监视所有的CHECKBOX是否按下
procedure TPopForm.CheckStatTimerTimer(Sender: TObject);
begin
if Check30.Checked then //自动练技能CHECK
  begin
  try
    AutoSkillTimer.Interval:=StrToInt(eAutoMagicGap.Text)*1000;
    AutoSkillTimer.Enabled:=True;
  except on  EConvertError do
    ShowMessage('AuToSkillTimer.Interval:无效的整数');
  end;
  end
else
AuToSkillTimer.Enabled:=False; //关闭自动技能

if Check67.Checked then //自动发言CHECK
  begin
  try
    AuToSayTimer.Interval:=StrToInt(edAutoSay.Text)*1000;
    AuToSayTimer.Enabled:=True;
  except on  EConvertError do
    ShowMessage('AuToSayTimer.Interval:无效的整数');
    end;
  end
else
AuToSayTimer.Enabled:=False; //关闭自动技能

if Check59.Checked then
 mouse_event(MOUSEEVENTF_RIGHTDOWN , 0, 0, 0, 0)
 else
 mouse_event(MOUSEEVENTF_RIGHTUP , 0, 0, 0, 0);

end;

//自动练技能
procedure TPopForm.AutoSkillTimerTimer(Sender: TObject);
begin
  Case eAutoMagic.ItemIndex of
   0:PressKey(VK_F1,GameWindow2);
   1:PressKey(VK_F2,GameWindow2);
   2:PressKey(VK_F3,GameWindow2);
   3:PressKey(VK_F4,GameWindow2);
   4:PressKey(VK_F5,GameWindow2);
   5:PressKey(VK_F6,GameWindow2);
   6:PressKey(VK_F7,GameWindow2);
   7:PressKey(VK_F8,GameWindow2);
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -