SRL Archive - Other Scripts

Petting Grounds Bot for Facebook Pets Application


LordGregGreg

2007-07-15 18:39:27

This bot is for the facebook application "pets". It saves you time and clicks by getting you into the petting grounds. Some times this can take up to hours, and this script will do it for you.

Features:
  1. Fully automated
  2. User frindly Form :)
  3. (use scar's built in "eye dropper" tool to get coordinates and colors.
  4. Detailed Report
  5. Dynamic page loaded detection
  6. Stops the script once you are in the petting grounds.
Instructions are included in the script, you need scar 3.11 and srl 3.81 AT LEAST for this to work.
Read tuts on how to get that if you need help, please don't post it here unless you are desperate.

PROGRAM GregsPettingGroundsOpener;
//Special Thanks to Jhildy for his AWESOME advanced form help

{.include srl/srl.scar}
VAR
worldMap, pettingArea, errorArea, oceanArea: TPoint;
blueColor, redColor, times, globalMark: INTEGER;
// InitForm variables.
EndInitForm: BOOLEAN;
GregsForm: TForm;
Bevel3, Bevel1, Bevel2: TBevel;
Label1, Label2, Label3, Label4, Label5, Label6,
Label7, Label8, Label9, Label10, Label11,
Label12, Label14, Label13, Label15: TLabel;
Shape3, Shape1, Shape2, Shape4, Shape5: TShape;
SpeedButton1: TSpeedButton;
Edit1, Edit2, Edit3, Edit4, Edit5, Edit6, Edit7,
Edit8, Edit9, Edit10: TEdit;
Button1, Button2, Button3, Button4: TButton;
Memo1: TMemo;
tColor: LONGINT;

// When the form is closed, this code will be executed.
PROCEDURE InitFormOnClose(Sender: TObject;
VAR Action: TCloseAction);
BEGIN
IF (NOT (GregsForm.ModalResult = 1)) THEN
EndInitForm := True;
END;

PROCEDURE Click(Sender: TObject);
BEGIN
blueColor := StrToInt(edit5.Text);
redColor := StrToInt(edit8.Text);
worldMap.x := StrToInt(edit1.Text);
worldMap.y := StrToInt(edit2.Text);
pettingArea.x := StrToInt(edit3.Text);
pettingArea.y := StrToInt(edit4.Text);
errorArea.x := StrToInt(edit6.Text);
errorArea.y := StrToInt(edit7.Text);
oceanArea.x := StrToInt(edit9.Text);
oceanArea.y := StrToInt(edit10.Text);

ActivateClient;

GregsForm.ModalResult := mrOk; // Closes the form

END;

PROCEDURE clicked1(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit1.Color;
edit1.Color := clRed;
edit2.Color := clRed;
REPEAT
wait(1);
getmousepos(x, y);
Edit1.Text := IntToStr(x);
Edit1.refresh;
Edit2.Text := IntToStr(y);
Edit2.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit1.Text := IntToStr(x);
Edit2.Text := IntToStr(y);
edit1.Color := tColor;
edit2.Color := tColor;
END;
END;

PROCEDURE clicked2(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit3.Color;
edit3.Color := clRed;
edit4.Color := clRed;
REPEAT
wait(1);
getMousepos(x, y);
Edit3.Text := IntToStr(x);
Edit4.Text := IntToStr(y);
Edit3.refresh;
Edit4.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit3.Text := IntToStr(x);
Edit4.Text := IntToStr(y);
edit3.Color := tColor;
edit4.Color := tColor;
END;
END;

PROCEDURE clicked3(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit5.Color;
edit9.Color := clRed;
edit10.Color := clRed;
edit5.Color := clRed;
REPEAT
wait(1);
getmousepos(x, y);
Edit5.Text := IntToStr(getcolor(x, y));
Edit9.Text := IntToStr(x);
Edit10.Text := IntToStr(y);
Edit5.refresh;
Edit9.refresh;
Edit10.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit5.Text := IntToStr(getcolor(x, y));
Edit9.Text := IntToStr(x);
Edit10.Text := IntToStr(y);
edit5.Color := tColor;
edit9.Color := tColor;
edit10.Color := tColor;
END;
END;

PROCEDURE clicked4(Sender: TObject);
BEGIN
REPEAT
wait(1);
UNTIL (NOT (ismousebuttondown(True)));
tColor := edit6.Color;
edit7.Color := clRed;
edit8.Color := clRed;
edit6.Color := clRed;
REPEAT
wait(1);
getMousepos(x, y);
Edit6.Text := IntToStr(x);
Edit7.Text := IntToStr(y);
Edit8.Text := IntToStr(getcolor(x, y));
Edit6.refresh;
Edit7.refresh;
Edit8.refresh;
UNTIL (ismousebuttondown(True));
BEGIN
getmousepos(x, y);
wait(10);
Edit8.Text := IntToStr(getcolor(x, y));
Edit6.Text := IntToStr(x);
Edit7.Text := IntToStr(y);
edit6.Color := tColor;
edit7.Color := tColor;
edit8.Color := tColor;
END;
END;

// This form was parsed using: DFM Form Parser v.23 by Ron.
PROCEDURE InitForm;
VAR
TimeInitForm: INTEGER;
BEGIN
TimeInitForm := GetSystemTime;
GregsForm := CreateForm;
WITH GregsForm DO
BEGIN
OnClose := @InitFormOnClose;
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize, biSystemMenu];
ClientWidth := 988;
ClientHeight := 505;
Caption := 'frmDesign';
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
PixelsPerInch := 96;
END;
Bevel3 := TBevel.Create(GregsForm);
WITH Bevel3 DO
BEGIN
Parent := GregsForm;
Left := 42;
Top := 201;
Width := 904;
Height := 158;
END;
Label1 := TLabel.Create(GregsForm);
WITH Label1 DO
BEGIN
Parent := GregsForm;
Left := 174;
Top := 24;
Width := 609;
Height := 43;
Caption := 'Welcome to Greg'#39's Auto Petting Ground Enterer!';
Font.Color := clWindowText;
Font.Height := -35;
Font.Name := 'Monotype Corsiva';
Font.Style := [fsItalic];
ParentFont := False;
END;
Bevel1 := TBevel.Create(GregsForm);
WITH Bevel1 DO
BEGIN
Parent := GregsForm;
Left := 170;
Top := 27;
Width := 621;
Height := 42;
END;
Bevel2 := TBevel.Create(GregsForm);
WITH Bevel2 DO
BEGIN
Parent := GregsForm;
Left := 164;
Top := 22;
Width := 633;
Height := 52;
END;
Label2 := TLabel.Create(GregsForm);
WITH Label2 DO
BEGIN
Parent := GregsForm;
Left := 50;
Top := 219;
Width := 258;
Height := 13;
Caption :=
'Please enter the cordinants of the "World Map" Button';
END;
Label3 := TLabel.Create(GregsForm);
WITH Label3 DO
BEGIN
Parent := GregsForm;
Left := 50;
Top := 251;
Width := 367;
Height := 13;
Caption :=
'Please enter the coordinants of the area you click to enter the '
+ 'petting grounds';
END;
Label4 := TLabel.Create(GregsForm);
WITH Label4 DO
BEGIN
Parent := GregsForm;
Left := 49;
Top := 311;
Width := 425;
Height := 13;
Caption :=
'Please enter the coordinants of the part of the screen that appe'
+ 'ars red (when u dont get it)';
END;
Label5 := TLabel.Create(GregsForm);
WITH Label5 DO
BEGIN
Parent := GregsForm;
Left := 413;
Top := 221;
Width := 7;
Height := 13;
Caption := 'X';
END;
Label6 := TLabel.Create(GregsForm);
WITH Label6 DO
BEGIN
Parent := GregsForm;
Left := 477;
Top := 220;
Width := 7;
Height := 13;
Caption := 'Y';
END;
Label7 := TLabel.Create(GregsForm);
WITH Label7 DO
BEGIN
Parent := GregsForm;
Left := 432;
Top := 251;
Width := 7;
Height := 13;
Caption := 'X';
END;
Label8 := TLabel.Create(GregsForm);
WITH Label8 DO
BEGIN
Parent := GregsForm;
Left := 495;
Top := 249;
Width := 7;
Height := 13;
Caption := 'Y';
END;
Label9 := TLabel.Create(GregsForm);
WITH Label9 DO
BEGIN
Parent := GregsForm;
Left := 496;
Top := 284;
Width := 98;
Height := 13;
Caption := 'Blue Color of Ocean:';
END;
Label10 := TLabel.Create(GregsForm);
WITH Label10 DO
BEGIN
Parent := GregsForm;
Left := 492;
Top := 310;
Width := 7;
Height := 13;
Caption := 'X';
END;
Label11 := TLabel.Create(GregsForm);
WITH Label11 DO
BEGIN
Parent := GregsForm;
Left := 537;
Top := 310;
Width := 7;
Height := 13;
Caption := 'Y';
END;
Label12 := TLabel.Create(GregsForm);
WITH Label12 DO
BEGIN
Parent := GregsForm;
Left := 580;
Top := 310;
Width := 77;
Height := 13;
Caption := 'Red Color of bar';
END;
Shape3 := TShape.Create(GregsForm);
WITH Shape3 DO
BEGIN
Parent := GregsForm;
Left := 395;
Top := 374;
Width := 245;
Height := 100;
Brush.Color := clRed;
Shape := stRoundRect;
END;
Shape1 := TShape.Create(GregsForm);
WITH Shape1 DO
BEGIN
Parent := GregsForm;
Left := 403;
Top := 384;
Width := 228;
Height := 81;
Cursor := crCross;
Pen.Color := clMaroon;
Pen.Width := 7;
Shape := stRoundRect;
END;
Shape2 := TShape.Create(GregsForm);
WITH Shape2 DO
BEGIN
Parent := GregsForm;
Left := 408;
Top := 388;
Width := 218;
Height := 72;
Brush.Color := clYellow;
Pen.Color := clGreen;
Shape := stRoundRect;
END;
Shape4 := TShape.Create(GregsForm);
WITH Shape4 DO
BEGIN
Parent := GregsForm;
Left := 407;
Top := 387;
Width := 220;
Height := 75;
Brush.Color := clRed;
Brush.Style := bsFDiagonal;
Shape := stRoundRect;
END;
Shape5 := TShape.Create(GregsForm);
WITH Shape5 DO
BEGIN
Parent := GregsForm;
Left := 408;
Top := 388;
Width := 218;
Height := 73;
Brush.Color := clRed;
Brush.Style := bsBDiagonal;
Shape := stRoundRect;
END;
SpeedButton1 := TSpeedButton.Create(GregsForm);
WITH SpeedButton1 DO
BEGIN
Parent := GregsForm;
SpeedButton1.ONCLICK := @click;
Left := 414;
Top := 398;
Width := 207;
Height := 53;
Cursor := crHandPoint;
Caption := 'Go Go Go!';
Font.Color := clWindowText;
Font.Height := -21;
Font.Name := 'Matura MT Script Capitals';
Font.Style := [];
ParentFont := False;
END;
Label14 := TLabel.Create(GregsForm);
WITH Label14 DO
BEGIN
Parent := GregsForm;
Left := 49;
Top := 283;
Width := 286;
Height := 13;
Caption :=
'Please enter in the blue color of the Ocean on the world map';
END;
Label13 := TLabel.Create(GregsForm);
WITH Label13 DO
BEGIN
Parent := GregsForm;
Left := 346;
Top := 285;
Width := 7;
Height := 13;
Caption := 'X';
END;
Label15 := TLabel.Create(GregsForm);
WITH Label15 DO
BEGIN
Parent := GregsForm;
Left := 413;
Top := 286;
Width := 7;
Height := 13;
Caption := 'Y';
END;
Edit1 := TEdit.Create(GregsForm);
WITH Edit1 DO
BEGIN
Parent := GregsForm;
Left := 423;
Top := 217;
Width := 50;
Height := 21;
TabOrder := 8;
Text := '792';
END;
Edit2 := TEdit.Create(GregsForm);
WITH Edit2 DO
BEGIN
Parent := GregsForm;
Left := 496;
Top := 216;
Width := 121;
Height := 21;
TabOrder := 9;
Text := '139';
END;
Edit3 := TEdit.Create(GregsForm);
WITH Edit3 DO
BEGIN
Parent := GregsForm;
Left := 444;
Top := 246;
Width := 48;
Height := 21;
TabOrder := 10;
Text := '609';
END;
Edit4 := TEdit.Create(GregsForm);
WITH Edit4 DO
BEGIN
Parent := GregsForm;
Left := 507;
Top := 246;
Width := 42;
Height := 21;
TabOrder := 11;
Text := '337';
END;
Edit5 := TEdit.Create(GregsForm);
WITH Edit5 DO
BEGIN
Parent := GregsForm;
Left := 598;
Top := 279;
Width := 57;
Height := 21;
TabOrder := 12;
Text := '16304801';
END;
Edit6 := TEdit.Create(GregsForm);
WITH Edit6 DO
BEGIN
Parent := GregsForm;
Left := 503;
Top := 308;
Width := 33;
Height := 21;
TabOrder := 13;
Text := '888';
END;
Edit7 := TEdit.Create(GregsForm);
WITH Edit7 DO
BEGIN
Parent := GregsForm;
Left := 548;
Top := 308;
Width := 32;
Height := 21;
TabOrder := 14;
Text := '195';
END;
Edit8 := TEdit.Create(GregsForm);
WITH Edit8 DO
BEGIN
Parent := GregsForm;
Left := 662;
Top := 308;
Width := 53;
Height := 21;
TabOrder := 15;
Text := '231';
END;
Button1 := TButton.Create(GregsForm);
WITH Button1 DO
BEGIN
Parent := GregsForm;
Left := 712;
Top := 213;
Width := 221;
Height := 25;
Caption :=
'Click me, then click the "World Map" button';
TabOrder := 16;
Onclick := @clicked1;
END;
Button2 := TButton.Create(GregsForm);
WITH Button2 DO
BEGIN
Parent := GregsForm;
Left := 688;
Top := 247;
Width := 245;
Height := 25;
Caption :=
'Click me, then click the "petting grounds" Area';
TabOrder := 17;
Onclick := @clicked2;

END;
Button3 := TButton.Create(GregsForm);
WITH Button3 DO
BEGIN
Parent := GregsForm;
Left := 665;
Top := 276;
Width := 268;
Height := 25;
Caption :=
'Click me then click the "Blue Ocean" Area';
TabOrder := 18;
Onclick := @clicked3;
END;
Button4 := TButton.Create(GregsForm);
WITH Button4 DO
BEGIN
Parent := GregsForm;
Left := 733;
Top := 308;
Width := 200;
Height := 25;
Caption :=
'Click me, then click the "Red Bar" Area';
TabOrder := 19;
Onclick := @clicked4;
END;
Edit9 := TEdit.Create(GregsForm);
WITH Edit9 DO
BEGIN
Parent := GregsForm;
Left := 359;
Top := 281;
Width := 47;
Height := 21;
TabOrder := 20;
Text := '837';
END;
Edit10 := TEdit.Create(GregsForm);
WITH Edit10 DO
BEGIN
Parent := GregsForm;
Left := 431;
Top := 282;
Width := 48;
Height := 21;
TabOrder := 21;
Text := '464';
END;
Memo1 := TMemo.Create(GregsForm);
WITH Memo1 DO
BEGIN
Parent := GregsForm;
Left := 53;
Top := 93;
Width := 887;
Height := 105;
WITH Memo1.Lines DO
BEGIN
Add('This program will keep on refreshing the peting ground page unti');
Add('l you enter it');
Add('1. Drag the targeting cursor onto your borwsers title bar.');
Add('2. Fill in the cordinants Below. To get these cordinants, use ');
Add('the Color Picker tool.');
Add('3. Hit run, and watch it go :)');
Add('');
Add('If you are having trouble... here is an explanation of what it d');
Add('oes...');
Add('It will click on "World Map".');
Add('Then It will look for the "ocean" color so it knows when it is d');
Add('one loading.');
Add('Then it will click the area on the map for the petting grounds.');
Add('If it sees the red bar, it will know that it is full, and will r');
Add('epeat the loop untill it gets in.');
Add('');
Add('Credit Goes out to facebook, and the creators of the pets applic');
Add('ation.');
Add('Freddy and Fawki for making scar and srl what it is today :)');
Add('And the various developers of scar, for their wonderfull functio');
Add('n library!');
END;
ScrollBars := ssVertical;
TabOrder := 16;
END;
WriteLn('InitForm compiled in ' +
IntToStr(GetSystemTime - TimeInitForm) +
' milliseconds!');
END;

PROCEDURE SafeInitForm;
VAR
V: TVariantArray;
BEGIN
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
END;

PROCEDURE ShowInitFormModal;
BEGIN
GregsForm.ShowModal;
END;

PROCEDURE SafeShowInitFormModal;
VAR
V: TVariantArray;
BEGIN
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitFormModal', V);
END;

PROCEDURE MainInitForm;
BEGIN
SafeInitForm;
SafeShowInitFormModal;
FreeForm(GregsForm);
END;


BEGIN
setupsrl;
activateclient;
clearDebug;
GetSelf.WindowState := wsMinimized;
MainInitForm;
GetSelf.WindowState := wsNormal;
blueColor := 16304801;
redColor := 231;
worldMap.x := 792;
worldMap.y := 139;
pettingArea.x := 609;
pettingArea.y := 337;
errorArea.x := 888;
errorArea.y := 195;
times := 0;
writeln('script stated sucesfully..');
markTime(globalMark);
clearReport;
REPEAT
times := times + 1;
MarkTime(mark);
Mouse(worldMap.x, worldMap.y, 0, 0, True);
REPEAT
wait(200);
UNTIL (getColor(oceanArea.x, oceanArea.y) =
blueColor);
Mouse(pettingArea.x, pettingArea.y, 0, 0, True);
wait(2000);
clearDebug;
writeln('----Gregs Peting Ground Opener!!!----');
writeln('>Succesfully completed attempt number: ' +
IntToStr(times));
writeln('>It took ' + IntToStr(TimeFromMark(mark)) +
' milliseconds to complete');
AddToReport('Atempt #' + IntToStr(times) +
'--' + IntToStr(TimeFromMark(mark)) + 'ms');
Status('Total time running...' + IntToStr(
timefrommark(globalMark)) +
'ms and still going :)...');
UNTIL (NOT (getColor(errorArea.x, errorArea.y) =
redColor));
clearDebug;
writeln('----Gregs Peting Ground Opener!!!----');
writeln('>Succesfully Entered the Petting Ground!!!');
writeln('>That was ' + IntToStr(times * 3) +
' clicks i saved you!');
writeln('>It took ' +
IntToStr(TimeFromMark(Globalmark)) +
' milliseconds to complete');
END.

Here

2007-07-15 18:39:58

First post on something I'm not going to use.

3Garrett3

2007-07-16 14:22:14

Greg, what the fuck is up with your BEGIN and END and PROCEDURE and IF THEN WITH DO FOR TO DO, why are they all LIKE THIS?

LordGregGreg

2007-07-16 14:25:19

From: 3garrett3
Greg, what the fuck is up with your BEGIN and END and PROCEDURE and IF THEN WITH DO FOR TO DO, why are they all LIKE THIS?


lol , just my own preference to have keywords in caps so they stand out more. its not that uncomon really..