Спамер Для скайпа в Delphi

ВНИМАНИЕ для работы с этим кодом потребуется модуль AlphaSkins

Для работы нам понадобятся:
8 sButtons (со вкладки AlphaStandart)
2 sListBox
1 sMemo
1 sProgressBar
3 sLabel

Называем sLabel так
1. Список контактов и ставим рядом со списком
2. Спам лист и ставим рядом со спам листом
3. Всего контактов: Контактов в спам листе: (именно также как у меня с множеством пробелов)

В uses прописываем новую библиотеку:
 SKYPE4COMLib_TLB, 


В public прописываем функции:
    function GetFirstSelection(List: TCustomListBox): Integer;
    procedure MoveSelected(List: TCustomListBox; Items: TStrings);
    procedure SetItem(List: TListBox; Index: Integer);
  end; 


В var добавляем переменные:
  Skype:TSkype;
  vkspam: Integer; 


В implementation после:

{$R *.dfm} пишем такой код:
function tform1.GetFirstSelection(List: TCustomListBox): Integer;
begin
for Result := 0 to List.Items.Count - 1 do
if List.Selected[Result] then
Exit;
Result := LB_ERR;
end;

procedure tform1.MoveSelected(List: TCustomListBox; Items: TStrings);
var
I: Integer;
begin
for I := List.Items.Count - 1 downto 0 do
if List.Selected[I] then
begin
Items.AddObject(List.Items[I], List.Items.Objects[I]);
List.Items.Delete(I);
end;
end;

procedure tform1.SetItem(List: TListBox; Index: Integer);
var
MaxIndex: Integer;
begin
with List do
begin
SetFocus;
MaxIndex := List.Items.Count - 1;
if Index = LB_ERR then
Index := 0
else if Index > MaxIndex then
Index := MaxIndex;
Selected[Index] := True;
end;
end; 


В кнопку получить контакты вставляем:
procedure TForm1.sButton1Click(Sender: TObject);
var
  i: Integer;
begin
 sbutton2.Enabled:= true;
 sbutton3.Enabled:= true;
 sbutton4.Enabled:= true;
 sbutton5.Enabled:= true;
 sbutton6.Enabled:= true;
 sbutton7.Enabled:= true;
 sbutton8.Enabled:= true;
 i:=0;
  Skype:=SKYPE4COMLib_TLB.TSkype.Create(nil);
  Skype.Attach(6,True);
  sProgressBar1.Max:=Skype.Friends.Count;
  for i:=1 to Skype.Friends.Count do
     begin
      if Skype.Friends.Item[i].Handle<>'' then
       sListBox1.Items.Add(Skype.Friends.Item[i].Handle);
       sProgressBar1.Position:=sProgressBar1.Position+1;
     end;
  sButton1.Enabled:=False;
  sLabel2.Caption:='Всего контактов: '+IntToStr(Skype.Friends.Count)+' | Контактов в спам листе: '+IntToStr(vkspam);
end; 




В FormCreate прописываем:
procedure TForm1.FormCreate(Sender: TObject);
begin
sbutton2.Enabled:= false;
sbutton3.Enabled:= false;
sbutton4.Enabled:= false;
sbutton5.Enabled:= false;
sbutton6.Enabled:= false;
sbutton7.Enabled:= false;
sbutton8.Enabled:= false;
ShowMessage('Разрешите программе доступ к скайпу');
Skype:=SKYPE4COMLib_TLB.TSkype.Create(nil);
Skype.Attach(6,True);
vkspam:=0;
end; 



Для кнопки перевести все контакты в спам лист:
procedure TForm1.sButton2Click(Sender: TObject);
var
y, index: Integer;
begin
sListBox1.ItemIndex:=0;
try
for y:=0 to sListBox1.Items.Count do
begin
  Index:= GetFirstSelection(slistbox1);
  MoveSelected(slistbox1, slistbox2.Items);
  SetItem(slistbox1, Index);
  vkspam:=vkspam+1;
  sLabel2.Caption:='Всего контактов: '+IntToStr(Skype.Friends.Count)+' | Контактов в спам листе: '+IntToStr(vkspam);
end;
except

end;
end; 



Для кнопки убрать все контакты из сам листа в первичный лист:
procedure TForm1.sButton3Click(Sender: TObject);
var
y, index: Integer;
begin
sListBox2.ItemIndex:=0;
  try
for y:=0 to sListBox2.Items.Count do
begin
  Index:= GetFirstSelection(slistbox2);
  MoveSelected(slistbox2, slistbox1.Items);
  SetItem(slistbox2, Index);
  vkspam:=vkspam-1;
  sLabel2.Caption:='Всего контактов: '+IntToStr(Skype.Friends.Count)+' | Контактов в спам листе: '+IntToStr(vkspam);
end;
except

end;
end; 



Для кнопки старт пишем такой код:
procedure TForm1.sButton6Click(Sender: TObject);
var
y: Integer;
begin
sListBox2.ItemIndex:=0;
  for y:=0 to sListBox2.Items.Count do
  begin
    Skype.SendMessage(sListBox2.Items[sListBox2.ItemIndex],sMemo1.Text);
    sListBox2.ItemIndex:=sListBox2.ItemIndex+1;
  end;
end; 


Для кнопки переместить по одному контакту в спам лист:
procedure TForm1.sButton4Click(Sender: TObject);
var
Index: Integer;
begin
  try
Index := GetFirstSelection(slistbox1);
MoveSelected(slistbox1, slistbox2.Items);
SetItem(slistbox1, Index);
vkspam:=vkspam+1;
sLabel2.Caption:='Всего контактов: '+IntToStr(Skype.Friends.Count)+' | Контактов в спам листе: '+IntToStr(vkspam);
  except
    end;
end; 


Для кнопки убрать по 1 контакту из спам листа в первичный лист:
procedure TForm1.sButton5Click(Sender: TObject);
var
Index: Integer;
begin
  try
Index := GetFirstSelection(slistbox2);
MoveSelected(slistbox2, slistbox1.Items);
SetItem(slistbox2, Index);
vkspam:=vkspam-1;
sLabel2.Caption:='Всего контактов: '+IntToStr(Skype.Friends.Count)+' | Контактов в спам листе: '+IntToStr(vkspam);
  except
    end;
end; 


Для кнопки ADD шаблон:
procedure TForm1.sButton7Click(Sender: TObject);
begin
smemo1.Text:='';
smemo1.Text:=smemo1.Text+'(cool) ADD (*)(*) skype:?add (smoke) Раскинь (*)(*) <<---- VIP' // тут в ковычках можете написать свой шаблон.
end; 


Для кнопки Block шаблон:
procedure TForm1.sButton8Click(Sender: TObject);
begin
smemo1.Text:='';
smemo1.Text:=smemo1.Text+'(cool) BLOCK|Раскинь (smoke) Skype:?menu  (smoke) BLOCK|Раскинь  (cool) ' // тут в ковычках можете написать свой шаблон.
end; 

end. 

Итог:
Мой спамер.
Добавлено: 19 Января 2014 11:34:22 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...