📄 unitwz.pas
字号:
///////////////////////////////////////////////////////////////////////////////
// 武林外传游戏辅助软件
// 功能:为武林外传游戏定做的辅助软件,自动找怪,打怪,捡东西,加血,加气
// 版本:V0.01
// 版权:简易科技有限公司
// Summary SoftWare Co.Ltd
// 上一次修改时间:2006年12月12日
// 最后一次修改时间:2007年05月3日
///////////////////////////////////////////////////////////////////////////////
unit UnitWZ;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
shellapi, Menus, StdCtrls, ImgList, ExtCtrls,Clipbrd, CheckLst, Mask,
ComCtrls, Buttons, TabNotBk, Spin,IniFiles, jpeg;
const
//以下定义一些透明窗口的常量
wm_traynotify=wm_user+1000; //定义图标检测变量:
WS_EX_LAYERED = $80000;
AC_SRC_OVER = $0;
AC_SRC_ALPHA = $1;
AC_SRC_NO_PREMULT_ALPHA = $1;
AC_SRC_NO_ALPHA = $2;
AC_DST_NO_PREMULT_ALPHA = $10;
AC_DST_NO_ALPHA = $20;
LWA_COLORKEY = $1;
LWA_ALPHA = $2;
ULW_COLORKEY = $1;
ULW_ALPHA = $2;
ULW_OPAQUE = $4 ;
type
TFormWuLingWanZhuang = class(TForm)
PopupMenu1: TPopupMenu;
NSwithc: TMenuItem;
NClose: TMenuItem;
NResume: TMenuItem;
Timer1: TTimer;
NStop: TMenuItem;
TimerTab: TTimer;
LabelTitle: TLabel;
LabelCaption02: TLabel;
Timer3: TTimer;
Timer4: TTimer;
Timer2: TTimer;
Timer5: TTimer;
StaticText1: TStaticText;
LabelCaption01: TLabel;
TimerTalk: TTimer;
Panel2: TPanel;
ButtonBegin: TButton;
ButtonStop: TButton;
BitBtnRead: TBitBtn;
BitBtnSave: TBitBtn;
BitBtnRestore: TBitBtn;
ButtonClose: TButton;
TabbedNotebook1: TTabbedNotebook;
Panel1: TPanel;
TimeN001: TLabel;
TimeN002: TLabel;
TimeN003: TLabel;
TimeN004: TLabel;
TimeN005: TLabel;
TimeN006: TLabel;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
Panel4: TPanel;
Panel3: TPanel;
TimeN007: TLabel;
CheckBoxTalk: TCheckBox;
TalkText: TCheckListBox;
EditAdd: TEdit;
ButtonAdd: TButton;
ButtonDel: TButton;
ComboBoxAttrch: TComboBox;
ComboBoxGet: TComboBox;
ComboBox8: TComboBox;
ComboBox9: TComboBox;
ComboBox10: TComboBox;
CheckBoxTab: TCheckBox;
SpinEditTab: TSpinEdit;
SpinEdit1: TSpinEdit;
SpinEdit2: TSpinEdit;
SpinEdit3: TSpinEdit;
SpinEdit4: TSpinEdit;
SpinEdit5: TSpinEdit;
SpinEditTalk: TSpinEdit;
TrackBar1: TTrackBar;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Label1: TLabel;
Label2: TLabel;
TempString: TCheckListBox;
ButtonAll: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(sender:tobject);
procedure btnCloseClick(Sender: TObject);
procedure NResumeClick(Sender: TObject);
procedure ButtonBeginClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure ButtonStopClick(Sender: TObject);
procedure NSwithcClick(Sender: TObject);
procedure NStopClick(Sender: TObject);
procedure TimerTabTimer(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure Timer5Timer(Sender: TObject);
procedure StaticText1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure StaticText1Click(Sender: TObject);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure TimerTalkTimer(Sender: TObject);
procedure ButtonCloseClick(Sender: TObject);
procedure ButtonAddClick(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BitBtnRestoreClick(Sender: TObject);
procedure BitBtnReadClick(Sender: TObject);
procedure BitBtnSaveClick(Sender: TObject);
procedure ButtonDelClick(Sender: TObject);
procedure ButtonAllClick(Sender: TObject);
private
{ Private declarations }
my_tray_icon:tnotifyicondata;
procedure wmmytrayiconcallback(var msg:tmessage);
message wm_traynotify;
public
//定义时间变量
Tab_value,Key1_value,Key2_value,Key3_value,Key4_value,Key5_value,Talk_value:integer;
//定义逻辑变量
Tab_bool,Key1_bool,Key2_bool,Key3_bool,Key4_bool,Key5_bool,Talk_bool:boolean;
// Changed:boolean;// 定义是否改变设置
myinifile:Tinifile;//定义INI文件变量
IniFilename:string;//定义INI文件的名称(包括文件的路径)
TextFilename:string;
end;
//设置窗体透明度函数
function SetLayeredWindowAttributes(hwnd:HWND; crKey:Longint; bAlpha:byte; dwFlags:longint ):longint; stdcall; external user32;//函数声明
var
FormWuLingWanZhuang: TFormWuLingWanZhuang;
implementation
{$R *.DFM}
procedure TFormWuLingWanZhuang.FormCreate(Sender: TObject);
var
gamewnd:Thandle;//定义要查询的游戏程序窗口句柄变量
begin
Self.Width:=424; //设定窗口大小
Self.Height:=499;
//---------------------
TextFileName:=ExtractFilePath(Paramstr(0))+'talk.tlk';
//------------------------------------------------------
// Changed:=false;// 赋值是否改变设置
//------------------------------------------------------
IniFilename:=ExtractFilePath(Paramstr(0))+'program.wg';
//------------------------------------------------------
OpenDialog1.InitialDir:=ExtractFilePath(Paramstr(0));
//---------------------------------------------------------
myinifile:=Tinifile.Create(IniFileName);
//------------------------------------------------------
if FileExists(IniFileName) then //如果存在设置文件则读取,否则设置默认值
begin
//读取游戏快捷键设定(1)//
Tab_value:=myinifile.ReadInteger('游戏快捷键设定(1)','Tab键时间',10);
Key1_value:=myinifile.ReadInteger('游戏快捷键设定(1)','1键时间',1);
Key2_value:=myinifile.ReadInteger('游戏快捷键设定(1)','2键时间',1);
Key3_value:=myinifile.ReadInteger('游戏快捷键设定(1)','3键时间',1200);
Key4_value:=myinifile.ReadInteger('游戏快捷键设定(1)','4键时间',3600);
Key5_value:=myinifile.ReadInteger('游戏快捷键设定(1)','5键时间',1740);
Tab_bool:=myinifile.ReadBool('游戏快捷键设定(1)','Tab键有效',false);
Key1_bool:=myinifile.ReadBool('游戏快捷键设定(1)','1键有效',false);
Key2_bool:=myinifile.ReadBool('游戏快捷键设定(1)','2键有效',false);
Key3_bool:=myinifile.ReadBool('游戏快捷键设定(1)','3键有效',false);
Key4_bool:=myinifile.ReadBool('游戏快捷键设定(1)','4键有效',false);
Key5_bool:=myinifile.ReadBool('游戏快捷键设定(1)','5键有效',false);
//读取喊话设置//
Talk_value:=myinifile.ReadInteger('喊话设置','自动喊话时间',7);
Talk_bool:=myinifile.ReadBool('喊话设置','自动喊话]有效',false);
end
else
begin
Tab_value:=10;
Key1_value:=1;
Key2_value:=1;
Key3_value:=1200;
Key4_value:=3600;
Key5_value:=1740;
Talk_value:=7;
//------------------------------
Tab_bool:=false;
Key1_bool:=false;
Key2_bool:=false;
Key3_bool:=false;
Key4_bool:=false;
Key5_bool:=false;
Talk_bool:=false;
//保存游戏快捷键设定(1)//
//------------------------------------------------------------
myinifile.WriteInteger('游戏快捷键设定(1)','Tab键时间',Tab_value);
myinifile.WriteInteger('游戏快捷键设定(1)','1键时间',Key1_value);
myinifile.WriteInteger('游戏快捷键设定(1)','2键时间',Key2_value);
myinifile.WriteInteger('游戏快捷键设定(1)','3键时间',Key3_value);
myinifile.WriteInteger('游戏快捷键设定(1)','4键时间',Key4_value);
myinifile.WriteInteger('游戏快捷键设定(1)','5键时间',Key5_value);
myinifile.WriteBool('游戏快捷键设定(1)','Tab键有效',Tab_bool);
myinifile.WriteBool('游戏快捷键设定(1)','1键有效',Key1_bool);
myinifile.WriteBool('游戏快捷键设定(1)','2键有效',Key2_bool);
myinifile.WriteBool('游戏快捷键设定(1)','3键有效',Key3_bool);
myinifile.WriteBool('游戏快捷键设定(1)','4键有效',Key4_bool);
myinifile.WriteBool('游戏快捷键设定(1)','5键有效',Key5_bool);
//保存喊话设置//
myinifile.WriteInteger('喊话设置','自动喊话时间',Talk_value);
myinifile.WriteBool('喊话设置','自动喊话有限',Talk_bool);
end;
//----------------------------------------
SpinEditTab.Value:=Tab_value;
SpinEdit1.Value:=Key1_value;
SpinEdit2.Value:=Key2_value;
SpinEdit3.Value:=Key3_value;
SpinEdit4.Value:=Key4_value;
SpinEdit5.Value:=Key5_value;
//----------------------------------------
CheckBoxTab.Checked:=Tab_bool;
CheckBox1.Checked:=Key1_bool;
CheckBox2.Checked:=Key2_bool;
CheckBox3.Checked:=Key3_bool;
CheckBox4.Checked:=Key4_bool;
CheckBox5.Checked:=Key5_bool;
//----------------------------------------
SpinEditTalk.Value:=Talk_value;
CheckBoxTalk.Checked:=Talk_bool;
if not FileExists(TextFileName) then
TempString.Items.SaveToFile(TextFileName);
Talktext.Items.LoadFromFile(TextFileName);
//--------------------------------------------------
gamewnd:=FindWindow(nil,PChar('Element Client'));
if gamewnd=0 then
ShowMessage('武林外传游戏程序没有运行');
//--------------------------------------------------
(*下面一段代码是为创建托盘图标 *)
with my_tray_icon do
begin
cbsize:=sizeof(tnotifyicondata);
wnd:=handle;
uid:=1;
uflags:=nif_message or nif_icon or nif_tip;
ucallbackmessage:=wm_traynotify;
hIcon:=Application.Icon.handle;
sztip:='武林外传辅助软件V1.00{易软件工作室}';
end;
shell_notifyicon(nim_add,@my_tray_icon);
end;
procedure tFormWuLingWanZhuang.formdestroy(sender:tobject);
begin
FreeAndNil(myinifile);
shell_notifyicon(nim_delete,@my_tray_icon);
end;
procedure tFormWuLingWanZhuang.wmmytrayiconcallback(var msg:tmessage);
var
cursorpos:tpoint;
begin
case msg.LParam of
wm_lbuttondown:
begin
setforegroundwindow(application.handle);
end;
wm_rbuttondown:
begin
getcursorpos(cursorpos);
popupmenu1.Popup(cursorpos.x,cursorpos.y);
end;
end;
end;
procedure TFormWuLingWanZhuang.btnCloseClick(Sender: TObject);
begin
ButtonClose.Click;
end;
procedure TFormWuLingWanZhuang.NResumeClick(Sender: TObject);
begin
FormWuLingWanZhuang.Show;
end;
//------------------------------------------------//
procedure TFormWuLingWanZhuang.TimerTabTimer(Sender: TObject);
begin
keybd_event(vk_tab,0,0,0);//模拟按下[Tab]键
keybd_event(vk_tab,0,KEYEVENTF_KEYUP,0);//模拟释放[Tab]键
end;
//--------------------------------------------------//
procedure TFormWuLingWanZhuang.Timer1Timer(Sender: TObject);
begin
keybd_event(49,0,0,0);//模拟按下[1]键
keybd_event(49,0,KEYEVENTF_KEYUP,0);//模拟释放[1]键
end;
//------------------------------------------------//
procedure TFormWuLingWanZhuang.Timer2Timer(Sender: TObject);
begin
keybd_event(50,0,0,0);//模拟按下[2]键
keybd_event(50,0,KEYEVENTF_KEYUP,0);//模拟释放[2]键
end;
//------------------------------------------------//
procedure TFormWuLingWanZhuang.Timer3Timer(Sender: TObject);
begin
keybd_event(51,0,0,0);//模拟按下[3]键
keybd_event(51,0,KEYEVENTF_KEYUP,0);//模拟释放[3]键
end;
//----------------------------------------------//
procedure TFormWuLingWanZhuang.Timer4Timer(Sender: TObject);
begin
keybd_event(52,0,0,0);//模拟按下[4]键
keybd_event(52,0,KEYEVENTF_KEYUP,0);//模拟释放[4]键
end;
//----------------------------------------------//
procedure TFormWuLingWanZhuang.Timer5Timer(Sender: TObject);
begin
keybd_event(53,0,0,0);//模拟按下[5]键
keybd_event(53,0,KEYEVENTF_KEYUP,0);//模拟释放[5]键
end;
//------------------------------------------------//
procedure TFormWuLingWanZhuang.TimerTalkTimer(Sender: TObject);
//自动喊话器
var
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -