📄 frmdirectxunit.pas
字号:
raise exception.Create('Error while saving! (and I''m not going to tell you why!)');
end;
end;
end;
procedure Tfrmdirectx.ApplyTempkeys;
begin
tempkeys.configured:=true;
tempkeys.CEDir:=CheatEngineDir;
tempkeys.cewindow:=handle;
tempkeys.zoomlevel1:=StrToFloat(zoomlevel1.text);
tempkeys.zoomlevel2:=StrToFloat(zoomlevel2.text);
tempkeys.zoomlevel3:=StrToFloat(zoomlevel3.text);
tempkeys.zoomlevel4:=StrToFloat(zoomlevel4.text);
tempkeys.zoomlevel5:=StrToFloat(zoomlevel5.text);
tempkeys.zoomdelta:=StrToFloat(zoomdelta.Text);
tempkeys.lagdelta:=StrToInt(lagdelta.text);
tempkeys.lagtoset:=strtoint(lag.text);
tempkeys.setlag:=true;
tempkeys.pollinginterval:=StrToInt(editkeypolling.text);
if tempkeys.pollinginterval<0 then raise exception.create('Don''t set the key polling interval to a negative value. I havn''t figured out how to implement quantum mechanics in CE. (Yet!)');
tempkeys.aimsettings1:=aimfile1.text;
tempkeys.Aimsettings2:=aimfile2.Text;
tempkeys.aimsettings3:=aimfile3.Text;
tempkeys.callibrationmode:=checkbox2.checked;
tempkeys.setcallibration:=true;
tempkeys.mousecallibrationhorizontal1point:=strtofloat(mousecallibrationhorizontal1point.Text);
tempkeys.mousecallibrationhorizontal2point:=strtofloat(mousecallibrationhorizontal2point.Text);
tempkeys.mousecallibrationhorizontal5point:=strtofloat(mousecallibrationhorizontal5point.Text);
tempkeys.mousecallibrationhorizontal10point:=strtofloat(mousecallibrationhorizontal10point.Text);
tempkeys.mousecallibrationhorizontal20point:=strtofloat(mousecallibrationhorizontal20point.Text);
tempkeys.mousecallibrationhorizontal40point:=strtofloat(mousecallibrationhorizontal40point.Text);
tempkeys.mousecallibrationvertical1point:=strtofloat(mousecallibrationvertical1point.Text);
tempkeys.mousecallibrationvertical2point:=strtofloat(mousecallibrationvertical2point.Text);
tempkeys.mousecallibrationvertical5point:=strtofloat(mousecallibrationvertical5point.Text);
tempkeys.mousecallibrationvertical10point:=strtofloat(mousecallibrationvertical10point.Text);
tempkeys.mousecallibrationvertical20point:=strtofloat(mousecallibrationvertical20point.Text);
tempkeys.mousecallibrationvertical40point:=strtofloat(mousecallibrationvertical40point.Text);
tempkeys.HoldAutoaimtoggle:=rbkeepdown.Checked;
tempkeys.autoshoot:=autoshoot.Checked;
tempkeys.usefpslag:=usefpslag.checked;
end;
procedure TfrmDirectX.Button28Click(Sender: TObject);
begin
zeromemory(@tempkeys.loadaimsettingsfile[0],30);
loadaimsettingsfile.Text:=ConvertKeyComboToString(tempkeys.loadaimsettingsfile); //=''
loadaimsettingsfile.SetFocus
end;
procedure TfrmDirectX.Button29Click(Sender: TObject);
begin
zeromemory(@tempkeys.saveaimsettingsfile[0],30);
saveaimsettingsfile.Text:=ConvertKeyComboToString(tempkeys.saveaimsettingsfile); //=''
saveaimsettingsfile.SetFocus
end;
procedure TfrmDirectX.loadaimsettingsfileKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var i: integer;
begin
if tempkeys.loadaimsettingsfile[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.loadaimsettingsfile[i]=0 then
begin
tempkeys.loadaimsettingsfile[i]:=key;
break;
end else
if tempkeys.loadaimsettingsfile[i]=key then break;
end;
loadaimsettingsfile.Text:=ConvertKeyComboToString(tempkeys.loadaimsettingsfile);
end;
procedure TfrmDirectX.SaveaimsettingsfileKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var i: integer;
begin
if tempkeys.saveaimsettingsfile[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.saveaimsettingsfile[i]=0 then
begin
tempkeys.saveaimsettingsfile[i]:=key;
break;
end else
if tempkeys.saveaimsettingsfile[i]=key then break;
end;
saveaimsettingsfile.Text:=ConvertKeyComboToString(tempkeys.saveaimsettingsfile);
end;
procedure TfrmDirectX.Button16Click(Sender: TObject);
begin
zeromemory(@tempkeys.previoustexture[0],10);
previoustexture.Text:=ConvertKeyComboToString(tempkeys.previoustexture); //=''
previoustexture.SetFocus;
end;
procedure TfrmDirectX.Button30Click(Sender: TObject);
begin
zeromemory(@tempkeys.callibrationkey[0],10);
callibrationkey.Text:=ConvertKeyComboToString(tempkeys.callibrationkey); //=''
callibrationkey.SetFocus;
end;
procedure TfrmDirectX.callibrationkeyKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var i: integer;
begin
if tempkeys.callibrationkey[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.callibrationkey[i]=0 then
begin
tempkeys.callibrationkey[i]:=key;
break;
end else
if tempkeys.callibrationkey[i]=key then break;
end;
callibrationkey.Text:=ConvertKeyComboToString(tempkeys.callibrationkey);
end;
procedure TfrmDirectX.FormShow(Sender: TObject);
begin
keys.cewindow:=handle;
end;
procedure TfrmDirectX.rbtoggleoneffClick(Sender: TObject);
begin
if rbkeepdown.Checked then autoshoot.Enabled:=true else
begin
autoshoot.Checked:=false;
autoshoot.Enabled:=false;
end;
end;
procedure TfrmDirectX.Button31Click(Sender: TObject);
var addresspicker: tform;
addresslist: tlistbox;
i: integer;
begin
addresspicker:=tform.create(self);
try
with addresspicker do
begin
width:=250;
height:=200;
position:=poscreencenter;
caption:='Select the address';
borderstyle:=bsToolwindow;
addresslist:=tlistbox.Create(addresspicker);
with addresslist do
begin
addresslist.Width:=addresspicker.clientwidth;
addresslist.Height:=addresspicker.clientheight-30;
addresslist.Parent:=addresspicker;
for i:=0 to mainform.numberofrecords-1 do
items.Add(mainform.memrec[i].Description);
end;
with tbutton.create(self) do
begin
top:=addresspicker.clientheight-27;
left:=(addresspicker.ClientWidth div 2)-(width div 2);
caption:='OK';
modalresult:=mrok;
parent:=addresspicker;
end;
if addresspicker.ShowModal=mrok then
begin
i:=addresslist.ItemIndex;
if i=-1 then exit;
if mainform.memrec[i].VarType in [5,7,8] then raise exception.Create('This type can''t be used');
tempkeys.lagmemorytype:=mainform.memrec[i].VarType;
tempkeys.nrofoffsets:=0;
tempkeys.lagaddress:=mainform.memrec[i].Address;
if mainform.memrec[i].IsPointer then
begin
tempkeys.nrofoffsets:=length(mainform.memrec[i].pointers);
tempkeys.lagaddress:=mainform.memrec[i].pointers[length(mainform.memrec[i].pointers)-1].Address;
if tempkeys.nrofoffsets>=1 then tempkeys.offset1:=mainform.memrec[i].pointers[0].offset;
if tempkeys.nrofoffsets>=2 then tempkeys.offset2:=mainform.memrec[i].pointers[1].offset;
if tempkeys.nrofoffsets>=3 then tempkeys.offset3:=mainform.memrec[i].pointers[2].offset;
if tempkeys.nrofoffsets>=4 then tempkeys.offset4:=mainform.memrec[i].pointers[3].offset;
if tempkeys.nrofoffsets>=5 then tempkeys.offset5:=mainform.memrec[i].pointers[4].offset;
if tempkeys.nrofoffsets>=6 then tempkeys.offset6:=mainform.memrec[i].pointers[5].offset;
if tempkeys.nrofoffsets>=7 then tempkeys.offset7:=mainform.memrec[i].pointers[6].offset;
if tempkeys.nrofoffsets>=8 then tempkeys.offset8:=mainform.memrec[i].pointers[7].offset;
if tempkeys.nrofoffsets>=9 then tempkeys.offset9:=mainform.memrec[i].pointers[8].offset;
if tempkeys.nrofoffsets>=10 then tempkeys.offset10:=mainform.memrec[i].pointers[9].offset;
if tempkeys.nrofoffsets>=11 then tempkeys.offset11:=mainform.memrec[i].pointers[10].offset;
if tempkeys.nrofoffsets>=12 then tempkeys.offset12:=mainform.memrec[i].pointers[11].offset;
if tempkeys.nrofoffsets>=13 then tempkeys.offset13:=mainform.memrec[i].pointers[12].offset;
if tempkeys.nrofoffsets>=14 then tempkeys.offset14:=mainform.memrec[i].pointers[13].offset;
if tempkeys.nrofoffsets=15 then tempkeys.offset15:=mainform.memrec[i].pointers[14].offset;
if tempkeys.nrofoffsets>15 then
begin
tempkeys.nrofoffsets:=0;
raise exception.Create('A pointer address may not have more than 15 offsets');
end;
end;
end;
tempkeys.selectedlagrecord:=mainform.memrec[i].Description;
addresslabel.Caption:=mainform.memrec[i].Description;
end;
finally
addresspicker.Free;
end;
end;
procedure TfrmDirectX.getlagfrommemoryClick(Sender: TObject);
begin
tempkeys.getlagfrommemory:=getlagfrommemory.checked;
button31.enabled:=getlagfrommemory.checked;
addresslabel.Visible:=getlagfrommemory.checked;
end;
procedure TfrmDirectX.CheckBox2Click(Sender: TObject);
begin
if checkbox2.checked then
begin
label50.Enabled:=true;
saveaimsettingsfile.Enabled:=true;
button29.Enabled:=true;
label34.Enabled:=true;
previoustexture.Enabled:=true;
button16.Enabled:=true;
label35.Enabled:=true;
nexttexture.Enabled:=true;
button17.Enabled:=true;
label36.Enabled:=true;
locktexture.Enabled:=true;
button18.Enabled:=true;
label37.Enabled:=true;
label38.Enabled:=true;
label39.Enabled:=true;
label40.Enabled:=true;
label41.Enabled:=true;
label42.Enabled:=true;
button19.enabled:=true;
button20.enabled:=true;
button21.enabled:=true;
button22.enabled:=true;
button23.enabled:=true;
button24.Enabled:=true;
increasex.Enabled:=true;
increasey.Enabled:=true;
increasez.Enabled:=true;
decreasex.Enabled:=true;
decreasey.Enabled:=true;
decreasez.Enabled:=true;
label51.Enabled:=true;
callibrationkey.Enabled:=true;
button30.Enabled:=true;
end
else
begin
label50.Enabled:=false;
saveaimsettingsfile.Enabled:=false;
button29.Enabled:=false;
label34.Enabled:=false;
previoustexture.Enabled:=false;
button16.Enabled:=false;
label35.Enabled:=false;
nexttexture.Enabled:=false;
button17.Enabled:=false;
label36.Enabled:=false;
locktexture.Enabled:=false;
button18.Enabled:=false;
label37.Enabled:=false;
label38.Enabled:=false;
label39.Enabled:=false;
label40.Enabled:=false;
label41.Enabled:=false;
label42.Enabled:=false;
button19.enabled:=false;
button20.enabled:=false;
button21.enabled:=false;
button22.enabled:=false;
button23.enabled:=false;
button24.Enabled:=false;
increasex.Enabled:=false;
increasey.Enabled:=false;
increasez.Enabled:=false;
decreasex.Enabled:=false;
decreasey.Enabled:=false;
decreasez.Enabled:=false;
label51.Enabled:=false;
callibrationkey.Enabled:=false;
button30.Enabled:=false;
end;
end;
procedure TfrmDirectX.Button32Click(Sender: TObject);
begin
zeromemory(@tempkeys.wireframe[0],10);
wireframe.Text:=ConvertKeyComboToString(tempkeys.wireframe); //=''
wireframe.SetFocus;
end;
procedure TfrmDirectX.WireframeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var i: integer;
begin
if tempkeys.wireframe[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.wireframe[i]=0 then
begin
tempkeys.wireframe[i]:=key;
break;
end else
if tempkeys.wireframe[i]=key then break;
end;
wireframe.Text:=ConvertKeyComboToString(tempkeys.wireframe);
end;
procedure TfrmDirectX.ShowKeyListKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var i: integer;
begin
if tempkeys.ShowKeyList[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.ShowKeyList[i]=0 then
begin
tempkeys.ShowKeyList[i]:=key;
break;
end else
if tempkeys.ShowKeyList[i]=key then break;
end;
ShowKeyList.Text:=ConvertKeyComboToString(tempkeys.ShowKeyList);
end;
procedure TfrmDirectX.Button33Click(Sender: TObject);
begin
zeromemory(@tempkeys.ShowKeyList[0],10);
ShowKeyList.Text:=ConvertKeyComboToString(tempkeys.ShowKeyList); //=''
ShowKeyList.SetFocus;
end;
procedure TfrmDirectX.Button34Click(Sender: TObject);
begin
zeromemory(@tempkeys.SaveallTextures[0],10);
SaveallTextures.Text:=ConvertKeyComboToString(tempkeys.SaveallTextures); //=''
SaveallTextures.SetFocus;
end;
procedure TfrmDirectX.SaveAllTexturesKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var i: integer;
begin
if tempkeys.savealltextures[4]=0 then
begin
for i:=0 to 4 do
if tempkeys.savealltextures[i]=0 then
begin
tempkeys.savealltextures[i]:=key;
break;
end else
if tempkeys.savealltextures[i]=key then break;
end;
savealltextures.Text:=ConvertKeyComboToString(tempkeys.savealltextures);
end;
procedure tfrmdirectx.setkey(key:word; var tempkeysitem: tkeycombo;ed:tedit);
var i: integer;
begin
if tempkeysitem[4]=0 then
begin
for i:=0 to 4 do
if tempkeysitem[i]=0 then
begin
tempkeysitem[i]:=key;
break;
end else
if tempkeysitem[i]=key then break;
end;
ed.Text:=ConvertKeyComboToString(tempkeysitem);
end;
procedure TfrmDirectX.LeftMouse1Click(Sender: TObject);
var key: word;
begin
case (sender as tmenuitem).Tag of
0: key:=vk_lbutton;
1: key:=vk_mbutton;
2: key:=vk_rbutton;
end;
if zoom1.Focused then setkey(key,tempkeys.zoom1,zoom1);
if zoom2.focused then setkey(key,tempkeys.zoom2,zoom2);
if zoom3.focused then setkey(key,tempkeys.zoom3,zoom3);
if zoom4.focused then setkey(key,tempkeys.zoom4,zoom4);
if zoom5.focused then setkey(key,tempkeys.zoom5,zoom5);
if zoomin.focused then setkey(key,tempkeys.zoomin,zoomin);
if zoomout.focused then setkey(key,tempkeys.zoomout,zoomout);
if nozoom.focused then setkey(key,tempkeys.nozoom,nozoom);
if fog.focused then setkey(key,tempkeys.fog,fog);
if zbuffer.focused then setkey(key,tempkeys.zbuffer,zbuffer);
if lighting.focused then setkey(key,tempkeys.lighting,lighting);
if wireframe.focused then setkey(key,tempkeys.wireframe,wireframe);
if showkeylist.focused then setkey(key,tempkeys.showkeylist,showkeylist);
if saveAllTextures.focused then setkey(key,tempkeys.savealltextures,savealltextures);
if setaimsetting1.focused then setkey(key,tempkeys.setaimsetting1,setaimsetting1);
if setaimsetting2.focused then setkey(key,tempkeys.setaimsetting2,setaimsetting2);
if setaimsetting3.focused then setkey(key,tempkeys.setaimsetting3,setaimsetting3);
if loadaimsettingsfile.focused then setkey(key,tempkeys.loadaimsettingsfile,loadaimsettingsfile);
if saveaimsettingsfile.focused then setkey(key,tempkeys.saveaimsettingsfile,saveaimsettingsfile);
if autoaimtoggle.focused then setkey(key,tempkeys.autoaimtoggle,autoaimtoggle);
if increaselag.focused then setkey(key,tempkeys.increaselag,increaselag);
if decreaselag.focused then setkey(key,tempkeys.decreaselag,decreaselag);
if previoustexture.focused then setkey(key,tempkeys.previoustexture,previoustexture);
if nexttexture.focused then setkey(key,tempkeys.nexttexture,nexttexture);
if locktexture.focused then setkey(key,tempkeys.locktexture,locktexture);
if increasex.focused then setkey(key,tempkeys.increasex,increasex);
if increasey.Focused then setkey(key,tempkeys.increasey,increasey);
if increasez.Focused then setkey(key,tempkeys.increasez,increasez);
if decreasex.focused then setkey(key,tempkeys.decreasex,increasex);
if decreasey.Focused then setkey(key,tempkeys.decreasey,increasey);
if decreasez.Focused then setkey(key,tempkeys.decreasez,increasez);
if callibrationkey.Focused then setkey(key,tempkeys.callibrationkey,callibrationkey);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -