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

📄 udeal.pas

📁 zhengtu外挂源码
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       外挂执行处理单元                                }
{                                                       }
{       主要对所有的设置进行定时检查及处理              }
{                                                       }
{       参数来源于主窗口的设置,参考搜索线程的结果      }
{       进行相应的处理                                  }
{                                                       }
{*******************************************************}
unit uDeal;

interface

uses
  Classes, SysUtils;

type
  TThreadDeal = class(TThread)
  private
    { Private declarations }
  public
  protected
    procedure Execute; override;
    procedure UpdateFrom;
  end;

var
  ThreadDeal: TThreadDeal;
implementation

uses fmMain, uDefine;

{ TThreadDeal }

procedure TThreadDeal.Execute;
begin
  while not Terminated do
  begin
    Sleep(1000);
    if not Assigned(frmMain) then
      Continue;
    if not Assigned(GameChr) then
      Continue;
    if GameChr.ZtHwnd=0 then
    begin
      Suspend;
      Continue;
    end;  
    Synchronize(UpdateFrom);
  end;
end;

procedure TThreadDeal.UpdateFrom;
var
  i: Integer;
begin
  with frmMain do
  begin
    for i := 1 to 3 do
    begin
      if GameChr.ChrProp.MaxHp <= 0 then
        Exit;
      if Prop[i].Checked then
        if GameChr.ChrProp.Hp <= Prop[i].Value then
          GameChr.SendKey(Prop[i].Key);
    end;
    for i := 4 to 5 do
    begin
      if Prop[i].Checked then
        if GameChr.ChrProp.Mp <= Prop[i].Value then
          GameChr.SendKey(Prop[i].Key);
    end;
    for i := 1 to 6 do
    begin
      if Skill[i].Checked then
      begin
        SkillValue[i] := SkillValue[i] + 1;
        if SkillValue[i] < 3 then
          GameChr.SendKey(Skill[i].Key);
        if SkillValue[i] > StrToInt(Skill[i].Text) then
          SkillValue[i] := 0;
      end;
    end;
    if chkAutoGet.Checked then
      GameChr.SendKey('`');
  end;
end;

initialization
  ThreadDeal := TThreadDeal.Create(True);

finalization
  ThreadDeal.Terminate;
  ThreadDeal.Free;

end.

⌨️ 快捷键说明

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