function TForm1.LoadLang:Boolean;
begin
if Length(ProgLang)<2 then ProgLang:='EN';
with LangFile do
begin
LSost1.Caption :=ReadString(ProgLang,'1','Status');
LLoginAkk.Caption :=ReadString(ProgLang,'2','Login');
LPassAkk.Caption :=ReadString(ProgLang,'3','Pass');
LNastr.Caption :=ReadString(ProgLang,'4','Settings room');
LRName.Caption :=ReadString(ProgLang,'5','Name');
LRPass.Caption :=ReadString(ProgLang,'6','Pass');
LMin.Caption :=ReadString(ProgLang,'7','Min. QI');
LMax.Caption :=ReadString(ProgLang,'8','Max. QI');
LMod.Caption :=ReadString(ProgLang,'9','Mod');
LGCount.Caption :=ReadString(ProgLang,'10','Count players');
LPravila.Caption :=ReadString(ProgLang,'11','Tournament rules');
CBMute.Caption :=ReadString(ProgLang,'12','Auto mute');
AutoKick.Caption :=ReadString(ProgLang,'13','Auto kick');
TabSheet1.Caption :=ReadString(ProgLang,'14',' Settings ');
TabSheet2.Caption :=ReadString(ProgLang,'15',' Log ');
TabSheet4.Caption :=ReadString(ProgLang,'16',' Players ');
LLong.Caption :=ReadString(ProgLang,'17','When viewing the logs slowing down the program');
end;
end;
...
procedure TForm1.FormCreate(Sender: TObject);
var FileCreate:TextFile;
z,md:string;
begin
ZS:=0;
ENCount:=0;
StatTour:=0;
L1:=TStringList.Create;
TL1:=TStringList.Create;
MLog1:=TStringList.Create;
KickIP:=TStringList.Create;
KickName:=TStringList.Create;
WinList:=TStringList.Create;
application.OnMinimize:=winmanager;
md:=extractfilepath(paramstr(0))+'\Mod';
if DirectoryExists(md)=False then CreateDirectory(PWChar(md),0);
md:=extractfilepath(paramstr(0))+'\Log';
if DirectoryExists(md)=False then CreateDirectory(PWChar(md),0);
md:=extractfilepath(paramstr(0))+'\Log\Wins';
if DirectoryExists(md)=False then CreateDirectory(PWChar(md),0);
SpisMod;
WinDir:=extractfilepath(paramstr(0))+'\Log\Wins\'+DateToStr(Date)+'.ini';
if FileExists(WinDir)=true then WinList.LoadFromFile(WinDir);
WinDir:=extractfilepath(paramstr(0))+'\MuteList.ini';
if FileExists(WinDir)=true then Mmute.Lines.LoadFromFile(WinDir);
WinDir:=extractfilepath(paramstr(0))+'\PravList.ini';
if FileExists(WinDir)=true then MPrav.Lines.LoadFromFile(WinDir);
LangFile:=TIniFile.Create(extractfilepath(paramstr(0))+'\Lang.ini');
IniFile:=TIniFile.Create(extractfilepath(paramstr(0))+'\Set.ini');
ProgLang:=IniFile.ReadString ('Settings','Lang','EN');
if Length(ProgLang)<2 then ProgLang:='EN';
LoadLang;
Log1.Text:=IniFile.ReadString ('Settings','Player name','');
Pas1.Text:=IniFile.ReadString ('Settings','Player pass','');
EGCount.Text:=IniFile.ReadString ('Settings','Count Players','0');
RName.Text:=IniFile.ReadString ('Settings','Room Name','');
RPass.Text:=IniFile.ReadString ('Settings','Room Pass','');
RMin.Text:=IniFile.ReadString ('Settings','Min QI','');
RMax.Text:=IniFile.ReadString ('Settings','Max QI','');
RMod.Text:=IniFile.ReadString ('Settings','Mod','judo.tbm');
IP1.Text:=IniFile.ReadString ('Settings','IP','66.230.224.106');
Port1.Text:=IniFile.ReadString ('Settings','Port','20265');
CBMute.Checked:=IniFile.ReadBool ('Settings','Mute',True);
AutoKick.Checked:=IniFile.ReadBool('Settings','Kick',True);
IdIRC1.ConnectTimeout:=10000;
GetFileVersion(paramstr(0),inf[1],inf[2],inf[3],inf[4]);
Form1.Caption:=Format('Tournament Bot by ZBEP v: %d.%d.%d.%d',[inf[1],inf[2],inf[3],inf[4]]);
end;