SRL Archive - OSR Help

Help me autocolor this


randy marsh

2013-04-29 19:12:23

1m pounds to who ever can get a decent color of this wall safe :(


NKN

2013-04-29 20:27:00

From: randy marsh
1m pounds to who ever can get a decent color of this wall safe :(



procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,256,334,343,529)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;

All I could do with that screen shot and my limited time.

Try it out for me pls.

randy marsh

2013-04-29 20:34:27

I was using dtms but they kept playing up..

 procedure CrackSafe;
var
Safe, x, y: Integer;
begin


Safe:= DTMFromString('mggAAAHicY2NgYGBnZGDgAWJGIOYGYhYoOwkoFwXEWVAMYicCsaWuNIOoqBCDqBAUA9nSopwMuAAjDgwBAFtlBCY=');
if FindDTM(Safe, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found safe!');
MMouse(x,y,2,2);
If IsUpText('safe') then
ClickMouse(x, y, 1);



end;

FreeDTM(Safe);
end;

NKN

2013-04-29 20:36:21

From: randy marsh
I was using dtms but they kept playing up..

 procedure CrackSafe;
var
Safe, x, y: Integer;
begin


Safe:= DTMFromString('mggAAAHicY2NgYGBnZGDgAWJGIOYGYhYoOwkoFwXEWVAMYicCsaWuNIOoqBCDqBAUA9nSopwMuAAjDgwBAFtlBCY=');
if FindDTM(Safe, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Found safe!');
MMouse(x,y,2,2);
If IsUpText('safe') then
ClickMouse(x, y, 1);



end;

FreeDTM(Safe);
end;

Swap out the coords for my code, and lemme know if it works.

If it doesn't I'll logon and look.

randy marsh

2013-04-29 20:38:05


randy marsh

2013-04-29 20:39:42

nope dint work maybe im doing something wrong

I need a smoke but I quit :fiery:

NKN

2013-04-29 20:40:41

From: randy marsh


Tested on that image, and it worked also.

What's the issue..?

And you changing the cords where the color finding is looking for it?

I have it searching a small area (Where the picture was)

randy marsh

2013-04-29 20:41:43

Could you post your code?

NKN

2013-04-29 20:43:50

From: randy marsh
Could you post your code?


I did… my first post.


if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,256,334,343,529)) then

Change the cords in that line to like, MSX1,MSY1,MSX2,MSY2 (80,256,334,343)

randy marsh

2013-04-29 20:46:17

Oh my bad 2am …

randy marsh

2013-04-29 20:49:10

I changed it to this:

  if(FindColorsSpiralTolerance(MSX1,MSY1,MSX2,MSY2(80,256,334,343)) then  

but then I get this



[Error] C:\Simba\Scripts\crack2.simba(68:51): Type mismatch at line 67 which is on that line

NKN

2013-04-29 20:49:31

From: randy marsh
Oh my bad 2am …


No problem.

Glad I could get that million pounds. ;)

randy marsh

2013-04-29 20:51:31

From: NKN
No problem.

Glad I could get that million pounds. ;)



not just yet!

Wait do u mean I should put my own cords ie a rough box shape round safe?

because ,I changed it to this:



Simba Code:



if(FindColorsSpiralTolerance(MSX1,MSY1,MSX2,MSY2(80,256,334,343)) then

but then I get this



[Error] C:\Simba\Scripts\crack2.simba(68:51): Type mismatch at line 67 which is on that line

NKN

2013-04-29 20:53:45

From: randy marsh
not just yet!

Wait do u mean I should put my own cords ie a rough box shape round safe?

because ,I changed it to this:



Simba Code:



if(FindColorsSpiralTolerance(MSX1,MSY1,MSX2,MSY2(80,256,334,343)) then

but then I get this



[Error] C:\Simba\Scripts\crack2.simba(68:51): Type mismatch at line 67 which is on that line

Delete (8 0,256,334,343), I was just telling you what numbers to change.

randy marsh

2013-04-29 20:58:03

if(FindColorsSpiralTolerance(MSX1,MSY1,MSX2,MSY2)) then   


changed it to that, I now get this:



[Error] C:\Simba\Scripts\crack2.simba(66:46): Variable Expected at line 65
(which is on that line)


[BANANA][/BANANA][BANANA][/BANANA][BANANA][/BANANA]

NKN

2013-04-29 21:00:07

From: randy marsh
if(FindColorsSpiralTolerance(MSX1,MSY1,MSX2,MSY2)) then   


changed it to that, I now get this:



[Error] C:\Simba\Scripts\crack2.simba(66:46): Variable Expected at line 65
(which is on that line)


[BANANA][/BANANA][BANANA][/BANANA][BANANA][/BANANA]


Keep the rest of the stuff in there… only change the cords.

randy marsh

2013-04-29 21:01:42


Sjoe

2013-04-29 21:04:41

learn to parameters

NKN

2013-04-29 21:04:56

From: randy marsh


We all have that moment. ;)

randy marsh

2013-04-29 21:05:43


randy marsh

2013-04-29 21:07:11

From: Sjoe
learn to parameters


Im getting annoyed with your snobbish comments I have been learning

Sjoe

2013-04-29 21:16:28

From: randy marsh
Im getting annoyed with your snobbish comments I have been learning


You're getting frustrated :)

And I've been helping you previously so stfu

randy marsh

2013-04-29 21:36:11

From: NKN
Keep the rest of the stuff in there… only change the cords.



Ok as soon as I think iv got it fixed this comes up


Error: Out Of Range at line 80:

Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);  

