Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit BaseSoft;
- interface
- uses
- Vcl.ComCtrls, System.Classes, System.Variants, System.SysUtils, Dialogs, Vcl.Forms, System.Types,
- ApiInstagram, Math, SYNCOBJS, RegularExpressions, System.Generics.Collections;
- type
- TAccount = class;
- TTask = class;
- Thread = class(TThread)
- private
- a: TAccount;
- msg: string;
- protected
- procedure Execute; override;
- procedure LikeAdd;
- procedure FollowAdd;
- procedure UnfollowAdd;
- procedure CommentAdd;
- procedure AllAdd;
- procedure WorkAdd;
- procedure httperror(txt: string);
- procedure DebugLog(txt: string);
- procedure RandomAction(api: TInstagramAPI; Task: TTask);
- procedure RandomAction2(api: TInstagramAPI; Task: TTask);
- public
- constructor Create(a: TAccount);
- end;
- TBasis = (pLike, pFollow, pComment, pSave, pViewStory, pUnfollow);
- TRandom = (pViewLenta, pViewNew, pViewNewUser, pViewPopular);
- TRandomDop = (pLikeD, pFollowD, pCommentD, pSaveD, pViewStoryD);
- TAccount = class
- private
- FIndex: integer;
- FFThread: Thread;
- FThreadIndex: integer;
- FItem: TListItem;
- FItems: TStrings;
- FItemIndex: integer;
- FUserAgent: string;
- FDevice_id: string;
- FGuid: string;
- FLogin: string;
- FPass: string;
- FProxy: string;
- FPhoto: string;
- FNewPhoto: string;
- FFollows: string;
- FNewFollows: string;
- FFollowed: string;
- FNewFollowed: string;
- FProces: string;
- FStatus: boolean;
- FId: string;
- FTaskIndex: integer;
- FCookie: string;
- FDonor: string;
- FLog: TStringList;
- function GenId: string;
- public
- property Index: integer read FIndex write FIndex;
- property ItemIndex: integer read FItemIndex write FItemIndex;
- property TaskIndex: integer read FTaskIndex write FTaskIndex;
- property Id: string read FId write FId;
- property FThread: Thread read FFThread write FFThread;
- property ThreadIndex: integer read FThreadIndex write FThreadIndex;
- property Item: TListItem read FItem write FItem;
- property Items: TStrings read FItems write FItems;
- property UserAgent: string read FUserAgent write FUserAgent;
- property Device_id: string read FDevice_id write FDevice_id;
- property Guid: string read FGuid write FGuid;
- property Login: string read FLogin write FLogin;
- property Pass: string read FPass write FPass;
- property Proxy: string read FProxy write FProxy;
- property Photo: string read FPhoto write FPhoto;
- property NewPhoto: string read FNewPhoto write FNewPhoto;
- property Follows: string read FFollows write FFollows;
- property NewFollows: string read FNewFollows write FNewFollows;
- property Followed: string read FFollowed write FFollowed;
- property NewFollowed: string read FNewFollowed write FNewFollowed;
- property Proces: string read FProces write FProces;
- property Status: boolean read FStatus write FStatus;
- property Cookie: string read FCookie write FCookie;
- property Donor: string read FDonor write FDonor;
- property Log: TStringList read FLog write FLog;
- constructor Create(Login, Pass, Proxy: string); overload;
- destructor Destroy;
- end;
- TTask = class(TAccount)
- private
- // cs: TCriticalSection;
- FList: TList<TAccount>;
- FBasis: TList<TBasis>;
- FRandomList: TList<TRandom>;
- FRandomListD: TList<TRandomDop>;
- FBlackList: TStringList;
- FBaseList: TStringList;
- FCommentList: TStringList;
- FLifeId: TStringList;
- FLifePhoto: TStringList;
- FROViewLenta: boolean;
- FROViewNew: boolean;
- FROViewNewUser: boolean;
- FROViewPopular: boolean;
- FRLike: boolean;
- FRFollow: boolean;
- FRComment: boolean;
- FRSave: boolean;
- FRViewStory: boolean;
- FOLike: boolean;
- FOFollow: boolean;
- FOComment: boolean;
- FOSave: boolean;
- FOViewStory: boolean;
- FOUnfollow: boolean;
- // FDirect: boolean;
- FListComment: string;
- FListBase: string;
- FListBlack: string;
- // FListDirect: string;
- FMinTimeLike: integer;
- FMaxTimeLike: integer;
- FLimitLike: integer;
- FMinTimeFollow: integer;
- FMaxTimeFollow: integer;
- FLimitFollow: integer;
- FMinTimeComment: integer;
- FMaxTimeComment: integer;
- FLimitComment: integer;
- FMinTimeUnfollow: integer;
- FMaxTimeUnfollow: integer;
- FLimitUnfollow: integer;
- FRandomO: integer;
- FRandomD: integer;
- FUsesBase: boolean;
- FUsesLife: boolean;
- FLifeBase: boolean;
- msg: string;
- public
- function NextUser: string;
- function NextUserLife: string;
- property BlackList: TStringList read FBlackList write FBlackList;
- property BaseList: TStringList read FBaseList write FBaseList;
- property CommentList: TStringList read FCommentList write FCommentList;
- property LifeId: TStringList read FLifeId write FLifeId;
- property LifePhoto: TStringList read FLifePhoto write FLifePhoto;
- property ROViewLenta: boolean read FROViewLenta write FROViewLenta;
- property ROViewNew: boolean read FROViewNew write FROViewNew;
- property ROViewNewUser: boolean read FROViewNewUser write FROViewNewUser;
- property ROViewPopular: boolean read FROViewPopular write FROViewPopular;
- property RLike: boolean read FRLike write FRLike;
- property RFollow: boolean read FRFollow write FRFollow;
- property RComment: boolean read FRComment write FRComment;
- property RSave: boolean read FRSave write FRSave;
- property RViewStory: boolean read FRViewStory write FRViewStory;
- property OLike: boolean read FOLike write FOLike;
- property OFollow: boolean read FOFollow write FOFollow;
- property OComment: boolean read FOComment write FOComment;
- property OSave: boolean read FOSave write FOSave;
- property OViewStory: boolean read FOViewStory write FOViewStory;
- property OUnfollow: boolean read FOUnfollow write FOUnfollow;
- // FDirect: boolean;
- property ListComment: string read FListComment write FListComment;
- property ListBase: string read FListBase write FListBase;
- property ListBlack: string read FListBlack write FListBlack;
- // FListDirect: string;
- property MinTimeLike: integer read FMinTimeLike write FMinTimeLike;
- property MaxTimeLike: integer read FMaxTimeLike write FMaxTimeLike;
- property LimitLike: integer read FLimitLike write FLimitLike;
- property MinTimeFollow: integer read FMinTimeFollow write FMinTimeFollow;
- property MaxTimeFollow: integer read FMaxTimeFollow write FMaxTimeFollow;
- property LimitFollow: integer read FLimitFollow write FLimitFollow;
- property MinTimeComment: integer read FMinTimeComment write FMinTimeComment;
- property MaxTimeComment: integer read FMaxTimeComment write FMaxTimeComment;
- property LimitComment: integer read FLimitComment write FLimitComment;
- property MinTimeUnfollow: integer read FMinTimeUnfollow write FMinTimeUnfollow;
- property MaxTimeUnfollow: integer read FMaxTimeUnfollow write FMaxTimeUnfollow;
- property LimitUnfollow: integer read FLimitUnfollow write FLimitUnfollow;
- property RandomO: integer read FRandomO write FRandomO;
- property RandomD: integer read FRandomD write FRandomD;
- property UsesBase: boolean read FUsesBase write FUsesBase;
- property UsesLife: boolean read FUsesLife write FUsesLife;
- property LifeBase: boolean read FLifeBase write FLifeBase;
- property Basis: TList<TBasis> read FBasis write FBasis;
- property RandomList: TList<TRandom> read FRandomList write FRandomList;
- property RandomListD: TList<TRandomDop> read FRandomListD write FRandomListD;
- constructor Create(PList: TList<TAccount>); overload;
- destructor Destroy;
- end;
- implementation
- uses unit1;
- { Thread }
- procedure Thread.AllAdd;
- begin
- Form1.sLabel4.Caption := inttostr(strtoint(Form1.sLabel4.Caption) + 1);
- end;
- procedure Thread.CommentAdd;
- begin
- AllAdd;
- Form1.sLabel14.Caption := inttostr(strtoint(Form1.sLabel14.Caption) + 1);
- end;
- constructor Thread.Create(a: TAccount);
- begin
- self.a := a;
- inherited Create(True);
- FreeOnTerminate := True;
- Priority := tpLower;
- Resume;
- end;
- procedure Thread.DebugLog(txt: string);
- begin
- Form1.sMemo1.Lines.Add('[DEBUG] ' + txt);
- end;
- procedure Thread.UnfollowAdd;
- begin
- AllAdd;
- Form1.sLabel10.Caption := inttostr(strtoint(Form1.sLabel10.Caption) + 1);
- end;
- procedure Thread.Execute;
- var
- Task: TTask;
- api: TInstagramAPI;
- rand: TBasis;
- i, r, All, f, l, c, u: integer;
- SText: TStringList;
- Donor, Login, Id: string;
- Black: boolean;
- begin
- for i := 0 to TaskList.Count - 1 do
- begin
- if a.Id = TaskList[i].Id then
- begin
- Task := TaskList[i];
- break;
- end;
- end;
- msg := a.Login + ' начало работы';
- Synchronize(WorkAdd);
- sleep(RandomRange(2, 10) * 1000);
- if a.Proxy <> '' then
- begin
- api := TInstagramAPI.Create(a.Login, a.Pass, a.Proxy, a.Guid, a.Device_id, a.UserAgent, ApiInstagram.pHTTPS);
- end
- else
- begin
- api := TInstagramAPI.Create(a.Login, a.Pass, a.Proxy, a.Guid, a.Device_id, a.UserAgent, ApiInstagram.pNull);
- end;
- // api.OnDebug := DebugLog;
- if Form1.sCheckBox1.Checked = True then
- begin
- api.OnLog := DebugLog;
- end;
- api.httperror := httperror;
- if api.Auth <> False then
- begin
- l := 0;
- f := 0;
- u := 0;
- c := 0;
- msg := a.Login + ' авторизовались';
- Synchronize(WorkAdd);
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Clear;
- Task.FBlackList.LoadFromFile(Task.ListBlack);
- end;
- if Task.ListComment <> '' then
- begin
- Task.FCommentList.Clear;
- Task.FCommentList.LoadFromFile(Task.ListComment);
- end;
- if Task.ListBase <> '' then
- begin
- Task.FBaseList.Clear;
- Task.FBaseList.LoadFromFile(Task.ListBase);
- end;
- All := 0;
- repeat
- repeat
- if (Task.LifeBase = True) then
- begin
- case RandomRange(1, 2) of
- 1:
- begin
- repeat
- Login := Task.NextUser;
- RandomAction(api, Task);
- until Login <> '';
- end;
- 2:
- begin
- repeat
- RandomAction(api, Task);
- Login := Task.NextUserLife;
- until Login <> '';
- end;
- end;
- end;
- if (Task.UsesBase = True) then
- begin
- repeat
- Login := Task.NextUser;
- RandomAction(api, Task);
- until Login <> '';
- end;
- if (Task.UsesLife = True) then
- begin
- repeat
- RandomAction(api, Task);
- Login := Task.NextUserLife;
- until Login <> '';
- end;
- Black := False;
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Sort;
- if Task.FBlackList.IndexOf(Login) <> -1 then
- begin
- Black := True;
- end;
- end;
- if Black = True then
- begin
- msg := a.Login + ' ' + Login + ' в BlackList';
- Synchronize(WorkAdd);
- end;
- until Black <> True;
- if Task.Basis.Count <> 0 then
- begin
- api.SearchUser(Login);
- for i := 0 to api.IdListUser.Count - 1 do
- begin
- sleep(500);
- api.UserInfo(api.IdListUser[i]);
- if api.GetUser.username = Login then
- break;
- end;
- if (api.GetUser.username <> '') and (api.User.ResultCode = 200) then
- begin
- Randomize;
- rand := Task.Basis[random(Task.Basis.Count)];
- case rand of
- pLike:
- begin
- if (Task.OLike = True) and (Task.LimitLike >= l) then
- begin
- if (api.GetUser.is_private <> True) and (api.GetUser.media_count.ToInteger > 0) then
- begin
- if l <= Task.LimitLike then
- begin
- api.IdPhotoPars(api.GetUser._uid);
- if api.Like(api.Photo[0]) then
- begin
- msg := a.Login + ' поставили лайк ' + api.GetUser.username;
- Synchronize(WorkAdd);
- Synchronize(LikeAdd);
- inc(l);
- inc(All);
- a.Item.SubItems[5] := l.ToString + '/' + Task.LimitLike.ToString + ' ' + f.ToString + '/' +
- Task.LimitFollow.ToString + ' ' + u.ToString + '/' + Task.LimitUnfollow.ToString + ' ' +
- c.ToString + '/' + Task.LimitComment.ToString;
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Add(api.GetUser.username);
- Task.FBlackList.SaveToFile(Task.ListBlack);
- end;
- sleep(RandomRange(Task.MinTimeLike, Task.MaxTimeLike));
- end
- else
- begin
- msg := a.Login + 'не поставили лайк ' + api.GetUser.username;
- Synchronize(WorkAdd);
- msg := api.User.respons;
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' Сегодня поставили все лайки';
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' ' + api.GetUser.username + ' приватный или нет фото';
- Synchronize(WorkAdd);
- end;
- end;
- end;
- pFollow:
- begin
- if (Task.OFollow = True) and (Task.LimitFollow >= f) then
- begin
- if f <= Task.LimitFollow then
- begin
- if api.Follow(api.GetUser._uid) then
- begin
- msg := a.Login + ' подписались на ' + api.GetUser.username;
- Synchronize(WorkAdd);
- Synchronize(FollowAdd);
- inc(f);
- inc(All);
- a.Item.SubItems[5] := l.ToString + '/' + Task.LimitLike.ToString + ' ' + f.ToString + '/' +
- Task.LimitFollow.ToString + ' ' + u.ToString + '/' + Task.LimitUnfollow.ToString + ' ' +
- c.ToString + '/' + Task.LimitComment.ToString;
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Add(api.GetUser.username);
- Task.FBlackList.SaveToFile(Task.ListBlack);
- end;
- sleep(RandomRange(Task.MinTimeFollow, Task.MaxTimeFollow));
- end
- else
- begin
- msg := a.Login + ' не подписались на ' + api.GetUser.username;
- Synchronize(WorkAdd);
- msg := api.User.respons;
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' Сегодня подписались на всех';
- Synchronize(WorkAdd);
- end;
- end;
- end;
- pComment:
- begin
- if (Task.OComment = True) and (Task.LimitComment >= c) then
- begin
- if (api.GetUser.is_private <> True) and (api.GetUser.media_count.ToInteger > 0) then
- begin
- if c <= Task.LimitComment then
- begin
- api.IdPhotoPars(api.GetUser._uid);
- if api.Comment(api.Photo[0], Task.CommentList[random(Task.CommentList.Count - 1)]) then
- begin
- msg := a.Login + ' прокоментировали ' + api.GetUser.username;
- Synchronize(WorkAdd);
- Synchronize(CommentAdd);
- inc(c);
- inc(All);
- a.Item.SubItems[5] := l.ToString + '/' + Task.LimitLike.ToString + ' ' + f.ToString + '/' +
- Task.LimitFollow.ToString + ' ' + u.ToString + '/' + Task.LimitUnfollow.ToString + ' ' +
- c.ToString + '/' + Task.LimitComment.ToString;
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Add(api.GetUser.username);
- Task.FBlackList.SaveToFile(Task.ListBlack);
- end;
- sleep(RandomRange(Task.MinTimeComment, Task.MaxTimeComment));
- end
- else
- begin
- msg := a.Login + ' не прокоментировали ' + api.GetUser.username;
- Synchronize(WorkAdd);
- msg := api.User.respons;
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' Сегодня написали все комменрарии';
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' ' + api.GetUser.username + ' приватный или нет фото';
- Synchronize(WorkAdd);
- end;
- end;
- end;
- pUnfollow:
- begin
- if (Task.OUnfollow = True) and (Task.LimitUnfollow >= u) then
- begin
- if u <= Task.LimitUnfollow then
- begin
- api.Following(api.User._uid);
- api.UserInfo(api.IdListUser[0]);
- if api.UnFollow(api.GetUser._uid) then
- begin
- msg := a.Login + ' отписались от ' + api.GetUser.username;
- Synchronize(WorkAdd);
- Synchronize(UnfollowAdd);
- inc(u);
- inc(All);
- a.Item.SubItems[5] := l.ToString + '/' + Task.LimitLike.ToString + ' ' + f.ToString + '/' +
- Task.LimitFollow.ToString + ' ' + u.ToString + '/' + Task.LimitUnfollow.ToString + ' ' +
- c.ToString + '/' + Task.LimitComment.ToString;
- if Task.ListBlack <> '' then
- begin
- Task.FBlackList.Add(api.GetUser.username);
- Task.FBlackList.SaveToFile(Task.ListBlack);
- end;
- sleep(RandomRange(Task.MinTimeUnfollow, Task.MaxTimeUnfollow));
- end
- else
- begin
- msg := a.Login + ' не отписались от ' + api.GetUser.username;
- Synchronize(WorkAdd);
- msg := api.User.respons;
- Synchronize(WorkAdd);
- end;
- end
- else
- begin
- msg := a.Login + ' Сегодня отписались от всех';
- Synchronize(WorkAdd);
- end;
- end;
- end;
- pSave:
- begin
- if Task.OSave = True then
- begin
- if (api.GetUser.is_private <> True) and (api.GetUser.media_count.ToInteger > 0) then
- begin
- api.PhotoSave(api.GetUser._uid);
- msg := a.Login + ' сохранили фото ' + api.GetUser.username;
- Synchronize(WorkAdd);
- sleep(RandomRange(5, 10) * 1000);
- end
- else
- begin
- msg := a.Login + ' ' + api.GetUser.username + ' приватный или нет фото';
- Synchronize(WorkAdd);
- end;
- end;
- end;
- pViewStory:
- begin
- if Task.OViewStory = True then
- begin
- if (api.GetUser.is_private <> True) then
- begin
- api.ViewStory(api.GetUser._uid);
- msg := a.Login + ' просмотрели стори ' + api.GetUser.username;
- Synchronize(WorkAdd);
- sleep(RandomRange(5, 10) * 1000);
- end;
- end;
- end;
- end;
- end;
- end;
- sleep(RandomRange(5, 10) * 1000);
- until All >= (Task.FLimitLike + Task.FLimitFollow + Task.FLimitComment + Task.FLimitUnfollow);
- All := 0;
- end
- else
- begin
- msg := a.Login + ' не авторизовались';
- Synchronize(WorkAdd);
- msg := a.Login + ' ' + api.User.respons;
- Synchronize(WorkAdd);
- end;
- a.Status := False;
- msg := a.Login + ' завершили работу';
- Synchronize(WorkAdd);
- a.Item.SubItems[2] := 'Завершили работу';
- end;
- procedure Thread.FollowAdd;
- begin
- AllAdd;
- Form1.sLabel9.Caption := inttostr(strtoint(Form1.sLabel9.Caption) + 1);
- end;
- procedure Thread.httperror(txt: string);
- begin
- msg := a.Login + ' ' + txt;
- Synchronize(WorkAdd);
- end;
- procedure Thread.LikeAdd;
- begin
- AllAdd;
- Form1.sLabel8.Caption := inttostr(strtoint(Form1.sLabel8.Caption) + 1);
- end;
- procedure Thread.RandomAction(api: TInstagramAPI; Task: TTask);
- var
- oi: integer;
- r: TRandom;
- begin
- for oi := 0 to Task.RandomO - 1 do
- begin
- Randomize;
- r := Task.FRandomList[random(Task.RandomList.Count)];
- case r of
- pViewLenta:
- begin
- if Task.ROViewLenta = True then
- begin
- api.TimeLine;
- msg := '[рандом] ' + api.Login + ' просмотрели ленту';
- WorkAdd;
- Task.LifeId.AddStrings(api.IdTimeLineList);
- Task.LifePhoto.AddStrings(api.PhotoTimeLineList);
- if (Task.UsesLife = True) or (Task.LifeBase = True) then
- begin
- msg := '[информация] в лайф базе : ' + Task.LifePhoto.Count.ToString + ' фото ,' +
- Task.LifeId.Count.ToString + ' юзеров';
- WorkAdd;
- end;
- RandomAction2(api, Task);
- end;
- end;
- pViewNew:
- begin
- if Task.ROViewNew then
- begin
- api.RecentActivityInbox;
- msg := '[рандом] ' + api.Login + ' просмотрели новости свои';
- WorkAdd;
- Task.LifeId.AddStrings(api.IdTimeLineList);
- begin
- msg := '[информация] в лайф базе : ' + Task.LifePhoto.Count.ToString + ' фото ,' +
- Task.LifeId.Count.ToString + ' юзеров';
- WorkAdd;
- end;
- RandomAction2(api, Task);
- end;
- end;
- pViewNewUser:
- begin
- if Task.ROViewNewUser = True then
- begin
- api.RecentActivityInboxUser;
- msg := '[рандом] ' + api.Login + ' просмотрели новости подписчиков';
- WorkAdd;
- Task.LifeId.AddStrings(api.IdTimeLineList);
- Task.LifePhoto.AddStrings(api.PhotoTimeLineList);
- begin
- msg := '[информация] в лайф базе : ' + Task.LifePhoto.Count.ToString + ' фото ,' +
- Task.LifeId.Count.ToString + ' юзеров';
- WorkAdd;
- end;
- RandomAction2(api, Task);
- end;
- end;
- pViewPopular:
- begin
- if Task.ROViewPopular = True then
- begin
- api.Popular;
- msg := '[рандом] ' + api.Login + ' просмотрели популярное';
- WorkAdd;
- Task.LifeId.AddStrings(api.IdTimeLineList);
- Task.LifePhoto.AddStrings(api.PhotoTimeLineList);
- begin
- msg := '[информация] в лайф базе : ' + Task.LifePhoto.Count.ToString + ' фото ,' +
- Task.LifeId.Count.ToString + ' юзеров';
- WorkAdd;
- end;
- RandomAction2(api, Task);
- end;
- end;
- end;
- sleep(RandomRange(3, 10) * 1000);
- end;
- end;
- procedure Thread.RandomAction2(api: TInstagramAPI; Task: TTask);
- var
- UserRandom: string;
- r: TRandomDop;
- di: integer;
- begin
- for di := 0 to Task.RandomD - 1 do
- begin
- Randomize;
- r := Task.FRandomListD[random(Task.FRandomListD.Count)];
- case r of
- pLikeD:
- begin
- if (Task.RLike = True) and (Task.LifePhoto.Text <> '') then
- begin
- repeat
- Randomize;
- UserRandom := Task.LifePhoto[random(Task.LifePhoto.Count - 1)];
- until UserRandom <> '';
- api.InfoPost(UserRandom);
- msg := '[рандом доп.] ' + api.Login + ' поставили лайк рандомной записи у ' + api.GetUser.username;
- WorkAdd;
- LikeAdd;
- api.Like(UserRandom);
- sleep(RandomRange(Task.MinTimeLike, Task.MaxTimeLike) * 1000);
- end;
- end;
- pFollowD:
- begin
- if (Task.RFollow = True) and (Task.LifeId.Text <> '') then
- begin
- repeat
- Randomize;
- UserRandom := Task.LifeId[random(Task.LifeId.Count - 1)];
- sleep(RandomRange(1, 3) * 1000);
- until UserRandom <> '';
- msg := '[рандом доп.] ' + api.Login + ' подписались на ' + UserRandom;
- WorkAdd;
- FollowAdd;
- api.UserInfo(UserRandom);
- api.Follow(api.GetUser._uid);
- sleep(RandomRange(Task.MinTimeFollow, Task.MaxTimeFollow) * 1000);
- end;
- end;
- pCommentD:
- begin
- if (Task.RComment = True) and (Task.LifePhoto.Text <> '') then
- begin
- if Task.CommentList.Count <> 0 then
- begin
- repeat
- repeat
- Randomize;
- UserRandom := Task.LifeId[random(Task.LifeId.Count - 1)];
- until UserRandom <> '';
- api.UserInfo(UserRandom);
- sleep(RandomRange(1, 3) * 1000);
- until (api.GetUser.is_private <> True) and (api.GetUser.media_count.ToInteger > 0);
- api.IdPhotoPars(api.GetUser._uid);
- msg := '[рандом доп.] ' + api.Login + ' прокоментировали случайную запись ' + api.GetUser.username;
- WorkAdd;
- CommentAdd;
- api.Comment(api.Photo[0], ansitoutf8(Task.CommentList[random(Task.CommentList.Count - 1)]));
- sleep(RandomRange(Task.MinTimeComment, Task.MaxTimeComment) * 1000);
- end;
- end;
- end;
- pSaveD:
- begin
- if (Task.RSave = True) and (Task.LifeId.Text <> '') then
- begin
- repeat
- repeat
- Randomize;
- UserRandom := Task.LifeId[random(Task.LifeId.Count - 1)];
- until UserRandom <> '';
- api.UserInfo(UserRandom);
- sleep(RandomRange(1, 3) * 1000);
- until (api.GetUser.is_private <> True) and (api.GetUser.media_count.ToInteger > 0);
- msg := '[рандом доп.] ' + api.Login + ' сохранили случайный пост у ' + api.GetUser.username;
- WorkAdd;
- api.PhotoSave(UserRandom);
- end;
- end;
- pViewStoryD:
- begin
- if (Task.RViewStory = True) and (Task.LifeId.Text <> '') then
- begin
- repeat
- repeat
- Randomize;
- UserRandom := Task.LifeId[random(Task.LifeId.Count - 1)];
- until UserRandom <> '';
- api.UserInfo(UserRandom);
- sleep(RandomRange(1, 3) * 1000);
- until api.GetUser.is_private <> True;
- msg := '[рандом доп.] ' + api.Login + ' просмотрели стори у ' + api.GetUser.username;
- WorkAdd;
- api.ViewStory(api.GetUser.username);
- end;
- end;
- end;
- sleep(RandomRange(3, 10) * 1000);
- end;
- end;
- procedure Thread.WorkAdd;
- begin
- a.Log.Add('[' + Timetostr(now) + '] ' + msg);
- Form1.sMemo1.Lines.Add('[' + Timetostr(now) + '] ' + msg);
- end;
- { TAccount }
- constructor TAccount.Create(Login, Pass, Proxy: string);
- begin
- FLogin := Login;
- FPass := Pass;
- FProxy := Proxy;
- FLog := TStringList.Create;
- end;
- destructor TAccount.Destroy;
- begin
- FLog.Free;
- end;
- function TAccount.GenId: string;
- var
- MyGUID: TGUID;
- begin
- CreateGUID(MyGUID);
- Result := trim(GUIDToString(MyGUID).Replace('{', '').Replace('}', '').ToLower);
- end;
- { TTask }
- constructor TTask.Create(PList: TList<TAccount>);
- var
- i: integer;
- begin
- FList := TList<TAccount>.Create;
- FBasis := TList<TBasis>.Create;
- FRandomList := TList<TRandom>.Create;
- FRandomListD := TList<TRandomDop>.Create;
- FCommentList := TStringList.Create;
- FBaseList := TStringList.Create;
- FBaseList.Duplicates := dupIgnore;
- FBaseList.Sorted := True;
- FBlackList := TStringList.Create;
- FBlackList.Duplicates := dupIgnore;
- FBlackList.Sorted := True;
- FLifeId := TStringList.Create;
- FLifeId.Duplicates := dupIgnore;
- FLifeId.Sorted := True;
- FLifeId.Add('katyachupinaaa');
- FLifeId.Add('instagramru');
- FLifeId.Add('instagram');
- FLifePhoto := TStringList.Create;
- FLifePhoto.Duplicates := dupIgnore;
- FLifePhoto.Sorted := True;
- FLifePhoto.Add('1603096989499430875_638144925');
- FLifePhoto.Add('1602347163245836834_638144925');
- FId := GenId;
- // cs := TCriticalSection.Create;
- for i := 0 to PList.Count - 1 do
- begin
- FList.Add(PList[i]);
- FList[i].Id := FId;
- end;
- end;
- destructor TTask.Destroy;
- begin
- FCommentList.Free;
- FBaseList.Free;
- FBlackList.Free;
- FLifeId.Free;
- FLifePhoto.Free;
- FList.Free;
- FBasis.Free;
- FRandomList.Free;
- FRandomListD.Free;
- // cs.Destroy;
- end;
- function TTask.NextUser: string;
- var
- str: string;
- begin
- if FBaseList.Count <> 0 then
- begin
- Result := '';
- cs.Enter;
- try
- str := FBaseList[0];
- FBaseList.Delete(0);
- Result := str;
- finally
- cs.Leave;
- end;
- end
- else
- begin
- Result := '';
- end;
- end;
- function TTask.NextUserLife: string;
- var
- str: string;
- begin
- if FLifeId.Count <> 0 then
- begin
- Result := '';
- cs.Enter;
- try
- str := FLifeId[0];
- FLifeId.Delete(0);
- Result := str;
- finally
- cs.Leave;
- end;
- end
- else
- begin
- Result := '';
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement