dnf幻影

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls,consttype,IniFiles, ExtCtrls;

type
  TForm1 = class(TForm)
    TabUserInfo: TTabSheet;
    TabSetting: TTabSheet;
    tabs_user: TPageControl;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label_Name: TLabel;
    Label2: TLabel;
    Label_Leave: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label_Xue: TLabel;
    Label_Lan: TLabel;
    GroupBox2: TGroupBox;
    CheckBoxXue: TCheckBox;
    Label5: TLabel;
    Edit_limitXue: TEdit;
    ComboBox_Xue: TComboBox;
    Label6: TLabel;
    CheckBoxLan: TCheckBox;
    Label7: TLabel;
    Edit_limitLan: TEdit;
    Label8: TLabel;
    ComboBox_Lan: TComboBox;
    CheckBox_PackUp: TCheckBox;
    ComboBox_PickKey: TComboBox;
    Button_autoAttack: TButton;
    Button_stopAttick: TButton;
    Edit_attackLimit: TEdit;
    Label9: TLabel;
    ListBox_ItemFilter: TListBox;
    Button_listAdd: TButton;
    Edit_AddItem: TEdit;
    Label10: TLabel;
    Button_listDel: TButton;
    Label11: TLabel;
    Label_exp: TLabel;
    CheckBox_useSkill: TCheckBox;
    ComboBox_skill: TComboBox;
    Button_refresh: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Timer1: TTimer;
    Label12: TLabel;
    Label_Coordinate: TLabel;
    CheckBox_compSkill: TCheckBox;
    ListBox_compSkill: TListBox;
    Button_addcompski: TButton;
    CheckBox_SkillAdd: TCheckBox;
    Edit_SkillAddDelay: TEdit;
    ComboBox_skilladd: TComboBox;
    Edit_skilladdlimit: TEdit;
    GroupBox3: TGroupBox;
    Label13: TLabel;
    Label_BugName: TLabel;
    Label15: TLabel;
    Label_BugXue: TLabel;
    ProgressBar1: TProgressBar;
    procedure FormCreate(Sender: TObject);
    procedure CheckBoxXueClick(Sender: TObject);
    procedure initComboBox;
    procedure FormDestroy(Sender: TObject);
    procedure CheckBoxLanClick(Sender: TObject);
    procedure CheckBox_PackUpClick(Sender: TObject);
    procedure Button_autoAttackClick(Sender: TObject);
    procedure Button_stopAttickClick(Sender: TObject);
    procedure tabs_userChange(Sender: TObject);
    procedure ListBox_ItemFilterClick(Sender: TObject);
    procedure Button_listAddClick(Sender: TObject);
    procedure Button_listDelClick(Sender: TObject);
    procedure Button_refreshClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button_addcompskiClick(Sender: TObject);

private
    { Private declarations }
    procedure RegHotKey(handle:THandle;aatom:atom;keyName:pchar;key:cardinal);
    procedure UnHotKey(handle:THandle;aatom:atom);
    procedure GetHotKey(var msg:tmessage);message wm_hotkey;
    procedure InitItemFilter;
    procedure SaveItemFilter;
    procedure InitListBox;
    procedure InitLeave;
  public
    { Public declarations }
    function GetSelectXueID:cardinal;
    function GetSelectLanID:cardinal;
    Function GetCheckXue:boolean;
  end;

var
  Form1: TForm1;
  hotKey: array[hot_sit..hot_up] of atom; //设置热键数组;
  drugsXue:array[0..9] of TDrugs; //血物品信息
  drugsLan:array[0..9] of TDrugs; //蓝物品信息
  addType:boolean;
  itemFilter:ATItemFilter;
  leaveArray:array of integer;
  pid:cardinal;
  skills:ATSkill; //技能ID数组
  compSkill:ATSkill;//辅助技能数组

implementation
uses UnitBaseInfo,UnitAutoAdd,UnitAutoAttack,UnitCall,UnitPickUpThread,
     UnitSkillSetDlg;
var
//基本信息线程
  MyBaseInfo:BaseInfo;
  myAutoAdd:AutoAdd;
  appPath:pchar; //程序路径
  myAutoAttack:AutoAttack;
  myPickUpThread:PickUpThread;
  PickKey:cardinal;

{$R *.dfm}

procedure TForm1.CheckBoxXueClick(Sender: TObject);
begin
Edit_limitXue.Enabled:=not Edit_limitXue.Enabled;
ComboBox_Xue.Enabled:=not ComboBox_Xue.Enabled;

end;
procedure TForm1.CheckBoxLanClick(Sender: TObject);
begin
Edit_limitLan.Enabled:=not Edit_limitLan.Enabled;
ComboBox_Lan.Enabled:=not ComboBox_Lan.Enabled;
end;
//初始化过滤数组结构
procedure TForm1.initItemFilter;
var
myinifile:Tinifile;
path:pchar;
total:integer;
i,j:integer;
id,name:pchar;
tempid:integer;
tempName:string;
section:string;
begin
j:=0;
path:=pchar(appPath+'setting.ini');
myinifile:=Tinifile.Create(path);
section:='itemfilter';
total:=myinifile.ReadInteger(section,'total',0);
setlength(itemFilter,total);
for i:=0 to total-1 do
begin
  id:=pchar('id'+inttostr(i));
  name:=pchar('name'+inttostr(i));
  tempid:=myinifile.ReadInteger('itemfilter',id,0);
  tempName:=myinifile.ReadString('itemfilter',name,'');
  if tempName<>'' then
  begin
    itemFilter[j].id:=tempid;
    itemFilter[j].name:=tempName;
    j:=j+1;
  end;
end;
myinifile.Free;
end;
//保存过滤数组结构
procedure TForm1.SaveItemFilter;
var
myinifile:Tinifile;
path:pchar;
i:integer;
id,name:pchar;
section:string;
tot:string;
begin
path:=pchar('./setting.ini');
myinifile:=Tinifile.Create(path);
section:='itemfilter';
tot:='total';
myinifile.EraseSection(section);
myinifile.WriteInteger(section,tot,length(itemFilter));
if Length(itemFilter)>0 then
begin
for i:=0 to length(itemFilter)-1 do
begin
  //if itemFilter[i].name <> nil then
  begin
    id:=pchar('id'+inttostr(i));
    name:=pchar('name'+inttostr(i));
    myinifile.WriteInteger(section,id,itemFilter[i].id);
    myinifile.WriteString(section,name,itemFilter[i].name);
  end;
end;
end;
myinifile.Free;
end;
//初始化listbox
procedure TForm1.InitListBox;
var
i:integer;
begin
for i:=0 to length(itemFilter)-1 do
begin
  ListBox_ItemFilter.Items.Add(itemFilter[i].name);
end;
end;

//初始化combobox
procedure TForm1.InitComboBox;
var
myinifile:Tinifile;
path:pchar;
i,j:integer;
id,name:pchar;
tempid:integer;
tempName:string;
begin
j:=0;
path:=pchar(appPath+'setting.ini');
myinifile:=Tinifile.Create(path);
for i:=0 to length(drugsXue)-1 do
begin
id:=pchar('id'+inttostr(i));
name:=pchar('name'+inttostr(i));
tempid:=myinifile.ReadInteger('drugsXue',id,0);
tempName:=myinifile.ReadString('drugsXue',name,'');
if tempName<>'' then
begin
drugsXue[j].ID:=tempid;
drugsXue[j].name:=tempName;
ComboBox_Xue.Items.Add(drugsXue[j].name);
j:=j+1;
end;
end;
j:=0;
for i:=0 to length(drugsXue)-1 do
begin
id:=pchar('id'+inttostr(i));
name:=pchar('name'+inttostr(i));
tempid:=myinifile.ReadInteger('drugsLan',id,0);
tempName:=myinifile.ReadString('drugsLan',name,'');
if tempName<>'' then
begin
drugsLan[j].ID:=tempid;
drugsLan[j].name:=tempName;
ComboBox_Lan.Items.AddObject(drugsLan[j].name,TObject(j));
j:=j+1;
end;
end;
myinifile.Free;
end;
//初始化等级数组
procedure TForm1.InitLeave;
var
myinifile:Tinifile;
path:pchar;
i:integer;
total:integer;
section:string;
begin
path:=pchar('./leave.ini');
section:='leave';
myinifile:=Tinifile.Create(path);
total:=myinifile.ReadInteger(section,'total',0);
setlength(leaveArray,total);
for i:=0 to high(leaveArray) do
begin
  leaveArray[i]:=myinifile.ReadInteger(section,inttostr(i),0);
end;
myinifile.Free;
end;

//注册热键过程
procedure TForm1.RegHotKey(handle:THandle;aatom:atom;keyName:pchar;key:cardinal);
begin
aatom:=globaladdatom(keyName);
RegisterHotKey(handle,aatom,0,key);
end;
//卸载热键过程
procedure TForm1.UnHotKey(handle:THandle;aatom:atom);
begin
UnRegisterHotKey(handle,aatom);
globalDeleteatom(aatom);
end;
//热键响应
procedure TForm1.GetHotKey(var msg:tmessage);
begin
if msg.LParamHi=PickKey then  //拾取物品
begin
myPickUpThread:=PickUpThread.Create(false);
end;
end;
//返回红药ID
function TForm1.GetSelectXueID:cardinal;
begin
result:=drugsXue[ComboBox_Xue.ItemIndex].ID;
end;
//返回蓝药ID
function TForm1.GetSelectLanID:cardinal;
begin
result:=drugsLan[ComboBox_Lan.ItemIndex].ID;
end;

function TForm1.GetCheckXue:boolean;
begin
result:=CheckBoxXue.Checked;
end;

//窗体创建
procedure TForm1.FormCreate(Sender: TObject);
var
wnd:hwnd;
begin
Wnd := FindWindow(nil,'Element Client');
GetWindowThreadProcessId(wnd,@pid);
appPath:=pchar(ExtractFilePath(Application.ExeName));
initComboBox;
InitLeave;
initItemFilter;
initListBox;
addType:=false;
myBaseInfo:=BaseInfo.Create(false);
myAutoAdd:=AutoAdd.Create(false);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
myBaseInfo.Destroy;
myAutoAdd.Destroy;
SaveItemFilter;
UnHotKey(self.Handle,hotKey[hot_pick]);
end;

procedure TForm1.CheckBox_PackUpClick(Sender: TObject);
begin
pickKey:=HotKeys[ComboBox_PickKey.ItemIndex];
RegHotKey(self.Handle,hotKey[hot_pick],'pickup',PickKey);//拾取物品
end;

procedure TForm1.Button_autoAttackClick(Sender: TObject);
begin
myAutoAttack:=AutoAttack.Create(false);
end;

procedure TForm1.Button_stopAttickClick(Sender: TObject);
begin
myAutoAttack.Terminate;
myAutoAttack.Free;
end;

procedure TForm1.tabs_userChange(Sender: TObject);
begin
if tabs_user.ActivePageIndex=1 then
begin
end;
end;

procedure TForm1.ListBox_ItemFilterClick(Sender: TObject);
begin
Edit_AddItem.Text:=ListBox_ItemFilter.Items.Strings[ListBox_ItemFilter.itemindex];
end;

procedure TForm1.Button_listAddClick(Sender: TObject);
var
i:integer;
begin
ListBox_ItemFilter.Items.Add(Edit_AddItem.Text);
setlength(itemFilter,ListBox_ItemFilter.Items.Count);
for i:=0 to high(itemFilter) do
begin
  itemFilter[i].name:=ListBox_ItemFilter.Items.Strings[i];
end;
end;

procedure TForm1.Button_listDelClick(Sender: TObject);
var
i:integer;
begin
ListBox_ItemFilter.Items.Delete(ListBox_ItemFilter.itemindex);
setlength(itemFilter,ListBox_ItemFilter.Items.Count);
for i:=0 to high(itemFilter) do
begin
  itemFilter[i].name:=ListBox_ItemFilter.Items.Strings[i];
end;
end;

procedure TForm1.Button_refreshClick(Sender: TObject);
var
myFuncCall:FuncCall;
i:integer;
begin
self.ComboBox_skill.Items.Clear;
self.ComboBox_skilladd.Items.Clear;
self.CheckBox_useSkill.Enabled:=true;
self.ComboBox_skill.Enabled:=true;
myFuncCall.GetSkill(skills);
for i:=0 to high(skills) do
  begin
  self.ComboBox_skill.Items.Add(skills[i].name);
  self.ComboBox_skilladd.Items.Add(skills[i].name);
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
myFuncCall:FuncCall;
begin
 myFuncCall.test;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Caption:=self.Label_Name.Caption+self.Label_Xue.Caption+'explorer';
Application.Title:=self.Label_Name.Caption+self.Label_Xue.Caption+'explorer';
end;

procedure TForm1.Button_addcompskiClick(Sender: TObject);
begin
SkillSetDlg.show;
SkillSetDlg.InitSkill;
end;

end.

dnf幻影部分原代码相关推荐

  1. .Net应用之数据连接(少儿助学网MisDataSet.dll)原代码

    原代码文件下载 :MisDataSet 数据连接字符串放置在web.config文件中如下: <?xml version="1.0" encoding="utf-8 ...

  2. 大功率双伺服电机驱动板,包含原理图,PCB和原代码,基于STM32F4方案,支持霍尔,编码器,无感

    大功率双伺服电机驱动板,包含原理图,PCB和原代码,基于STM32F4方案,支持霍尔,编码器,无感. 需要有一定的基础,无基勿扰. :9450639029711075枫叶蓝.

  3. verilog学习笔记之一--(简化)华莱士(Wallace)树形乘法器设计--(原代码出自用芯学项目)

    verilog学习笔记之一–(简化)华莱士(Wallace)树形乘法器设计–(原代码出自用芯学项目) 学习准备1: 树形乘法器原理:参考<数字集成电路-电路.系统与设计(第二版)>–P43 ...

  4. dpcm编码 matlab程序,DPCM预测编码的MATLAB原代码: | 学步园

    DPCM预测编码原代码: i1=imread('3.jpg'); i1=rgb2gray(i1); i1=imcrop(i1,[20 20 160 160]); i=double(i1); [m,n] ...

  5. 发段完美国际注入跑路call 全部原代码

    [delphi]发段完美国际注入跑路call 全部原代码,(delphi读取怪物数组列表问题已解决) <script type=text/javascript> </script&g ...

  6. c语言中控辅助DNF,DNF2019最新稳定代码辅助

    DNF CE修改器是一款针对<地下城与勇士>所推出的辅助软件.这款DNF2019最新稳定代码辅助功能强大,支持在游戏中修改搬砖.材料.技能.道具等,可以说你想要的都能修改,就是这么简单粗暴 ...

  7. java输出回文数原代码_JAVA怎么用循环语句编写一个判别是否为回文数的代码?...

    import java.util.Scanner; /** * 回文数是指将该数含有的数字逆序排列后得到的数和原数相同, * 例如12121.3223都是回文数 */ public class Hui ...

  8. Fms3和Flex打造在线多人视频会议和视频聊天(附原代码)

    Flex,Fms3系列文章导航 Flex,Fms3相关文章索引 本篇是视频聊天,会议开发实例系列文章的第3篇,该系列所有文章链接如下: http://www.cnblogs.com/aierong/a ...

  9. CAD二次开发--三维多段线偏移(Polyline3d offset)实现方法【GetOffsetCurves附带原代码】

    你如果有在做CAD开发,并且你也有自定义的个性化的偏移需求,那么你会发现CAD目前只能进行2D线偏移:而3D线分为两种,第一种为"假三维"(z为0),这种虽然不会报错,也能看见他的 ...

最新文章

  1. 如何在 CentOS 7 中安装或升级最新的内核
  2. CSS截取字符串,兼容浏览器
  3. 2018年中国城市用电量30强
  4. 一个简单粗暴的爬虫 - 必应今日美图
  5. 掉网问题的log分析
  6. magento mysql4-install_Magento
  7. jps查看java进程以及pwdx通过pid查看进程所在位置
  8. URAL 1225 Flags
  9. 可以无限增加iPhone 的图标吗?
  10. C#获取周一、周日的日期 函数类
  11. 【时间管理法】用三个学期拿双学位,还不耽误睡眠和社交
  12. VC 图像处理相关源代码,共28套打包下载.rar 分享
  13. C语言购物管理系统项目
  14. python 序列去重并保持原始顺序
  15. UML建模--用例图
  16. OpenSSL文档阅读笔记-RSA Encryption Decryption Example with OpenSSL in C
  17. Gym 101350E Competitive Seagulls
  18. 乌班图配置 https ssl证书
  19. C/C++ 操作ini文件(SinpleIni 跨平台库)
  20. 重读《大数据时代》:关于大数据的再认识

热门文章

  1. 北京市大兴区卫星地图下载
  2. Linux环境下 制作U盘启动盘
  3. 企业订货系统,手机订货系统整理了一下内容介绍和功能名称
  4. 南京大学周志华教授当选欧洲科学院外籍院士
  5. 栅极驱动器中的电荷泵---BLDC和H桥预驱IC中的电荷泵
  6. 如何用积分去管理和转化用户
  7. Cubase pro 12
  8. 10月23日java web培训日记
  9. 麻省理工公开课:微积分,中文字幕视频+PDF
  10. su必备插件_sketchup的36种实用插件介绍