Показать сообщение отдельно
Старый 22.04.2009, 00:24   #3
Пользователь
 
Аватар для Name4Me
 
Регистрация: 17.06.2008
Сообщений: 44
Сказал Спасибо: 7
Имеет 19 спасибок в 9 сообщенях
Name4Me пока неопределено
По умолчанию

delphi Код:
unit OtherTypes; interface uses Windows,Classes; Type   TBaff = Record     public     SkillID:integer;     LTU:DWORD;     Duration:integer;     End;   TBaffList = Record     private       items:array[0..36] of TBaff;       Count:integer;       function IFID(ID: Integer): Integer;       function GetR(ID: Integer): boolean;       function GetItem(ID: Integer): TBaff;     public       Procedure SLTU(ID:Integer;D:integer = 1000);       Property Active[ID: Integer]:boolean read GetR;       Property Itemi[ID: Integer]:TBaff read GetItem;     End;   TMyDelay = Record     private       Delay:DWord;       LTU:DWord;       function GetR: boolean;     public       Procedure SLTU(D:integer = 1000);       Property Active:boolean read GetR;     End;   TMyMacroAction = Record       md:TMyDelay;       CA:DWord;       Count:DWord;       AList:string;       PN:integer;       isComplete:Boolean;       Procedure SetAction (PointN:integer;ActionList:string);     End; implementation {------------------------------------------------------------------TBaffList---} function TBaffList.GetItem(ID: Integer): TBaff; var i:integer;  b:TBaff; begin   Result:=b;   i:=IFID(ID);   if i<>-1 then Result:=Items[i]; end; function TBaffList.GetR(ID: Integer): boolean; var i:integer; begin   Result:=false;   i:=IFID(ID);   if (i<>-1) and (((items[i].Duration-(GetTickCount-items[i].LTU)/1000)>20)) then Result:=True; end; procedure TBaffList.SLTU(ID:Integer;D: integer); var i:integer; begin   i:=IFID(ID);   if i=-1 then Begin     items[Count].SkillID:=ID;     items[Count].Duration:=D;     items[Count].LTU:=GetTickCount;     inc(Count);     End else Begin       items[i].Duration:=D;       items[i].LTU:=GetTickCount;       End; end; function TBaffList.IFID(ID: Integer): Integer; var i:integer; begin   Result:=-1;   i:=0;   while (Result=-1) and (i<Count) do     if items[i].SkillID=ID then  Result:=i else inc(i); end; {-------------------------------------------------------------------TMyDelay---} function TMyDelay.GetR: boolean; begin   Result := false;   if LTU+Delay<GetTickCount then Result := True; end; procedure TMyDelay.SLTU(D:integer = 1000); begin   Delay:=D;   LTU:=GetTickCount; end; { TMyMacroAction } procedure TMyMacroAction.SetAction(PointN:integer;ActionList:string); var ml:TStrings; begin   ml:=TstringList.Create;   isComplete:=false;   PN:=PointN;   CA:=0;   AList:=ActionList;   ml.Text:=ActionList;   Count:=ml.Count;   ml.Free; end; end.

Добавлено через 1 минуту
delphi Код:
unit MsbForm; interface                           uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,   Dialogs, ExtCtrls, StdCtrls, ComCtrls,    Gauges, ToolWin, Buttons, ImgList,DateUtils, Menus,   msbu, Spin, Tabs, DockTabSet, ButtonGroup; type   TForm2 = class(TForm)     PageControl1: TPageControl;     TabSheet1: TTabSheet;     TBR: TTrackBar;     Shp1: TShape;     Panel1: TPanel;     ProgressBar1: TProgressBar;     TabSheet3: TTabSheet;     Memo1: TMemo;     TabSheet4: TTabSheet;     TabSheet5: TTabSheet;     ImageList1: TImageList;     PageControl2: TPageControl;     TabSheet7: TTabSheet;     Gauge4: TGauge;     Gauge5: TGauge;     Gauge6: TGauge;     Button3: TButton;     CheckBox2: TCheckBox;     CheckBox1: TCheckBox;     Gauge3: TGauge;     Timer1: TTimer;     Panel2: TPanel;     Label1: TLabel;     Label2: TLabel;     Gauge1: TGauge;     Panel3: TPanel;     CheckBox3: TCheckBox;     CheckBox4: TCheckBox;     CheckBox5: TCheckBox;     CheckBox6: TCheckBox;     CheckBox7: TCheckBox;     CheckBox8: TCheckBox;     CheckBox9: TCheckBox;     CheckBox10: TCheckBox;     StatusBar1: TStatusBar;     Label3: TLabel;     RadioGroup1: TRadioGroup;     RadioGroup2: TRadioGroup;     PM: TPopupMenu;     FBUF1: TMenuItem;     MBuf1: TMenuItem;     AllBuF1: TMenuItem;     ADD1: TMenuItem;     Remove1: TMenuItem;     FBuf2: TMenuItem;     MBuf2: TMenuItem;     AllBuf2: TMenuItem;     Ignor1: TMenuItem;     AutoBuff1: TMenuItem;     MAS1: TMenuItem;     MDS1: TMenuItem;     MBS1: TMenuItem;     SetLiader1: TMenuItem;     WarList1: TMenuItem;     FrendList1: TMenuItem;     PB: TPaintBox;     TrackBar3: TTrackBar;     Button2: TButton;     RadioGroup3: TRadioGroup;     MCS1: TMenuItem;     Button1: TButton;     OPD: TOpenDialog;     PageControl3: TPageControl;     TabSheet2: TTabSheet;     ListBox1: TListBox;     TabSheet6: TTabSheet;     TabSheet8: TTabSheet;     TabSheet9: TTabSheet;     SpinEdit1: TSpinEdit;     procedure Ncr(id:integer);     procedure DN(id:integer);     procedure StUpdate(id:integer);     procedure MyRGClick(Sender: TObject);     procedure MyBTClick(Sender: TObject);     procedure MySPClick(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer);     procedure MyTimer(Sender: TObject);     procedure FBUF1Click(Sender: TObject);     procedure PMPopup(Sender: TObject);     procedure CheckBox1Click(Sender: TObject);     procedure TrackBar3Change(Sender: TObject);     procedure MySpinEditChange(Sender: TObject);     procedure MyTreeViewClick(Sender: TObject);     procedure MyTreeViewCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode;       State: TCustomDrawState; var DefaultDraw: Boolean);     procedure MyTreeViewEdited(Sender: TObject; Node: TTreeNode; var S: string);     procedure Timer1Timer(Sender: TObject);     procedure Button1Click(Sender: TObject);     procedure Button2Click(Sender: TObject);     procedure Button3Click(Sender: TObject);     procedure SpinEdit1Change(Sender: TObject);     procedure RadioGroup3Click(Sender: TObject); end; var   Form2: TForm2;   mx,my:integer;   lb:bool; implementation uses unit2,AAction,Other_Func,TNpcs; {$R *.dfm} procedure TForm2.MySpinEditChange(Sender: TObject); begin   with Sender as TSpinEdit do User[strtoint(Name[3])].rk:=Value; end; procedure TForm2.FBUF1Click(Sender: TObject); Var Cid:integer; begin   cid:=strtoint((PM.PopupComponent as TComboBox).Name[3]);   with (PM.PopupComponent as TComboBox) do   with User[cid] do   Case TMenuItem(Sender).Tag of     //28: User[id].SList.IgnorList.Add(User[id].SList.SkilList[(PM.PopupComponent as TComboBox).ItemIndex]);     24: with SkilList[SkilList.IFName(SelText)] do       if ABList.IndexOfName(inttostr(id))=-1 then ABList.Add(inttostr(id)+'='+Name);     27: with SkilList[SkilList.IFName(SelText)] do       if ABList.IndexOfName(inttostr(id))<>-1 then ABList.Delete(ABList.IndexOfName(inttostr(id)));     29: MAS:=SkilList[SkilList.IFName(SelText)].ID;     38: MCS:=SkilList[SkilList.IFName(SelText)].ID;     //30: User[id].mds:=strtoint(User[id].SList.SkilList.Names[(PM.PopupComponent as TComboBox).ItemIndex]);     //31: User[id].mbs:=strtoint(User[id].SList.SkilList.Names[(PM.PopupComponent as TComboBox).ItemIndex]);     //33: User[id].LiderInfo.ID:=User[id].CharList.ValueFromIndex[(PM.PopupComponent as TComboBox).ItemIndex];   End; end; procedure TForm2.SpinEdit1Change(Sender: TObject); begin   User[RadioGroup3.ItemIndex].CurentPN:=SpinEdit1.Value; end; procedure TForm2.StUpdate(id:integer); Var i:integer; var CI:TTreeNode; Begin try   if (User[id]<>nil) and(User[id].Online) and visible then with User[id] do   with PageControl2 do     with  TTabSheet(FindComponent('NT'+inttostr(id))) do Begin       Caption:=User[id].Name+'['+inttostr(ClassID)+']';       TLabel(FindComponent('LB'+inttostr(id))).Caption:=inttostr(ObjectID);       TSpinEdit(FindComponent('SE'+inttostr(id))).Value:=rk;       TLabel(FindComponent('LBT'+inttostr(id))).Caption:=inttostr(CurentT.ID)+'-['+inttostr(CurentT.HP)+'/'+inttostr(CurentT.MaxHP)+']';       if CurentT.spoiled then TLabel(FindComponent('LBT'+inttostr(id))).Caption:=TLabel(FindComponent('LBT'+inttostr(id))).Caption+'+';       TGauge(FindComponent('CG')).MaxValue:=MaxCP;       TGauge(FindComponent('CG')).Progress:=CP;       TGauge(FindComponent('HG')).MaxValue:=MaxHP;       TGauge(FindComponent('HG')).Progress:=HP;       TGauge(FindComponent('MG')).MaxValue:=MaxMP;       TGauge(FindComponent('MG')).Progress:=MP;       TGauge(FindComponent('HGT')).MaxValue:=CurentT.MaxHP;       TGauge(FindComponent('HGT')).Progress:=CurentT.HP;       //-------------------------------------------------------------SkilList---       if User[id].SkilList.Count<>0 then with TComboBox(FindComponent('SL'+inttostr(id))) do Begin         if Items.count<>User[id].SkilList.Count then Begin           Clear;           for I := 0 to User[id].SkilList.Count-1 do Items.Add(User[id].SkilList[i].Name);           End;         End;       //------------------------------------------------------------------------       TRadioGroup(FindComponent('RG1'+inttostr(id))).Caption:='HP ['+inttostr(IList.Itemi[HPiID].Count)+']';       if User[id].HPiID = 1060 then TRadioGroup(FindComponent('RG1'+inttostr(id))).ItemIndex:=0;       if User[id].HPiID = 1061 then TRadioGroup(FindComponent('RG1'+inttostr(id))).ItemIndex:=1;       if User[id].HPiID = 1539 then TRadioGroup(FindComponent('RG1'+inttostr(id))).ItemIndex:=2;       TRadioGroup(FindComponent('RG2'+inttostr(id))).Caption:='MP ['+inttostr(IList.Itemi[MPiID].Count)+']';       if User[id].MPiID = 726 then TRadioGroup (FindComponent('RG2'+inttostr(id))).ItemIndex:=0;       if User[id].MPiID = 728 then TRadioGroup (FindComponent('RG2'+inttostr(id))).ItemIndex:=1;       if User[id].isInCombat then TShape(FindComponent('SH'+inttostr(id)+'1')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'1')).Brush.Color:=ClWhite;       if User[id].IsCPUse then TShape(FindComponent('SH'+inttostr(id)+'2')).Brush.Color:=ClYellow         else TShape(FindComponent('SH'+inttostr(id)+'2')).Brush.Color:=ClWhite;       if User[id].IsHPUse then TShape(FindComponent('SH'+inttostr(id)+'3')).Brush.Color:=ClRed         else TShape(FindComponent('SH'+inttostr(id)+'3')).Brush.Color:=ClWhite;       if User[id].IsMPUse then TShape(FindComponent('SH'+inttostr(id)+'4')).Brush.Color:=ClBlue         else TShape(FindComponent('SH'+inttostr(id)+'4')).Brush.Color:=ClWhite;       if User[id].CurentT.isInCurse then TShape(FindComponent('SH'+inttostr(id)+'5')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'5')).Brush.Color:=ClWhite;       if User[id].isInMTP then TShape(FindComponent('SH'+inttostr(id)+'6')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'6')).Brush.Color:=ClWhite;       if isInHold then TShape(FindComponent('SH'+inttostr(id)+'7')).Brush.Color:=ClBlue         else TShape(FindComponent('SH'+inttostr(id)+'7')).Brush.Color:=ClWhite;       if User[id].isInHeal then TShape(FindComponent('SH'+inttostr(id)+'8')).Brush.Color:=ClRed         else TShape(FindComponent('SH'+inttostr(id)+'8')).Brush.Color:=ClWhite;       if User[id].isInSBaf then TShape(FindComponent('SH'+inttostr(id)+'9')).Brush.Color:=ClBlue         else TShape(FindComponent('SH'+inttostr(id)+'9')).Brush.Color:=ClWhite;       if User[id].isInSweep then TShape(FindComponent('SH'+inttostr(id)+'10')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'10')).Brush.Color:=ClWhite;       if User[id].OnAutoBaf then TShape(FindComponent('SH'+inttostr(id)+'11')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'11')).Brush.Color:=ClWhite;       if User[id].OnPartyBaf then TShape(FindComponent('SH'+inttostr(id)+'12')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'12')).Brush.Color:=ClWhite;       if User[id].OnSelfBaf then TShape(FindComponent('SH'+inttostr(id)+'13')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'13')).Brush.Color:=ClWhite;       if User[id].OnAutoAtack then TShape(FindComponent('SH'+inttostr(id)+'14')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'14')).Brush.Color:=ClWhite;       if User[id].OnAutoPickUp then TShape(FindComponent('SH'+inttostr(id)+'15')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'15')).Brush.Color:=ClWhite;       if User[id].OnAutoAssist then TShape(FindComponent('SH'+inttostr(id)+'16')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'16')).Brush.Color:=ClWhite;       if User[id].OnMoveToLiader then TShape(FindComponent('SH'+inttostr(id)+'17')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'17')).Brush.Color:=ClWhite;       if User[id].OnAutoMTT then TShape(FindComponent('SH'+inttostr(id)+'23')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'23')).Brush.Color:=ClWhite;       if status[6]='+' then TShape(FindComponent('SH'+inttostr(id)+'24')).Brush.Color:=clFuchsia         else TShape(FindComponent('SH'+inttostr(id)+'24')).Brush.Color:=ClWhite;       if User[id].INPU then TShape(FindComponent('SH'+inttostr(id)+'19')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'19')).Brush.Color:=ClWhite;       if User[id].INKT then TShape(FindComponent('SH'+inttostr(id)+'21')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'21')).Brush.Color:=ClWhite;       if User[id].OnAutoOFF then TShape(FindComponent('SH'+inttostr(id)+'22')).Brush.Color:=Clgreen         else TShape(FindComponent('SH'+inttostr(id)+'22')).Brush.Color:=ClWhite;            {       with TTreeView(FindComponent('TV'+inttostr(id))).Items do Begin         CI:=GetFirstNode;         while CI<>nil do Begin           if (CI.Text='[UserInfo]') then Begin               if Lider.isInCombat then CI.Item[0].Text:='Lider ID: '+inttostr(Lider.ID)+' ! ['+inttostr(Lider.DTT)+']'                 else CI.Item[0].Text:='Lider ID: '+inttostr(Lider.ID)+' ['+inttostr(Lider.DTT)+']';               CI.Item[1].Text:='MAS ['+inttostr(Mas)+']';               CI.Item[2].Text:='MCS ['+inttostr(Mcs)+']';               End;           if (CI.Text='[Party list]') and (PartyList.Count>0) and (PartyList.Count<>CI.Count) then             for I := 0 to NpcList.Count - 1 do Begin               if CI.Count<PartyList.Count then AddChild(CI,PartyList[i].Name);               CI.Item[i].Text:=PartyList[i].Name+' --> '+inttostr(PartyList[i].Dist);               CI.Item[i].SelectedIndex:=PartyList[i].ObjectID;               if CI.Count>PartyList.Count then Delete(CI.Item[PartyList.Count]);               End;           if (CI.Text='[NPC list]') and (NpcList.Count>0) then Begin             NpcList.Sort(@MyNPCSort);             for I := 0 to NpcList.Count - 1 do Begin               if CI.Count<NpcList.Count then AddChild(CI,'');               CI.Item[i].Text:=NpcList[i].NpcName+' ['+inttostr(NpcList[i].NpcID)+'] --> '+inttostr(NpcList[i].Dist);               CI.Item[i].SelectedIndex:=NpcList[i].ObjectID;               CI.Item[i].StateIndex:=NpcList[i].NpcID;               if CI.Count>NpcList.Count then Delete(CI.Item[NpcList.Count]);               End;             End;           //---------------------------------------------------------CharList---           if (CI.Text='[Char list]') and (CharList.Count>0) and (CharList.Count<>CI.Count) then             for I := 0 to CharList.Count - 1 do Begin               if CI.Count<CharList.Count then AddChild(CI,CharList[i].Name);               CI.Item[i].Text:=CharList[i].Name;               CI.Item[i].SelectedIndex:=CharList[i].ObjectID;               CI.Item[i].StateIndex:=CharList[i].ClassID;               if CI.Count>CharList.Count then Delete(CI.Item[CharList.Count]);               End;            if (CI.Text='[ATList]') and (ATList.Count>0) then             for I := 0 to ATList.Count - 1 do Begin               if CI.Count<ATList.Count then AddChild(CI,ATList[i]);               CI.Item[i].Text:=ATList[i];               CI.Item[i].SelectedIndex:=StrToInt(ATList[i]);               if CI.Count>ATList.Count then Delete(CI.Item[ATList.Count]);               End;            if (CI.Text='[ItemList]') and (IList.Count>0) then             for I := 0 to IList.Count - 1 do Begin               if CI.Count<IList.Count then AddChild(CI,'');               if itid.Values[inttostr(IList[i].ID)]<>'' then                 CI.Item[i].Text:=itid.Values[inttostr(IList[i].ID)]+' ['+inttostr(IList[i].Count)+']'                 else CI.Item[i].Text:='['+inttostr(IList[i].ID)+']'+' ['+inttostr(IList[i].Count)+']';               //CI.Item[i].SelectedIndex:=StrToInt(IList[i]);               if CI.Count>IList.Count then Delete(CI.Item[IList.Count]);               End;           CI:=CI.GetNext;           End;         End;       //------------------------------------------------------------------------       }           End;   except on E : Exception do     ShowMessage('ОШИБКА StUpdate:'+E.ClassName+' ошибка: '+E.Message);   end; End; procedure TForm2.Timer1Timer(Sender: TObject); Var CID,i:integer;   mt:real; begin Try   CID:=RadioGroup3.ItemIndex;   with PB.Canvas do with User[CID] do Begin     Brush.Color := ClWhite;     FillRect(ClipRect);       if Treck.size>1 then for i:= 1 to Treck.size do begin       Pen.Color:=ClBlue;       //map.LoadFromFile(GetCurrentDir+'\Treks\Atrei1.trk');       Pen.Color:=ClRed;       Pen.Width:=1;       with  User[CID].Treck do Begin         mt:=(350/mult);         Font.Size:=4;         TextOut(round((maxx-Point[i].x)*mt)+15,10+round((maxy-Point[i].y)*mt),Point[i].Name);         if i>1 then Begin           MoveTo(round((maxx-Point[i-1].x)*mt)+15,10+round((maxy-Point[i-1].y)*mt));           LineTo(round((maxx-Point[i].x)*mt)+15,10+round((maxy-Point[i].y)*mt));           End;         //Pen.Color:=cllime;         //PB.Canvas.Brush.Style:=bsSolid;         Brush.Color:=cllime;         Ellipse(round((maxx-x)*mt)+11,6+round((maxy-y)*mt),round((maxx-x)*mt)+19,14+round((maxy-y)*mt));         FloodFill(round((maxx-x)*mt)+15,10+round((maxy-y)*mt),cllime,fsBorder);         Brush.Color := ClWhite;         End;       End;       Pen.Color:=ClGreen;       Font.Size:=5;       TextOut(5,2,'Curent poin: '+inttostr(CurentPN));       TextOut(5,15,'Treck Size: '+inttostr(Treck.size));   End;   except on E : Exception do     ShowMessage('ОШИБКА Timer1Timer:'+E.ClassName+' ошибка: '+E.Message);   End; end; procedure TForm2.TrackBar3Change(Sender: TObject); begin   Form2.AlphaBlendValue:=TrackBar3.Position; end; procedure TForm2.MyTreeViewEdited(Sender: TObject; Node: TTreeNode;   var S: string); begin   {if Node.StateIndex>0 then Begin     if npid.IndexOfName(inttostr(Node.StateIndex))=-1 then npid.Add(inttostr(Node.StateIndex)+'='+s);     npid.SaveToFile('npcsid.ini');     End; Caption:=s;} end; procedure TForm2.MyTreeViewCustomDrawItem(Sender: TCustomTreeView;   Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);  Var MC:TColor; Begin   with Sender as TTreeView do     if (Node.HasAsParent(Node)) and (Node.Parent.Text='[Char list]') then Begin       mc:=Canvas.Pen.Color;       case Node.StateIndex of         16: Canvas.Pen.Color := clSkyBlue;         97: Canvas.Pen.Color := clSkyBlue;         116: Canvas.Pen.Color := clFuchsia;         else Canvas.Pen.Color := mc;         End;       End; End; procedure TForm2.MyTreeViewClick(Sender: TObject); Var CID:integer; begin   with Sender as TTreeView do Begin     cid:=strtoint(name[3]);     if Selected.SelectedIndex>0 then STS(cid,'1f'+anti4HEX(Selected.SelectedIndex)+'00000000000000000000000001'); //Select     //Caption:=Selected.Text+inttostr(Selected.Index);     End; end; procedure TForm2.Ncr; Var   i:integer;   sCID:string;   mp,p:TComponent; begin   sCID:=inttostr(id);   with TTabSheet.Create(PageControl2) do begin     Name:='NT'+sCID;     Caption:=User[id].Name;     PageControl:=PageControl2;     end;   mp:=PageControl2.FindComponent('NT'+sCID);   with TPageControl.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='PGC'+sCID;     Width:=380;     Height:=454;     top:=215;     Left:=3;     end;   //End;   p:=mp.FindComponent('PGC'+sCID);   with TTabSheet.Create(p) do begin     Name:='PG1';     Caption:='NPC List';     PageControl:=p as TPageControl;     end;   with TButton.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='MB'+sCID;     caption:='On';     Width:=30;     Height:=17;     top:=3;     Left:=3;     OnClick:=MyBTClick;   end;   with TSpinEdit.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='SE'+sCID;     Width:=60;     Height:=22;     top:=165;     Left:=3;     OnChange:=MySpinEditChange;     ShowHint:=true;     Hint:='Radius Kacha';     end;   with TComboBox.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='SL'+sCID;     top:=190;     PopupMenu:=PM;     Text:='';     Width:=158;     Left:=3;   end;   for i:=1 to 24 do with TShape.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='SH'+sCID+inttostr(i);     Width:=10;     Height:=10;     ShowHint:=true;     OnMouseDown:=MySPClick;     Tag:=i;     case i of       1:Hint:='IsInCombat';       2:Hint:='IsCPUse';       3:Hint:='IsHPUse';       4:Hint:='IsMPUse';       5:Hint:='TargetIsInCurse';       6:Hint:='MoveToPoint';       7:Hint:='isInHold';       8:Hint:='isInHeal';       9:Hint:='isInSBaf';       10:Hint:='isInSweep';       11:Hint:='OnAutoBaf';       12:Hint:='OnPartyBaf';       13:Hint:='OnSelfBaf';       14:Hint:='OnAutoAtack';       15:Hint:='OnAutoPickUp';       16:Hint:='OnAutoAssist';       17:Hint:='OnMoveToLiader';       18:Hint:='INA';       19:Hint:='INPU';       20:Hint:='INAA';       21:Hint:='INKT';       22:Hint:='OnAutoOFF';       23:Hint:='';       24:Hint:='Mistik';       end;     case i of       1..40: Begin         Top:=3;         Left:=40+i*13;         End;       end;   end;   with TLabel.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='LB'+sCID;     top:=25;     Left:=3;   end;   with TLabel.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='LBT'+sCID;     top:=63;     Left:=3;   end;   for i:=1 to 4 do   with TGauge.Create(mp) do begin     Parent:=mp as TTabSheet;     Case i of       1: begin           Name:='CG';           ForeColor:=ClYellow;           Top:=40;         end;       2: begin           Name:='HG';           ForeColor:=ClRed;           Top:=47;         end;       3: begin           Name:='MG';           ForeColor:=ClBlue;           Top:=54;         end;       4: begin           Name:='HGT';           ForeColor:=ClRed;           Top:=78;         end     end;     ShowText:=False;     Width:=158;     Height:=6;     Left:=3;   end;   for i:=1 to 2 do   with TRadioGroup.Create(mp) do begin     Parent:=mp as TTabSheet;     Name:='RG'+inttostr(i)+sCID;     Width:=80;     Height:=60;     Left:=3+85*(i-1);     Top:=95;     tag:=i;     case i of       1:Begin         Caption:='HP';         items.Add('LHP'); items.Add('HP'); items.Add('GHP');       End;       2:Begin         Caption:='MP';         items.Add('MP'); items.Add('GMP');       End;     End;     OnClick:=MyRGClick;   end;   with TTimer.Create(mp) do begin     Name:='MT'+sCID;     interval:=100;     ontimer:=MyTimer;     Enabled:=True;   end; End; procedure TForm2.PMPopup(Sender: TObject); var i:integer; begin if pos('UL',TPopupMenu(Sender).PopupComponent.name)<>0 then   for i := 0 to TPopupMenu(Sender).Items.Count - 1 do case TPopupMenu(Sender).Items[i].Tag of     33..35: TPopupMenu(Sender).Items[i].Visible:=true;     end   else for i := 0 to TPopupMenu(Sender).Items.Count - 1 do case TPopupMenu(Sender).Items[i].Tag of     33..35: TPopupMenu(Sender).Items[i].Visible:=false;   end; if pos('SL',TPopupMenu(Sender).PopupComponent.name)<>0 then   for i := 0 to TPopupMenu(Sender).Items.Count - 1 do case TPopupMenu(Sender).Items[i].Tag of     21..31,38: TPopupMenu(Sender).Items[i].Visible:=true;     end   else for i := 0 to TPopupMenu(Sender).Items.Count - 1 do case TPopupMenu(Sender).Items[i].Tag of     21..31,38: TPopupMenu(Sender).Items[i].Visible:=false;   end; //ShowMessage(TPopupMenu(Sender).PopupComponent.ClassName); end; procedure TForm2.RadioGroup3Click(Sender: TObject); begin   //RadioGroup3.Items.Objects[0]. :=false; end; procedure TForm2.Button1Click(Sender: TObject); Var s:string; begin   s:=InputBox('Save Treck','Name',User[RadioGroup3.ItemIndex].Name);   if s<>'' then with User[RadioGroup3.ItemIndex] do     Treck.SaveToFile(GetCurrentDir+'\Treks\'+s+'.trk'); end; procedure TForm2.Button2Click(Sender: TObject); begin   OPD.InitialDir:=GetCurrentDir+'\Treks\';   OPD.Execute;   if OPD.FileName<>'' then User[RadioGroup3.ItemIndex].Treck.LoadFromFile(OPD.FileName); end; procedure TForm2.Button3Click(Sender: TObject); begin user[0].Init('MrXtreme'); Form2.Ncr(0); end; procedure TForm2.CheckBox1Click(Sender: TObject); begin   if CheckBox1.Checked then Form2.FormStyle:=fsStayOnTop     else Form2.FormStyle:=fsNormal; end; procedure TForm2.DN; begin   (PageControl2.FindComponent('NT'+inttostr(id)) as TTabSheet).Destroy; End; procedure TForm2.MyRGClick(Sender: TObject); begin   with sender as TRadioGroup do with User[strtoint(name[4])] do     case tag of       1: case ItemIndex of         0: HPiID:=1060;         1: HPiID:=1061;         2: HPiID:=1539;         end;       2: case ItemIndex of         0: MPiID:=726;         1: MPiID:=728;         end;       end; end; procedure TForm2.MyBTClick(Sender: TObject); Var id:string; begin   with sender as TButton do Begin     id:=name[3];     if Caption='On' then Begin       Caption:='Off';       with PageControl2 do         with  TTabSheet(FindComponent('NT'+id)) do TTimer(FindComponent('MT'+id)).Enabled:=True;     End     Else Begin       Caption:='On';       with PageControl2 do         with  TTabSheet(FindComponent('NT'+id)) do TTimer(FindComponent('MT'+id)).Enabled:=False;     End;   End; end; procedure TForm2.MySPClick(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); begin   with sender as TShape do     with User[strtoint(name[3])] do       Case Tag of         1: IsInCombat:= not IsInCombat;         2: IsCPUse:= not IsCPUse;         3: IsHPUse:= not IsHPUse;         4: IsMPUse:= not IsMPUse;         5: CurentT.IsInCurse:= not CurentT.IsInCurse;         6: isInMTP:= not isInMTP;         7: isInHold:= not isInHold;         8: isInHeal:= not isInHeal;         9: isInSBaf:= not isInSBaf;         10: isInSweep:= not isInSweep;         11: OnAutoBaf:= not OnAutoBaf;         12: OnPartyBaf:= not OnPartyBaf;         13: OnSelfBaf:= not OnSelfBaf;         14: OnAutoAtack:= not OnAutoAtack;         15: OnAutoPickUp:= not OnAutoPickUp;         16: OnAutoAssist:= not OnAutoAssist;         17: OnMoveToLiader:= not OnMoveToLiader;         18: ;         19: INPU:= not INPU;         20: ;         21: INKT:= not INKT;         22: OnAutoOFF:= not OnAutoOFF;         23: ;         24: ;         //11: if Pen.Color=clLime then OnAutoBaf:=True else OnAutoBaf:=False;         //12: if Pen.Color=clLime then OnPartyBaf:=True else OnPartyBaf:=False;         //13: if Pen.Color=clLime then OnSelfBaf:=True else OnSelfBaf:=False;         //14: if Pen.Color=clLime then OnAutoAtack:=True else OnAutoAtack:=False;         //15: if Pen.Color=clLime then OnAutoPickUp:=True else OnAutoPickUp:=False;         //16: if Pen.Color=clLime then OnAutoAssist:=True else OnAutoAssist:=False;         //17: if Pen.Color=clLime then OnMoveToLiader:=True else OnMoveToLiader:=False;         //24: if Pen.Color=clLime then status[6]:='+' else status[6]:='-';         End; end; procedure TForm2.MyTimer(Sender: TObject); var Cid:integer; begin Cid:=0; try   with sender as TTimer do Cid:=strtoint(name[3]);   With User[CID] Do Begin     if not isInHold then AA(CID);     if isInHold then with Baffs.Itemi[4072] do if Duration<(GetTickCount-LTU)/1000 then UnHold(cid);     End;   except on E : Exception do     ShowMessage('ОШИБКА MyTimer:'+inttostr(Cid)+' '+E.ClassName+' ошибка: '+E.Message);   End; end; end.

Последний раз редактировалось Name4Me, 15.05.2009 в 11:55. Причина: Добавлено сообщение
Name4Me вне форума   Ответить с цитированием
За это сообщение Name4Me нажился 2 спасибками от: