|
|
http://yunpan.cn/QGq4PF5eXdQAM
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
CheckBox_Speed2: TCheckBox;
CheckBox_Speed3: TCheckBox;
CheckBox_Speed4: TCheckBox;
Label_Name: TLabel;
Label_XY: TLabel;
CheckBox_YS: TCheckBox;
CheckBox_Other: TCheckBox;
CheckBox_SM: TCheckBox;
CheckBox_BX: TCheckBox;
SpeedButton_run: TSpeedButton;
SpeedButton_pause: TSpeedButton;
SpeedButton_Load: TSpeedButton;
SpeedButton_hide: TSpeedButton;
ListBox1: TListBox;
Timer1: TTimer;
Timer_Fix: TTimer;
Timer_Run: TTimer;
OpenDialog1: TOpenDialog;
Label_Map: TLabel;
CheckBox_Speed1: TCheckBox;
Label_Test: TLabel;
Label1: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton12: TSpeedButton;
Timer_Pause: TTimer;
Label_blood: TLabel;
procedure FormCreate(Sender: TObject);
procedure Timer_PauseTimer(Sender: TObject);
procedure SpeedButton12Click(Sender: TObject);
procedure SpeedButton11Click(Sender: TObject);
procedure SpeedButton10Click(Sender: TObject);
procedure SpeedButton9Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Label1Click(Sender: TObject);
procedure Label_TestClick(Sender: TObject);
procedure SpeedButton_hideClick(Sender: TObject);
procedure SpeedButton_pauseClick(Sender: TObject);
procedure Timer_RunTimer(Sender: TObject);
procedure SpeedButton_LoadClick(Sender: TObject);
procedure SpeedButton_runClick(Sender: TObject);
procedure CheckBox_Speed4Click(Sender: TObject);
procedure CheckBox_Speed3Click(Sender: TObject);
procedure CheckBox_Speed2Click(Sender: TObject);
procedure CheckBox_Speed1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
脚本参数 = array[0..10] of string;
脚本参数指针 = ^脚本参数;
var
Form1: TForm1;
PassMap:BOOL;
GameName , NPCName ,GameMap : ^PChar;
XY_X , XY_Y , MOVE_X , MOVE_Y , GameBlood , NPCID , temp : DWORD;
SpeakCall , MoveCall ,TalkNPCCall ,AutoBase ,FixCall ,BloodBase : DWORD;
FHBase,FHBase1,FHBase2,FHBase3,AcdcBase,AcdcBase2,SXSpeed WORD;
Speed , NPC_X , NPC_y ,PauseTime,PassSxNum : integer;
NPCFindBool:BOOL;
//, Num_YS , Num_SG , Num_SM , Num_BX
列表行:TStringlist;
命令参数:脚本参数;
FileTxt:string;
Speakmode WORD;
//Speakcontent:array[0..255] of string;
Speakcontent:string;
const
{特征码1
MOV ECX,DWORD PTR DS:[ESI+7C]
MOV EDX,DWORD PTR DS:[EBX]
PUSH 0
PUSH 0
PUSH 1
PUSH ECX
PUSH EDX
下面的ECX就是8B4E7C8B136A006A006A015152}
GameBase=$00BFA5E0;
{特征码 //找一大片的零 不喊话就不必找了
MOV DWORD PTR FS:[0],ESP
SUB ESP,11C
PUSH EBX
PUSH ESI
PUSH EDI
PUSH ECX
PUSH EAX
找到下面一句 MOV ECX,client.00BFBB68 +8+8就是}
// [[00bfbb78]0..4 100]+9c 名字 +D4 +D8 XY坐标
// [[$BFBB78C]+$1C]+$9C
{ [前面已经作废下面是新的]
//00940496 8B00 mov eax,dword ptr ds:[eax] dd [[ecx+10]+esi*4]
mov eax,dword ptr ss:[ebp+0x850]
mov esi,0x1
push esi
push eax
下面ECX是基址 8B8550080000BE010000005650B9 }
NPCBase=$00C85978+$10;
//NullBase=$00EAA000;
//const
{ 0091BAEA //该功能集成在加速器里
LEA EAX,DWORD PTR DS:[ESI+ESI*4]
LEA EAX,DWORD PTR DS:[EAX+EAX*4]
SHL EAX,2
XOR EDX,EDX
DIV ECX
MOV ESI,EAX
CMP ESI,5
MOV EAX,5
进上CALL 8D04B68D0480C1E00233D2F7F18BF083FE05B805000000 }
SXSpeedAddr=$0094BA1C;
SXSpeedData=$B8CB8B00;
// PassAddr=$00C5EF78;
// PassData=$B60F45EB;
implementation
{$R *.dfm}
//////////////////////////代码断/////////////////////////////
{
procedure PassSx; //过保护
begin
asm
mov eax,PassAddr
mov eax,[eax]
add eax, $291c8
mov ebx,PassData
mov dword ptr[eax],ebx
end;
end;
procedure UnPassSx; //恢复保护
begin
asm
mov eax,PassAddr
mov eax,[eax]
add eax, $29F0C
mov ebx,$8B646AFF
mov dword ptr[eax],ebx
end;
end; }
procedure TForm1.FormCreate(Sender: TObject);
begin
{特征码:
MOV BYTE PTR SS:[ESP+1C],0
MOV DWORD PTR SS:[ESP+10],EAX
REP STOS DWORD PTR ES:[EDI]
找到头部就是CALL
}
//SpeakCall:=$005C8A10;
{特征码
MOV ECX,DWORD PTR DS:[ESI+7C]
MOV EDX,DWORD PTR DS:[EBX]
PUSH 0
PUSH 0
PUSH 1
PUSH ECX
PUSH EDX
下面的CALL就是 8B4E7C8B136A006A006A015152B9????????E8}
MoveCall:=$008E15B0;
{征码 1 ( 基址 )
8B57??52B9????????E8????????5fc786????????
征码 2
5e5d5b81c4????????c20c008b47??50
征码 3
POP ESI
POP EBP
POP EBX
ADD ESP,128
RETN 0C
MOV EAX,DWORD PTR DS:[EDI+70]
push eax
上面CALL就是 ,EDX是ID,偏移+60
}
TalkNPCCall:=$00945670;
{ 常量特征码
MOV DWORD PTR DS:[ESI+272C],EAX
MOV ECX,DWORD PTR DS:[ESI+2714]
PUSH ECX
LEA ECX,DWORD PTR DS:[ESI+0E54]
(前面)的一个MOV EDX,DWORD PTR[XXXXXX]
自动打怪基址 04fd0060自动复活特征码 89862C2700008B8E14270000518D8E540e0000}
AutoBase:=$0BD999C;
{特征码:1 //直接这个CALL
E8????????8b461c50ffd350e8????????8b481c6a0068????????68????????51FF15
特征码: 2
MOV ECX,DWORD PTR DS:[ESI+238]
MOV EDX,DWORD PTR DS:[EAX+1C]
PUSH ECX
PUSH 0E8
PUSH 464
PUSH EDX
CALL EDI
下面第9个CALL}
FixCall:=$009189C0;
{血量特征码
NOP
PUSH ESI
MOV ESI,ECX
PUSH 1
第二次下面的CMP DWORD PTR DS:[ESI+155c],EAX
}
BloodBase:=$1564;
{自动复活特征码
MOV EDX,DWORD PTR DS:[ESI+9B4]
PUSH EDX
PUSH EAX
LEA EAX,DWORD PTR SS:[ESP+10]
PUSH EAX
}
FHBase1:=$9b4; //不用找
{
模糊查找
FF90D0000000????????????84c0????8d8e
下面第四句
转到00401000在这里查找当前CALL头部 00402969 JMP client.00611620 当前函数头部地址,
再转到00555555看CALL 00402969,上面一句就是偏移0040295F
0059C872 8D8E A09F1E00 lea ecx,dword ptr ds:[esi+0x1E9FA0]
}
FHBase2:=$1DE180;
{
8d8b????????84c0e8????????39b3
MOV DWORD PTR SS:[EBP-38],ECX
AND EAX,1
XOR ECX,ECX
OR EAX,ECX
下面 8 CALL上面的偏移就是
LEA ECX,DWORD PTR DS:[EBX+32DC0]
}
FHBase3:=$339B0;
//PassSx();
end;
procedure SpeedMove();
var
SXSpeed WORD;
begin
if form1.CheckBox_Speed1.Checked=true then SXSpeed:=$000097B8;
if form1.checkbox_speed2.checked=true then SXSpeed:=$0000e7B8;
if form1.checkbox_speed3.checked=true then SXSpeed:=$00012dB8;
if form1.checkbox_Speed4.checked=true then SXSpeed:=$0001f5B8 else exit;
asm
mov eax,eax
mov eax,eax
mov eax,SXSpeedAddr
mov ebx,SXSpeed
mov dword ptr [eax],ebx
add eax,4
mov ebx,$C3909000
mov dword ptr [eax],ebx
////////////////////////
end;
end;
{
procedure Speak();
begin
// Speakcontent:='11我卖金';
// Speakmode:=4;
asm //09130d35
Mov ecx,NullBase
Lea edi,[ecx+$13fc] //内容 LEA ESI,DWORD PTR SS:[EBP+13FC] 借用EDI
mov esi,Speakcontent //借用ESI
mov ecx,255 //复制长度
REP MOVS DWORD PTR ES:[EDI],DWORD PTR ES:[ESI]//必须ESI到EDI
Mov ecx,NullBase
Lea eax,[ecx+$15fc] //长度 MOV ECX,DWORD PTR SS:[EBP+15FC]
Mov dword ptr[eax],255
Lea eax,[ecx+$2264] //必须为1 MOV AL,BYTE PTR SS:[EBP+2264]
Mov dword ptr[eax],1
Lea eax,[ecx+$2268] //方式 MOV EAX,DWORD PTR SS:[EBP+2268]
mov ebx, Speakmode //借用EBX,不能Mov dword ptr[eax],Speakmode
Mov dword ptr[eax],ebx
CALL SpeakCall
end;
end;
}
procedure Move();stdcall;
begin
asm
push 0
push 0
push 1
push MOVE_Y //X
push MOVE_X //Y
mov ecx,gamebase
call MoveCall
end;
end;
procedure TalkNPC(NPCID WORD);stdcall;
begin
asm
{ push NPCID
mov ecx,gamebase
CALL TalkNPCCall }
end;
end;
procedure ZDFH();
var
fhtime:dword;
begin
asm
mov edi,AutoBase
mov edi,[edi]
add edi,FHBase1
add edi,FHBase2
add edi,FHBase3
mov edi,[edi]
mov fhtime,edi
end;
if fhtime>5 then
begin
asm
mov edi,AutoBase
mov edi,[edi]
add edi,FHBase1
add edi,FHBase2
add edi,FHBase3
mov dword ptr [edi],1
end;
end;
end;
//functoin SearchNPC(NPC:string) WORD;stdcall;
procedure SearchNPC(NPC:string); stdcall;
var
p,p2 : ^DWORD;
i WORD;
//寻路参数:脚本参数;
begin
// [[00bfbb78]0..4 100]+9c 名字 +D4 +D8 XY坐标
NPCFindBool:=False;
p:=Pointer(NPCBase);
for I := 0 to 40 do
begin
p2:=Pointer(p^+I*4); //[[00bfbb78]0..4]
try
temp:=p2^;
if (temp>1000) then
begin
NPCName:=Pointer(p2^+$0aC); //dc [[00C85988]0..4 100]+0AC
if (NPC=PChar(NPCName)) then
begin
form1.Caption:=IntToStr(temp);
{ px:=Pointer(P2^+$e4);
NPC_X:=Integer(Px^);
py:=Pointer(P2^+$e8);
NPC_y:=Integer(Py^);
P:=Pointer(P2^+$70);
NPCID:=p^; }
NPCFindBool:=True;
Exit;
end;
end;
NPCFindBool:=False;
except
Exit;
end;
end;
end;
////////////////////////脚本代码/////////////////////////////
procedure 运行脚本;
begin
Form1.Timer_Run.Enabled:=True;
if Form1.ListBox1.ItemIndex+1=Form1.ListBox1.Items.Count then
Form1.ListBox1.ItemIndex:=-1
end;
procedure 停止;
begin
Form1.Timer_Run.Enabled:=False;
end;
Function 脚本函数(cmd:脚本参数指针;s:string):integer;
var
p:pchar;
st:string;
i,j:integer;
begin
result:=1;
if s='' then begin result:=-1;exit; end;
i:=0; j:=0; st:='';
p:=@s[1];//指向待处理 字串的首地址
while (p<>',') do
begin
st:=st+p;
i:=i+1;
if p='' then Break;
end;
cmd[j]:=st;j:=j+1; //保存 命令 字串
if (p=',') then i:=i+1;
//读参数
st:='';//初始化字串
while (p<>'') do
begin
while (p<>',' ) do
begin
st:=st+p;i:=i+1;
if p='' then break;
end;
if p=',' then begin cmd[j]:=st;st:='';j:=j+1; i:=i+1;end;
if p='' then begin cmd[j]:=st;st:=''; break;end;
end;
end;
procedure 脚本分支(脚本参数:脚本参数);
var
OldMap:string;
begin
if (脚本参数[0]='说明') then
begin
end else
if (脚本参数[0]='走到') then
begin
move_X:=StrToInt(脚本参数[1]);
move_Y:=StrToInt(脚本参数[2]);
Move;
end else
if (脚本参数[0]='过图') then
begin
PassMap:=True;
move_X:=StrToInt(脚本参数[1]);
move_Y:=StrToInt(脚本参数[2]);
OldMap:=脚本参数[3];
Form1.Label_Test.caption:='过图:'+OldMap;
if (PChar(GameMap)<>OldMap) then
begin
Move;
Form1.Label_Test.caption:='过图:'+OldMap;
end else
begin
Form1.ListBox1.ItemIndex:=Form1.ListBox1.ItemIndex+1;
PassMap:=False;
form1.Label_Test.Caption:='已过图';
end;
end else
if (脚本参数[0]='返回开始') then
begin
Form1.ListBox1.ItemIndex:=0;
end else
if (脚本参数[0]='喊话') then //普通0/私聊1/队伍2/工会3/种族4/世界5/地区6
begin
Speakmode:=StrToInt(脚本参数[1]);
Speakcontent:=脚本参数[2];
form1.Label_Test.Caption:='喊话';
// Speak();
Form1.ListBox1.ItemIndex:=Form1.ListBox1.ItemIndex+1;
PassMap:=true;
end else
if (脚本参数[0]='等待') then
begin
PauseTime:=StrToInt(脚本参数[1]);
form1.timer_Pause.Enabled:=True;
form1.Label_Test.Caption:='等待';
PassMap:=true;
停止;
end else
if (脚本参数[0]='停止') then
begin
停止;
end else
begin
Form1.Label_Test.Caption:='不支持的命令或无效字符!'+脚本参数[0];
Beep;
停止;
end;
end;
procedure Find_on_off;
begin
if (Form1.CheckBox_YS.checked=true) then
begin
SearchNPC('陨石');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if (Form1.CheckBox_SM.Checked=true) then
begin
SearchNPC('松木');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if (Form1.CheckBox_BX.Checked=true) then
begin
SearchNPC('黄金宝箱');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if (Form1.CheckBox_Other.Checked=true) then //其它杂物
begin
if Pchar(GameMap)='比蒙王城' then //兽族开始
begin
SearchNPC('兽骨');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='东北行省' then
begin
SearchNPC('蛇莓');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='拿仑角海湾' then
begin
SearchNPC('贝壳');
if NPCFindBool=True then TalkNPC(NPCID);
SearchNPC('黑珍珠');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='多瑙大荒原' then
begin
SearchNPC('叁薯');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='翡冷翠' then
begin
SearchNPC('千叶莺萝花');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='多洛特' then
begin
SearchNPC('多洛特军品特供');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='白令山脉' then
begin
SearchNPC('仙人果');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='南十字星森林' then
begin
SearchNPC('隐花苔藓');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='佛罗伦多森林' then
begin
SearchNPC('盐巴');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='西部行省' then
begin
SearchNPC('康湖水檀');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='塔克拉沙漠' then
begin
SearchNPC('椰枣');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='落日沼泽' then
begin
SearchNPC('火浦珠');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='圣城' then //兽族开始
begin
SearchNPC('兽骨');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='阿尔卑斯湿地' then //兽族开始
begin
SearchNPC('隐花神仙掌');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='西雅海岸' then //兽族开始
begin
SearchNPC('贝壳');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='帝梵西' then //兽族开始
begin
SearchNPC('藓猕桃');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='凡贡森林' then //兽族开始
begin
SearchNPC('地精遗物');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='一线天' then //兽族开始
begin
SearchNPC('摇篮瓠');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='泰穆尔拉雅雪山' then //兽族开始
begin
SearchNPC('雪蕉');
if NPCFindBool=True then TalkNPC(NPCID);
SearchNPC('油瓜');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='特拉村' then //兽族开始
begin
SearchNPC('冰珠');
if NPCFindBool=True then TalkNPC(NPCID);
SearchNPC('油瓜');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='圣南平原' then //兽族开始
begin
SearchNPC('荔胶');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='卡瑞姆大平原' then //兽族开始
begin
SearchNPC('火山灰');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='荣誉战场(70)(中立)' then //兽族开始
begin
SearchNPC('剑座');
if NPCFindBool=True then TalkNPC(NPCID);
end;
if Pchar(GameMap)='荣誉战场(90)(中立)' then //兽族开始
begin
SearchNPC('剑座');
if NPCFindBool=True then TalkNPC(NPCID);
end;
end;
end;
////////////////////////按钮事件//////////////////////////////
procedure TForm1.Timer1Timer(Sender: TObject);
var
p : ^DWORD;
BeepTime:Integer;
begin
ZDFH();
p:=Pointer(GameBase+$0E4);
XY_X:=Integer(P^);
p:=Pointer(GameBase+$0E8);
XY_Y:=Integer(P^);
Label_XY.Caption:=(IntToStr(XY_X)+','+ IntToStr(XY_Y));
GameName:=Pointer(GameBase+$0AC); //读取名字
Label_Name.Caption:=('名:'+PChar(GameName));
GameMap:=Pointer(GameBase-$2bF8);//当前地图名啊
Label_Map.Caption:=('图:'+Pchar(GameMap));
p:=Pointer(GameBase+BloodBase);
if p^<10 then
begin
BeepTime:=BeepTime+1;
if BeepTime>5 then
begin
beep;
BeepTime:=0;
end;
end;
Label_blood.Caption:=('血:'+IntToStr(p^));
// SpeedMove();
Find_on_off();
// PassSxNum:=PassSxNum+1;
// if PassSxNum=150 then UnPassSx;
Form1.Label_Test.Caption:=('已运行:'+inttostr(ListBox1.ItemIndex)+'/'+inttostr(ListBox1.Items.Count));
end;
procedure TForm1.Timer_PauseTimer(Sender: TObject);
begin
PauseTime:=PauseTime-1;
Form1.Label_Test.Caption:='等待:'+inttostr(PauseTime);
if PauseTime<1 then
begin
Form1.ListBox1.ItemIndex:= Form1.ListBox1.ItemIndex+1;
Form1.Timer_Run.Enabled:=True;
Form1.Timer_Pause.Enabled:=False;
end;
end;
procedure TForm1.Timer_RunTimer(Sender: TObject);
begin
if Form1.ListBox1.ItemIndex=-1 then Form1.ListBox1.ItemIndex:=0;
脚本函数(@命令参数,Form1.ListBox1.Items[Form1.ListBox1.ItemIndex]);
脚本分支(命令参数);
if (Passmap=False) then
begin
脚本函数(@命令参数,Form1.ListBox1.Items[Form1.ListBox1.ItemIndex]);
脚本分支(命令参数);
if Form1.ListBox1.ItemIndex=Form1.ListBox1.count then 停止;
if ((Abs(XY_X-MOVE_X)<2) and (Abs(XY_Y-MOVE_Y)<2))=true then
Form1.ListBox1.ItemIndex:=Form1.ListBox1.ItemIndex+1;
Move;
end;
end;
procedure TForm1.CheckBox_Speed1Click(Sender: TObject);
begin
if (CheckBox_Speed1.Checked=True) then
begin
CheckBox_Speed2.Checked:=False;
CheckBox_Speed3.Checked:=False;
CheckBox_Speed4.Checked:=False;
SXSpeed:=$0000c8B8;
SpeedMove();
end;
end;
procedure TForm1.CheckBox_Speed2Click(Sender: TObject);
begin
if (CheckBox_Speed2.Checked=True) then
begin
CheckBox_Speed1.Checked:=False;
CheckBox_Speed3.Checked:=False;
CheckBox_Speed4.Checked:=False;
SXSpeed:=$00012cB8;
SpeedMove();
end;
end;
procedure TForm1.CheckBox_Speed3Click(Sender: TObject);
begin
if (CheckBox_Speed3.Checked=True) then
begin
CheckBox_Speed1.Checked:=False;
CheckBox_Speed2.Checked:=False;
CheckBox_Speed4.Checked:=False;
SXSpeed:=$000190B8;
SpeedMove();
end;
end;
procedure TForm1.CheckBox_Speed4Click(Sender: TObject);
begin
if (CheckBox_Speed4.Checked=True) then
begin
CheckBox_Speed1.Checked:=False;
CheckBox_Speed2.Checked:=False;
CheckBox_Speed3.Checked:=False;
SXSpeed:=$000258B8;
SpeedMove();
end;
end;
procedure TForm1.Label1Click(Sender: TObject);
begin
if Form1.Width=154 then
Form1.Width:=170
else
form1.Width:=154;
end;
procedure TForm1.Label_TestClick(Sender: TObject);
begin
Form1.ListBox1.ItemIndex:=Form1.ListBox1.Items.Count+1;
end;
procedure TForm1.SpeedButton_runClick(Sender: TObject);
begin
if ListBox1.ItemIndex<0 then ListBox1.ItemIndex:=-1;
form1.Timer_Run.Enabled:=true;
form1.Timer_Fix.Enabled:=true;
end;
procedure TForm1.SpeedButton_pauseClick(Sender: TObject);
begin
停止;
Form1.Timer_Pause.Enabled:=false;
end;
procedure ReadFileTxt;
var
i,a:integer;
begin
停止;
a:=0;{赋a值为0,以便按button1时读 列表行 的第一行}
Form1.ListBox1.Clear;{清除edit1的上一行内容}
列表行:=TStringlist.Create;
列表行.LoadFromFile(FileTxt);{读文件到列表行}
i:=列表行.Count;{获得列表行的count}
while a<i do{判断a是否为i,既不是列表行的未尾}
begin
Form1.ListBox1.Items.Add(列表行.Strings[a]);
a:=a+1;{a值加1,既为下一行}
end ;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
FileTxt:='1.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
FileTxt:='2.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
FileTxt:='3.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
FileTxt:='4.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton5Click(Sender: TObject);
begin
FileTxt:='5.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton6Click(Sender: TObject);
begin
FileTxt:='6.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton7Click(Sender: TObject);
begin
FileTxt:='7.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton8Click(Sender: TObject);
begin
FileTxt:='8.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton9Click(Sender: TObject);
begin
FileTxt:='9.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton10Click(Sender: TObject);
begin
FileTxt:='10.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton11Click(Sender: TObject);
begin
FileTxt:='11.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton12Click(Sender: TObject);
begin
FileTxt:='12.txt';
ReadFileTxt;
end;
procedure TForm1.SpeedButton_hideClick(Sender: TObject);
begin
form1.Visible:=False;
end;
procedure TForm1.SpeedButton_LoadClick(Sender: TObject);
begin
FileTxt:=inputbox('载入文件','请输入要载入的文件名',FileTxt);
ReadFileTxt;
end;
{var
i,a:integer;
begin
form1.Timer_run.Enabled:=false;
停止;
a:=0;//赋a值为0,以便按button1时读 列表行 的第一行
i:=0;
form1.OpenDialog1.Execute;
if fileexists(OpenDialog1.FileName) then
begin
ListBox1.Clear;//清除edit1的上一行内容
列表行:=TStringlist.Create;
列表行.LoadFromFile(OpenDialog1.FileName);//读文件到列表行
i:=列表行.Count;//获得列表行的count
end;
while a<i do//判断a是否为i,既不是列表行的未尾
begin
ListBox1.Items.Add(列表行.Strings[a]);
a:=a+1;//a值加1,既为下一行
end ;
end;
procedure FixZB;
begin
asm
mov ecx,GameBase
call FixCall
end
end;
}
end.
|
|