NKN

2013-04-29 21:38:50

From: randy marsh
Ok as soon as I think iv got it fixed this comes up


Error: Out Of Range at line 80:

Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);  

Not finding the colors.

You sure you got the code right?

Post it all.

randy marsh

2013-04-29 21:40:16

procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,256,334,343,529)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;

#NKN

NKN

2013-04-29 21:41:17

From: randy marsh
procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,256,334,343,529)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;

#NKN


You didn't change the cords…

Change where it's looking for them!

The 4 numbers after the color.

randy marsh

2013-04-29 21:45:56

From: NKN
You didn't change the cords…

Change where it's looking for them!

The 4 numbers after the color.


procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;

NKN

2013-04-29 21:47:51

From: randy marsh
procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;


Still not changed.

Change to MSX1,MSY1.MSX2,MSY2

randy marsh

2013-04-29 21:48:33

I give up this is bullshit

NKN

2013-04-29 21:50:39

From: randy marsh
I give up this is bullshit


Don't give up. :(

Sjoe

2013-04-29 22:08:24

From: randy marsh
procedure FindColorz;
var
TPA:TPointArray;
ATPA:T2DPointArray;
bmp:String;
i,p:integer;
begin
SetColorToleranceSpeed(3);
SetToleranceSpeed3Modifier(0.01);
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)) then
begin
SplitTPAWrap(TPA,1,ATPA);
p := length(ATPA);
for i := 0 to p-1 do
begin
writeln(p);
if(length(ATPA[i])<25) then
begin
DeleteValueInATPA(ATPA,i);
i := i-1;
p := p -1;
end;
end;
SortATPASize(ATPA,true);
Mouse(MiddleTPA(ATPA[0]).x,MiddleTPA(ATPA[0]).y,4,4,3);
end;
end;


FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)

function FindColorsSpiralTolerance(x, y: Integer; var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer): Boolean;

x1, y1, x2, y2 : this is the box where we will let simba search in.

In your case: MSX1, MSY1, MSX2, MSY2 ==> Which is the Mainscreen

Sawyer

2013-04-29 22:42:20

if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)) then
In order to change where it looks, change the 80, 412, 168, 174, 118 to MSX1, MSY1, MSX2, MSY2
Ex.
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,Color,Msx1,msy1,msx2,Msy2,Tolerance)) then

Whenever you do not know the parameters of a function, move your mouse over it and press CTRL+Space, and it will show you the parameters that are needed for the function.

From: randy marsh
Randy Marsh

randy marsh

2013-04-29 23:33:53

From: Sawyer
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,80,412,168,174,118)) then
In order to change where it looks, change the 80, 412, 168, 174, 118 to MSX1, MSY1, MSX2, MSY2
Ex.
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,Color,Msx1,msy1,msx2,Msy2,Tolerance)) then

Whenever you do not know the parameters of a function, move your mouse over it and press CTRL+Space, and it will show you the parameters that are needed for the function.


if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,MSX1, MSY1, MSX2, MSY2,529)) then

Thats it right?

t4q

2013-04-30 02:35:53

From: randy marsh
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,MSX1, MSY1, MSX2, MSY2,529)) then

Thats it right?

529 tolerance is pit much :)

NKN

2013-04-30 06:31:09

From: randy marsh
if(FindColorsSpiralTolerance(MSCX,MSCY,TPA,726038,MSX1, MSY1, MSX2, MSY2,529)) then

Thats it right?

Looks good

From: t4q
529 tolerance is pit much :)

CTS3

t4q

2013-04-30 06:53:14

From: NKN



CTS3


My bad, missed that

randy marsh

2013-04-30 11:09:22

From: t4q
My bad, missed that



cts?


Thanks nkn i got there in the end problem was it was also cliking on the floor in random places …


Thanks

Olly

2013-04-30 11:21:28

From: NKN
Looks good


CTS3


What? we have no code that will pick the best colors + tolerance + modifier for cts3, all cynics aca does is DISPLAY the values you put in.

randy marsh

2013-04-30 12:29:06

I need help with my tolerances (
If FindObjTPA( x, y, Safecolor, 10, 1, 20,80, 200,['Wall,afe']) then)

what should the height etc be set to?

heres a pic to show you rough height (Trying to click on safes)

[ATTACH=CONFIG]21013[/ATTACH]

program crack2;





{$I SRL-OSR/SRL.Simba}



//------------------------------------------------------------------\\
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username goes here
Players[0].Pass := ''; //Password goes here
Players[0].Nick := ''; //Character name (excluding first letter)
Players[0].Active := True;
end;
//--------------------------------------------------------------------\\



function Safecolor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.00);

if not (FindColorsTolerance(arP, 2832440, MSX1, MSY1, MSX2, MSY2, 0)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function Cracksafe:Boolean;
Var
X,Y:Integer;




Begin


If FindObjTPA( x, y, Safecolor, 10, 1, 20,80, 200,['Wall,afe']) then
Begin
Movemouse(x, y);
ClickMouse(x,y,2)
Writeln('Cracking safe');
end;

End;















begin
DeclarePlayers;
SetupSRL;
ActivateClient;
Repeat;
Cracksafe ;
until (false);
End.

Shuttleu

2013-04-30 13:04:06

how well does this work?
program FindObject;
{$i SRL\SRL.simba}

var
x, y: Integer;

function FindObject(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.94, 10.11);

if not(FindColorsTolerance(arP, 332316, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 18) and (R <= 38) and (G >= 8) and (G <= 25) and (B >= 0) and (B <= 11) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.37) and (X <= 1.15) and (Y >= 0.32) and (Y <= 1.08) and (Z >= 0.03) and (Z <= 0.40) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpTextMultiCustom(['Wall', 'afe'])) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;

begin
SetupSRL;
FindObject(x, y);
end.

~shut

randy marsh

2013-04-30 13:05:20

Im using osrs by the way :)


{$I SRL-OSR/SRL.Simba}

heres

guccis one for eoc scape:

    program SafeCracker;
{$DEFINE SMART8}
{$i SRL/SRL.simba}
{$i SPS/SPS.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$IFDEF SMART}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}

{***************************************************************
*******************Safe Cracker by Gucci************************
********************** Instructions ****************************
************** 1. Have food in first bank slot. ****************
************ 2. Make sure player is near Emerald. **************
******** 3. Have Stethoscope in first inventory slot. *********
****************** 4. Have inventory empty. ********************
******************** 5. Hit run and enjoy. *********************
***************************************************************}

const
SRLSTATS_USER = ''; // Your SRL Stats Username
SRLSTATS_PASSWORD = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NUMBOFPLAYERS = 1;
STARTPLAYER = 0;
HOWMUCHFOOD = 2; // How much food to withdraw (13 or less)
FOOD = 'SwordFish'; // MonkFish, Lobster or Shark (Will add others upon request)
STETHOSCOPE = 'yes'; //yes or no
HPFOREATING = 1500;
WHICHSAFES = 'north'; // South or North safes
GETMAPS = True; // Always leave True

var
MonkFish, x, y, NumbOfBanks, CurrentEXP, TotalEXP, StartEXP,
Lobster, Safe, Safe2, Shark, SafesFailed, FoodLeft, EmerBMP,
SappBMP, RubyBMP, DiamBMP, SafeBMP, Sapphires, Emeralds, Rubies,
CurrentGP, StartGP, Swordy: Integer;
thingy: String;
aFound: Extended;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];

With Players[0] do
begin
Name := ''; //Username.
Pass := ''; //Password.
Nick := ''; //Nickname
Pin := ''; // Pin
Active := True;
end;
end;

function Walking(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;
var
i, x, y, rx, ry: Integer;
TPA: TPointArray;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
SortTPAFrom(TPA, SortFrom);

for i := 0 to High(TPA) do
begin
x := TPA[i].x;
y := TPA[i].y;

rx := RandomRange(-6, 6);
ry := RandomRange(-6, 6);
if (not rs_OnMinimap(x + rx, y + ry)) then
Continue;

Mouse(x + rx, y + ry, 0, 0, true);
FFlag(0);
Wait(300 + Random(300));
Result := True;
Break;
end;
end;
{****************************************
* Procedure of downloading maps.
* Taken from Ashaman88.
*****************************************}
procedure DownloadImage(ImageName: String; Location: String);
var
Image, Path: string;
FP: Integer;
begin
Image:= GetPage(Location);
Path:= IncludePath + 'SPS\img\runescape_other\' + ImageName + '.png';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP);
end;

function GrabMaps: Boolean;
var
DENMap: String; //Map Locations
DENName: String; //Map Names
begin
DENName:= 'ROGUES_DEN';
DENMap:= 'http://i.imgur.com/2VztZ.png?1';
if GETMAPS then
begin
if (not FileExists(IncludePath + 'SPS\img\runescape_surface\ROGUES_DEN.png')) then
DownloadImage(DENName, DENMap);
end;
Result:= (FileExists(IncludePath + 'SPS\img\runescape_surface\ROGUES_DEN.png'));
end;

procedure WalkToSafe;
begin
case lowercase(WHICHSAFES) of

'south':
begin
SPS_WalkToPos(Point(257, 259));
end;

'north':
begin
SPS_WalkToPos(Point(259, 225));
MakeCompass('S');
end;
end;
Writeln('Walked to the safes.');
end;

procedure WalkToBank;
begin
Writeln('Walking to bank.');
case WHICHSAFES of

'south':
begin
case Random(2) of

0:
begin
Walking(2867698, 5, Point(MMCX, MMCY));
end;

1:
begin
RadialWalk(5263451, 240, 300, 55, -1, 2);
end;

2:
begin
SPS_WalkToPos(Point(210, 256));
end;
end;
end;

'north':
begin
SPS_WalkToPos(Point(210, 256));
end;
end;

repeat
Wait(100 + Random(100));
until(not(IsMoving))
end;

procedure DoneSafes;
begin
if FindBlackChatMessage('You slip and trigger a trap!') then
begin
Inc(SafesFailed);
end;
end;

function EmeraldColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.56, 1.15);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 3505508, MSX1, MSY1, MSX2, MSY2, 11);
if (Length(arP) = 0) then
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.68) and (X <= 35.02) and (Y >= 6.39) and (Y <= 41.33) and (Z >= 3.35) and (Z <= 9.76) then
begin
Result := arC[i];
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
end;

function FindEmerald(x, y: Integer): Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.56, 1.15);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, EmeraldColor, MSX1, MSY1, MSX2, MSY2, 11);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
if High(TPA) > 100 then
MMouse(x, y, 2, 2);
if(IsUpTextMultiCustom(['alk', 'merald', 'enedict'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;

procedure Hop;
begin
if Length(GetMinimapDotsIn('player', MMX1, MMY1, MMX2, MMY2)) >= 4 then
begin
ExitToLobby;
OpenWorldScreen;
SelectWorld(RandomWorld(True, False));
end;
end;

procedure FoodCheck;
begin
case FOOD of
'MonkFish':
begin
FoodLeft := CountItems('dtm', MonkFish, []);
end;

'Lobster':
begin
FoodLeft := CountItems('dtm', Lobster, []);
end;

'Shark':
begin
FoodLeft := CountItems('dtm', Shark, []);
end;

'SwordFish':
begin
FoodLeft := CountItems('dtm', Swordy, []);
end;
end;
end;

procedure GetFood;
var
x, y: integer;
begin
case STETHOSCOPE of

'no':
begin
if (BankScreen) or (PinScreen) then
begin
if (PinScreen) then
repeat
InPin(Players[0].Pin);
until (BankScreen);

if (BankScreen) then
begin
DepositAll;
Wait(RandomRange(300, 400));
WithDraw(0, 0, HOWMUCHFOOD);
CloseBank;
end;
end;
end;

'yes':
begin
if (BankScreen) or (PinScreen) then
begin
if (PinScreen) then
repeat
InPin(Players[0].Pin);
until (BankScreen);

if (BankScreen) then
begin

if FindBitmapToleranceIn(SappBMP, x, y, MIX1, MIY1, MIX2, MIY2, 45) then
begin
MMouse(x, y, 0, 0);
ClickMouse2(mouse_right);
WaitOption('ll', 500);
end;

if FindBitmapToleranceIn(EmerBMP, x, y, MIX1, MIY1, MIX2, MIY2, 45) then
begin
MMouse(x, y, 0, 0);
ClickMouse2(mouse_right);
WaitOption('ll', 500);
end;

if FindBitmapToleranceIn(RubyBMP, x, y, MIX1, MIY1, MIX2, MIY2, 45) then
begin
MMouse(x, y, 0, 0);
ClickMouse2(mouse_right);
WaitOption('ll', 500);
end;

if FindBitmapToleranceIn(DiamBMP, x, y, MIX1, MIY1, MIX2, MIY2, 45) then
begin
MMouse(x, y, 0, 0);
ClickMouse2(mouse_right);
WaitOption('ll', 500);
end;

Wait(RandomRange(300, 400));
if FoodLeft = 0 then
begin
WithDraw(0, 0, HOWMUCHFOOD);
end;
CloseBank;
end;
end;
end;
end;
end;

function EatFood: Boolean;
begin
Result := False;
if (GetMMLevels('hp', thingy) < HPFOREATING) then
begin
Result := True;
end;
end;

procedure Eat;
var
x, y: integer;
begin
case FOOD of
'MonkFish':
begin
if EatFood = True then
begin
Writeln('Need to eat food.');
if FindDTM(MonkFish, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('at') then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, False);
Wait(RandomRange(200, 300));
ChooseOption('at');
end;
end;
repeat
Eat;
until(EatFood = False)

end;
end;

'Lobster':
begin
if EatFood = True then
begin
Writeln('Need to eat food.');
if FindDTM(Lobster, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('at') then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, False);
Wait(RandomRange(200, 300));
ChooseOption('at');
end;
end;
repeat
Eat;
until(EatFood = False)

end;
end;

'Shark':
begin
if EatFood = True then
begin
Writeln('Need to eat food.');
if FindDTM(Shark, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('at') then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, False);
Wait(RandomRange(200, 300));
ChooseOption('at');
end;
end;
repeat
Eat;
until(EatFood = False)
end;
end;

'SwordFish':
begin
if EatFood = True then
begin
Writeln('Need to eat food.');
if FindDTM(Swordy, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
if IsUpText('at') then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, False);
Wait(RandomRange(200, 300));
ChooseOption('at');
end;
end;
repeat
Eat;
until(EatFood = False)
end;
end;
end;
end;

procedure DTMS;
begin
Safe := DTMFromString('mLgAAAHicY2JgYMhnZGBIAeKvQPZzII5yMWIoivVh4AKyQZgRihkYAIqnBLU=');
Safe2 := DTMFromString('mLgAAAHicY2JgYNBjZGDQAuLXQPYTIPa21GQICw5i4AKyWYGYEYoZGABvOgPl');
MonkFish := DTMFromString('mLgAAAHicY2JgYNBjYmAwBeKpjAwM/UA8t6qCwdZUn4ELKAfCjFDMwAAAawkD1g==');
Lobster := DTMFromString('mLgAAAHicY2JgYLjDyMDwEognAHEbEK8Pl2C4lyfPwAWUA2FGKGZgAACm8wWB');
Swordy := DTMFromString('mLgAAAHicY2JgYNgPxCeB+CUQPwfiqZELGNrj+xhYgWwQZoRiBgYAvboGaQ==');
Shark := DTMFromString('mGQAAAHicY2RgYGBjYmBoY2RgqEgKYGAF8oFMBgYAGCABwQ==');
EmerBMP := BitmapFromString(12, 17, 'meJyN0b0KgzAQwPFZzJdXkyfq7FSwUAep0G4+g6FT6Ut7NSU9TxOE/3Y/jiOxHqwH3clfN0ErzwVmFxNiAJOXbxFUD40dMYylDGUZE1neBEaNe5+2BnOfWvfSThCC0ewydRXRVE+9m2jKjMEpvrxqk3sCYIay//clDAVbgzHAjLkr2sq8wAwqEx4/AxlAbCw=');
SappBMP := BitmapFromString(13, 17, 'meJyN0rEKwkAMgOHipuZMe165vpGLIIibglAHEcRuvkRvFJ/XYCDE9ozCP35kSJJiSDGcygXXfraCKTUpivRmXDtiewROzM0j9ScbSINpaTORPxlLNmuYsXk09ZhRz6Y+V0isj4G7L8usPKLbwFxY5zHbzoHNCNBdDuY0NswoYVrKiQ2mTZb16lW+sUuFugGj3V49Gm0dUC/4hHvA');
RubyBMP := BitmapFromString(14, 18, 'meJyN0rEKwjAQgOHiZNrTpHUwjyFkEyEiQsXBIiiIi48gLuLje3gYk0tMC/+Q4eMy3BnbjoqCVakDRu/FcmNsaz6sUseojhrDynk5v1Mxc5i8k1/fsUq5o3wGzQUbLhnOSx/3SoeHSMLEBNif1M9YYrV+QX0KJM6c3ZIY9yUm6/D3azIx3fZKNLi1Uu7zkhhJTOlHEvsHk5HstJIyPKq/EpqzH5NvIIpyRQ==');
DiamBMP := BitmapFromString(14, 15, 'meJyFz9EGw0AUhOHIm4ZYWa1KhaaRUCUSVkqpXPUddnvVvF5OHMZyNhv+y88w1i3WLe63ZcybapoHKq83ZIX08aEElpKxLxmDZZmKSApsk/aP5vkrcV13Uk7TR6b1Jc81FZdt+6yq+6EkxpIxHQliZpBUUIJFJOWzPdn3BgUlNYyvvYrizKVJgp0IU+q0Agm/WVs=');
SafeBMP := BitmapFromString(21, 15, 'meJyNku1L21AUh/8L/TYr1dIaa19M04XGmDTWlmpbm9a6LnQhlFDciiiIUMYQBhsTXxDHEPww2H+6Zxx3EWUweAjh5j7n/s65iaI4+ksYjhVBECqGw9FTarVGoaj33k2ddhj9Qx+NIsUz3fO2c7kC+t7byf/oz5KgQ7U7hpRWaDZbivF4oojjQwWBFY7rWZaNS/h0Vtd1QyHHvSxSLpsKdNjqxbDRDFihl9XVNbBtVyXxewMFswK2pVLpubl5qeB2opLboSOpAGQTt93297p9hXyFRGKRCoRHIb+xsQ1sUK0hvkRFqjd2QHSq4eoVjx53dzsgm+XEfHWwZvvA/un7CVBc5UHPZLTXmw1YSKaZj6z/+vnw5fP5x9kZes7pr5g7D/ffzz/N5L5ADkInQ8VrwVP9sVmnX/SGPIFqCc00TUsgHnPjBX2z7gP6wUEgIpVLjdDyp1cXXzl0vRbAq4whLvn394fAO9eUN2zg9ldyBgGkd1yUH3c3cHpyRPtLBderOlJBBphMLqO338SCVnIZoAwZK2t1bi6/CVqltZi1jo8+yHVL71A0H/V6d1T2/kxY1m+vLwhJcRAF5JeQDcwcBgP/N+PwH8Y=');
end;

function SafeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 1.00);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 4147799, MSX1, MSY1, MSX2, MSY2, 4);
if (Length(arP) = 0) then
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 5.58) and (X <= 9.64) and (Y >= 5.51) and (Y <= 9.45) and (Z >= 4.00) and (Z <= 6.80) then
begin
Result := arC[i];
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
end;

function Cracking: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 450, 600) > 250);
end;

function FindSafe(x, y: Integer): Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 1.00);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, SafeColor, MSX1, MSY1, MSX2, MSY2, 4);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
if High(TPA) > 100 then
MMouse(x, y, 2, 2);
if(IsUpTextMultiCustom(['rack', 'all', 'afe'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;

procedure FrDTMS;
begin
FreeDTMS([Safe, MonkFish, Swordy, Lobster, Shark, Safe2]);
FreeBitmap(SappBMP);
FreeBitmap(RubyBMP);
FreeBitmap(EmerBMP);
FreeBitmap(DiamBMP);
FreeBitmap(SafeBMP);
end;

procedure Proggy;
begin

CurrentEXP := GetXPBarTotal;
TotalEXP := (CurrentEXP - StartEXP);
Stats_IncVariable('Thieving EXP (Gained)', (TotalEXP));

ClearDebug;
Writeln('############# Guccis Safe Cracker ###########');
Writeln('|= Player : ' + Players[CurrentPlayer].Nick);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= EXP Gained : ' + IntToStr(TotalEXP));
Writeln('|= GP Gained : ' + IntToStr(CurrentGP - StartGP));
Writeln('|= Sapphires : ' + IntToStr(Sapphires));
Writeln('|= Emeralds : ' + IntToStr(Emeralds));
Writeln('|= Rubies : ' + IntToStr(Rubies));
Writeln('|= Safes Done : ' + IntToStr(TotalEXP/70));
Writeln('|= Safes Failed : ' + IntToStr(SafesFailed));
Writeln('#############################################');

Stats_Commit;
end;

procedure OnSmart;
var
XPH, XP: Integer;
begin
CurrentEXP := GetXPBarTotal;
XPH := round((CurrentEXP - StartEXP) / (GetTimeRunning / 3600000.0));
XP := (CurrentEXP - StartEXP);

Smart_ClearCanvas;
SMART_DrawTextEx(False, 8, 79, SmallCharsNS, 'Guccis Safe Cracker', clWhite);
SMART_DrawTextEx(False, 8, 92, SmallCharsNS, 'Player:' + Players[CurrentPlayer].Nick, clWhite);
SMART_DrawTextEx(False, 8, 105, SmallCharsNS, 'Time Running:' + TimeRunning, clWhite);
SMART_DrawTextEx(False, 8, 118, SmallCharsNS, 'XP Gained:' + IntToStr(XP), clWhite);
SMART_DrawTextEx(False, 8, 131, SmallCharsNS, 'XP/H:' + IntToStr(XPH), clWhite);
end;

procedure BankEmerald;
begin
if FindObjCustom(x, y, ['alk', 'merald', 'enedict'], [3101758, EmeraldColor], 11) or FindEmerald(x, y) then
begin
MMouse(x, y, 0, 0);
if IsUpText('merald') then
begin
ClickMouse2(mouse_right);
WaitOption('ank', 1000);
Inc(NumbOfBanks);
end;

if DidRedClick then
begin
repeat
Wait(100);
until(BankScreen)
end;
end;
end;

procedure OpenSafe;
var
x, y, t, StartCount, EndCount, REXP, SEXP: integer;
vable: Extended;
begin
if (EatFood = True) then
begin
Eat;
end;

if (EatFood = False) and (Cracking = False) then
begin
StartCount := InvCount;
SEXP := GetXPBarTotal;
Writeln('Dont need to eat food and not currently cracking a safe.');
case lowercase(WHICHSAFES) of

'south':
begin
if FindDTMRotated(Safe, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) or FindDeformedBitmapToleranceIn(SafeBMP, x, y, MSX1, MSY1, MSX2, MSY2, 15, 5, True, vable) or FindSafe(x, y) then
end;

'north':
begin
if FindDTMRotated(Safe2, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) or FindDeformedBitmapToleranceIn(SafeBMP, x, y, MSX1, MSY1, MSX2, MSY2, 15, 5, True, vable) or FindSafe(x, y) then
end;
end;

begin
//Smart_DrawBoxEx(True, False, [Box], clWhite);
MMouse(x, y, 1, 1);
if WaitUpText('afe', 100) then
begin
ClickMouse2(True);
MarkTime(t);
Wait(100 + Random(50));
end;
end;
repeat
Wait(500 + Random(100));
DoneSafes;
EndCount := InvCount;
REXP := GetXPBarTotal;
FindNormalRandoms;
OnSmart;
Proggy;
FoodCheck;
until((TimeFromMark(t) >= 12000) or (REXP > SEXP) or FindBlackChatMessage('slip and trigger') or (EndCount > StartCount) or FindBlackChatMessage('coins have'))
end;
end;

procedure CountGP;
begin
CurrentGP := GetMoneyPouchAmount;
end;

procedure CountGems;
begin
IncEx(Sapphires, CountItems('bmp', SappBMP, [45]));
IncEx(Emeralds, CountItems('bmp', SappBMP, [45]));
IncEx(Rubies, CountItems('bmp', SappBMP, [45]));
end;

begin
ClearDebug;
{$IFDEF SIMBAMAJOR980}
SMART_SERVER := 24;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
{$ELSE}
SMART_FIXSPEED := TRUE;
{$ENDIF}
GrabMaps;
ActivateClient;
SetupSRL;
SPS_AnyAngle := True;
SPS_Setup(RUNESCAPE_OTHER, ['ROGUES_DEN']);
SRL_SixHourFix := True;
DTMS;
SafeColor;
EmeraldColor;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000 + Random(400));
StartEXP := GetXPBarTotal;
FindNormalRandoms;
ToggleXPPopUp(True);
StartGP := GetMoneyPouchAmount;
ClickNorth(SRL_ANGLE_HIGH);
SetupSRLStats(1295, SRLSTATS_USER, SRLSTATS_PASSWORD);
repeat
if (InvCount < 2) then
begin
Writeln('Getting food.');
FoodCheck;
repeat
BankEmerald;
until(BankScreen)

repeat
GetFood;
until(InvCount >= 2)
end;
if InvCount < 14 then
begin
WalkToSafe;
end;
if (not(InvFull)) then
begin
repeat
OpenSafe;
EatFood;
Eat;
until(InvFull or (FoodLeft = 0));
end;
if (FoodLeft = 0) or InvFull then
begin
Writeln('Food left:' + IntToStr(FoodLeft));
CountGems;
CountGP;
Proggy;
repeat
WalkToBank;
until(Flag)
repeat
BankEmerald;
until(BankScreen)
if BankScreen then
begin
FoodCheck;
GetFood;
end;
end;
until(False)
FrDTMS;
end.

randy marsh

2013-04-30 13:09:26

From: Shuttleu
how well does this work?
program FindObject;
{$i SRL\SRL.simba}

var
x, y: Integer;

function FindObject(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.94, 10.11);

if not(FindColorsTolerance(arP, 332316, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 18) and (R <= 38) and (G >= 8) and (G <= 25) and (B >= 0) and (B <= 11) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.37) and (X <= 1.15) and (Y >= 0.32) and (Y <= 1.08) and (Z >= 0.03) and (Z <= 0.40) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpTextMultiCustom(['Wall', 'afe'])) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;

GetMousePos(fx, fy);
end;

begin
SetupSRL;
FindObject(x, y);
end.

~shut


Just hovered around the floor :(

Sjoe

2013-04-30 13:23:03

Seems impossible to do with colors :s

U could ask Olly, or Flight. They're master at the usage of TPA's :)

randy marsh

2013-04-30 13:32:20

From: Sjoe
Seems impossible to do with colors :s

U could ask Olly, or Flight. They're master at the usage of TPA's :)



But theres two safe crackers on eoc runescape they use bitmaps and dtms?

randy marsh

2013-04-30 14:16:21

Download here[ATTACH=CONFIG]21014[/ATTACH]



program crack2;





{$I SRL-OSR/SRL.Simba}





const
SRLSTATS_USER = ''; // Your SRL Stats Username
SRLSTATS_PASSWORD = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NUMBOFPLAYERS = 1;
STARTPLAYER = 0;


var
x, y, Safe, Safe2, Shark,
SafeBMP:Integer;
String,aFound: Extended;

//------------------------------------------------------------------\\
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username goes here
Players[0].Pass := ''; //Password goes here
Players[0].Nick := ''; //Character name (excluding first letter)
Players[0].Active := True;
end;
//--------------------------------------------------------------------\\



procedure DTMS;
begin
Safe := DTMFromString('mggAAAHicY2NgYPjEyMDwE4jfAPF3KP0RiLmAmBGIOaFsfiBmAuKyKHMGCwsdBjcLC4bMQAMwXZ9oxYALMOLAEAAA/r8LBg==');
Safe2 := DTMFromString('mggAAAHicY2NgYDjMxMBwGor3A/EhKL0OKLcciLcB8VogXgrEW4G4OlyWwcJCB4zdLCzgNC7AiANDAACwsQzz');
safeBmp := BitmapFromString(25, 35, 'meJzFld9r2mAUhq+98EIQhICIIC' +
'ISJEWKwRLpEDKyQEcrNEXaZiOua7cyL8YG3Q8GBWH7q91rTnK+Yz6' +
'/mm0XgwfBCx/PeXNyTtuP237c7E0q/i3RPf3Qv3jon38i8JXpBAum' +
'dRyBWsehX63X6+7Ju9b0smb1WDV49QiVe/WFGZ4vGef0jiAVKKjYQ' +
'yo3/s4cXnxkDmb3YHByA3RVJ3wL2IOOCqrR/DNDKgISa/wSVFt9Vl' +
'ldl1VOshpc/xi/VrBHtklVkapidVhVqVlPqJDVzsIQC2gMfZCpggV' +
'77Pk3qI4Wj4zstFAVaHozULePSCUDd978At7NipC1yfD5ISpV3YKq' +
'0R6CnSrCNBV2mKiHmKrkAyXV5O4nY5qKbB7SuAiTynbdMsBGDxGYV' +
'K7r761qYwuTLVVaXjW4B/9RVWzwz1U0CVDhU6qwYZBVeRVP+44G09' +
'j/RdVwnoGnG2xGX6vhErBqa0TTrDDtf6fSYzeqkhWQKqBvLRm7VFH' +
's2DO6irNiCcllVnpVOBNGVf4uc78yKz4WUDXtKbFXRR626ar2QbhH' +
'lSNVnJVU1cdnhK4qbHipQrNQ0bFQKi/aeOi/hGprLYvtVxhRilqpv' +
'EhVnqvUFjWs9ywrsfpMqjJssqKxDJcb1fElkDmUWch8KQBOaqaizA' +
'2qnbdVDXyY4AjSr/QGSxbGx4tKkip7Eve9OdMbR1v3y5A83peW85x' +
'VkBBS1R3NQOEaygbtILZGL4BUyUoI8hD6uVd3md+4XGWF7zOCW6Yx' +
'jRlKICN/NUBtGBCs+g2pNUfx');
end;


function SafeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 1.00);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 4147799, MSX1, MSY1, MSX2, MSY2, 4);
if (Length(arP) = 0) then
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 5.58) and (X <= 9.64) and (Y >= 5.51) and (Y <= 9.45) and (Z >= 4.00) and (Z <= 6.80) then
begin
Result := arC[i];
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
end;

function Cracking: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 450, 600) > 250);
end;

function FindSafe(x, y: Integer): Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 1.00);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, SafeColor, MSX1, MSY1, MSX2, MSY2, 4);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
if High(TPA) > 100 then
MMouse(x, y, 2, 2);
if(IsUpTextMultiCustom(['rack', 'all', 'afe'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;





procedure DoneSafes;
begin
if FindBlackChatMessage('You slip and trigger a trap!') then
Writeln('You slip and trigger a trap!');
end;

procedure OpenSafe;
var
x, y, t, StartCount, EndCount, REXP, SEXP: integer;
vable: Extended;
begin

begin

begin
if FindDTMRotated(Safe, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) or FindDeformedBitmapToleranceIn(SafeBMP, x, y, MSX1, MSY1, MSX2, MSY2, 15, 5, True, vable) or FindSafe(x, y) then
end;

begin
if FindDTMRotated(Safe2, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) or FindDeformedBitmapToleranceIn(SafeBMP, x, y, MSX1, MSY1, MSX2, MSY2, 15, 5, True, vable) or FindSafe(x, y) then
end;
end;

begin
MMouse(x, y, 1, 1);
if WaitUpText('afe', 100) then
begin
ClickMouse2(True);
MarkTime(t);
Wait(100 + Random(50));
end;
end;
repeat
Wait(500 + Random(100));
DoneSafes;
until((TimeFromMark(t) >= 6000) or (REXP > SEXP) or FindBlackChatMessage('slip and trigger') or (EndCount > StartCount) or FindBlackChatMessage('coins have'))
end;


procedure FrDTMS;
begin
FreeDTMS([Safe, Safe2]);
FreeBitmap(SafeBMP);
end;






begin
DeclarePlayers;
SetupSRL;
ActivateClient;
DTMS;
SafeColor;

Repeat;
OpenSafe;
until (false);
End.

randy marsh

2013-04-30 15:37:12

Bmup tester needed :)

litoris

2013-05-01 05:43:18

I'll be really surprised if a bitmap really works there.

Anyways, that looks impossible to detect with simple TPA searches.
Someone should try to detect the lines between the bricks on the wall, and then click the middle of the largest gap(the safes)