SRL Archive - Discussions and Debates

Another Pmed Beta script to me.


Mat

2012-02-02 10:20:56

Looks okay, Made by jordi1104
He Pmed me it.
Before I run anything bad about it?
Doesn't look bad, just a bit scruffy :P
program FindObject;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

var
x, y: Integer; C:TBox;
Path: TStringArray;
I: Integer;

//General variables
Version: String;
ReportTime,PostID,
CommitTime,EssPrice,
NaturePrice,Profit: Integer;
XPMod: Extended;

//Dynamics
Stage,Walk_Fail,AmCount,RuneCount,
Exp,Exp_C,RuneCount_C,Tele_Fail: Integer;
DidCheck,OptionsSet: Boolean;
Path_ToAlter,Path_ToOb: TPointArray;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Member := False;
Players[0].Active := True;
end;

procedure Setup;
begin

Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;

ClearDebug;
SetupSRL;

DeclarePlayers;

if not (LoggedIn) then
LoginPlayer;

ObjDTM_Setup;
ObjDTM_Debug := True;
end;

function Pureess(var fx, fy: Integer): Boolean;
var
x, y, Pure: Integer;
begin
ClearDebug;
SetupSRL;
Pure := DTMFromString('mGQAAAHicY2RgYPBhYmC4DaRXzSpkYAPSjEDMAAAqEQLn');
MakeCompass('n');
SetAngle(SRL_ANGLE_HIGH);
if FindDTM(Pure, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 4, 4, True);
end;
FreeDTM(Pure);
end;

function FindObject(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

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

SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 20, 20);
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));
ClickMouse2(True);
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);

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

GetMousePos(fx, fy);
end;

procedure Unnote;
begin
ClickContinue(True, True);
wait(randomRange(6000, 9000));
FindNPCChatText('X', ClickLeft);
wait(randomRange(2000, 3000));
TypeSend('26');
wait(randomRange(2000, 3000));
ClickContinue(True, True);
FindNPCChatText('It', ClickLeft);
wait(randomRange(2000, 3000));
ClickContinue(True, True);
end;

Procedure WalkToAlter;
begin

Setup;

Path := ['112:49:6:1:7:103:103:1:7:111:107:1:7:102:117:1:7:136:97:1:7:141:83:1:7:111:128',
'131:95:8:1:7:116:45:1:7:99:41:1:7:87:33:1:7:107:116:1:7:78:140:1:7:69:136:1:7:102:130:1:7:128:116',
'126:99:8:1:7:78:103:1:7:57:103:1:7:66:32:1:7:90:120:1:7:74:119:1:7:53:117:1:7:107:120:1:7:50:28',
'133:83:10:1:7:103:116:1:7:90:120:1:7:69:120:1:7:57:116:1:7:61:103:1:7:44:103:1:7:32:86:1:7:69:132:1:7:103:133:1:7:120:112',
'118:118:6:1:7:95:116:1:7:70:112:1:7:65:129:1:7:53:116:1:7:99:133:1:7:86:137',
'120:113:9:1:7:61:82:1:7:65:99:1:7:53:103:1:7:37:78:1:7:61:112:1:7:31:95:1:7:19:82:1:7:65:125:1:7:44:120',
'103:128:9:1:7:134:75:1:7:129:87:1:7:27:69:1:7:23:82:1:7:27:95:1:7:69:117:1:7:56:121:1:7:69:129:1:7:112:104',
'113:117:11:1:7:91:57:1:7:100:74:1:7:117:75:1:7:122:53:1:7:109:40:1:7:48:69:1:7:48:82:1:7:36:73:1:7:35:91:1:7:109:96:1:7:91:117',
'116:122:16:1:7:79:61:1:7:96:66:1:7:108:70:1:7:105:49:1:7:88:40:1:7:70:40:1:7:83:100:1:7:82:113:1:7:70:95:1:7:61:82:1:7:117:83:1:7:125:96:1:7:134:83:1:7:126:75:1:7:52:108:1:7:60:125',
'113:106:16:1:7:61:78:1:7:52:91:1:7:53:56:1:7:52:69:1:7:40:51:1:7:96:52:1:7:109:53:1:7:105:40:1:7:96:31:1:7:88:40:1:7:79:26:1:7:82:113:1:7:73:121:1:7:65:112:1:7:56:121:1:7:35:99',
'80:133:13:1:7:112:101:1:7:103:118:1:7:126:88:1:7:130:71:1:7:122:58:1:7:52:86:1:7:60:104:1:7:43:95:1:7:35:86:1:7:79:26:1:7:66:26:1:7:56:122:1:7:47:112',
'82:140:19:1:7:109:66:1:7:104:96:1:7:117:49:1:7:126:66:1:7:121:84:1:7:117:105:1:7:61:104:1:7:48:108:1:7:52:91:1:7:39:95:1:7:48:78:1:7:35:77:1:7:44:60:1:7:53:61:1:7:49:43:1:7:58:35:1:7:66:52:1:7:61:70:1:7:65:82',
'105:123:8:1:7:66:44:1:7:53:48:1:7:58:31:1:7:45:35:1:7:121:75:1:7:72:23:1:7:109:36:1:7:122:45',
'124:120:6:1:7:125:75:1:7:125:50:1:7:104:32:1:7:90:121:1:7:77:124:1:7:77:133',
'102:110:12:1:7:104:45:1:7:88:32:1:7:53:78:1:7:57:99:1:7:65:107:1:7:40:82:1:7:40:90:1:7:44:103:1:7:48:115:1:7:52:124:1:7:35:115:1:7:23:102'];

begin

for I := 0 to 14 do
begin

ObjDTM_Walk(Path[i], 0, 100, 80, True);
end;
end;
end;

Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;

Function FindObjSimple_F(Colors: TIntegerArray; TheUpText: TStringArray; midx, midy: integer): Boolean;
Var
T,i,X,Y: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
Begin
MarkTime(T);
Repeat
SetArrayLength(ATPA, Length(Colors));
for i := 0 to High(Colors) do
FindColorsSpiralTolerance(midx, midy, ATPA[i], Colors[i], MSX1, MSY1, MSX2, MSY2, 15);
TPA := MergeATPA(ATPA);
ATPA := TPAtoATPAEx(TPA, 15, 15);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
if (Length(ATPA) = 0) then
Exit;

MiddleTPAEx(ATPA[0], x, y);

if (TimeFromMark(T) > 5000) then
Exit;

HumanMMouse(x, y, 10, 10);
Wait(randomrange(75,125));
If(IsUpTextMultiCustom(TheUpText)) then
begin
ClickMouse2(True);
if DidRedClick then
begin
Result := True;
Break;
end;
end;
Until(Result)
end;

Function enteralter: Boolean;
var
Tries,T: Integer;
label
Start;
begin
While IsMoving do
wait(1);
Tries := 0;
Start:
if FindObjSimple_F([4912288,5045653,6414239], ['nter','Myst','erious','ruins'], MSCX, MSCY) then
begin
While IsMoving do
wait(1);
MarkTime(T);
repeat
FindNormalRandoms;
if TimeFromMark(T) > 5000 then
Exit;
break;
until(False)

begin
Inc(Tries);
if (Tries > 2) then
begin
Result := False;
Exit;
end;
goto Start;
end;
end;
end;

Function CraftRunes: Boolean;
var
RNew,ROld,Seq,
T,T2,A,B: Integer;
label
Start;
begin
Seq := 0;
ROld := getAmountBox(invBox(1));

MarkTime(T)
repeat
FindNormalRandoms;
MMouse(260, 16, 10, 5);
if WaitUpTextMulti(['Craft','rune','Altar'], 300) then
break;
Wait(RandomRange(300, 555));
until(TimeFromMark(T) > 5000)

ClickMouse2(True);
FFlag(0);
while IsMoving do
wait(1);
Wait(RandomRange(1350, 1725));

Start:


begin
MarkTime(T2)
repeat
FindNormalRandoms;
MMouse(260, 115, 35, 35);
if WaitUpTextMulti(['Craft','rune','Altar'], 300) then
break;
Wait(RandomRange(300, 555));
until(TimeFromMark(T2) > 5000)

ClickMouse2(True);
if not DidRedClick then
goto Start;

if (Seq < 2) then
MMouse(640, 220, 15, 15)
else
MMouse(685, 180, 10, 10);

FFlag(0);
Wait(RandomRange(175, 350));
While IsMoving do
Wait(1);
Wait(RandomRange(1050, 1425));
end;
end;

function FindObjTPAMulti_Pat(var X, Y: Integer; Colour: TIntegerArray; Tol, CTS, ObjWidth, ObjHeight, minCount: Integer; UpText: TStringArray): Boolean;
var
i, tCTS: Integer;
myPoint: TPoint;
aPoints: T2DPointArray;
ATPA: T2DPointArray;
TPA: TPointArray;
begin
Result := False;
if not LoggedIn then exit;
tCTS := GetColorToleranceSpeed;
CTS := Integer(CTS * 9 mod 3 <> 0);
ColorToleranceSpeed(CTS);
SetLength(ATPA, Length(Colour));
for i := 0 to High(Colour) do
begin
FindColorsSpiralTolerance(x, y, ATPA[i], Colour[i], MSX1, MSY1, MSX2, MSY2, Tol);
end;
TPA := MergeATPA(ATPA);
if Length(TPA) = 0 then
begin
ColorToleranceSpeed(tCTS);
Exit;
end;
ColorToleranceSpeed(1);
aPoints := TPAtoATPAEx(TPA, ObjWidth, ObjHeight);
SortATPAFrom(aPoints,Point(199,268));
for I := 0 to High(aPoints) do
begin
if Length(aPoints[i]) < minCount then
Continue;
myPoint := MiddleTPA(aPoints[i]);
MMouse(myPoint.x, myPoint.y, 0, 0);
if WaitUpTextMulti(UpText, 300) then
begin
GetMousePos(X, Y);
Result := True;
ColorToleranceSpeed(tCTS);
Exit;
end;
end;

ColorToleranceSpeed(tCTS);
end;

Procedure Walktoportal;
begin


Setup;

Path := ['78:94:8:1:7:124:54:1:7:124:62:1:7:124:77:1:7:136:77:1:7:132:89:1:7:121:97:1:7:117:109:1:7:102:117'];

begin


for I := 0 to 0 do
begin

ObjDTM_Walk(Path[i], 0, 100, 80, True);
end;

end;
end;

function FindPortal:Boolean;
var
x,y:Integer;
begin
Result:=False;
Wait(1500);
While IsMoving do
Wait(100);
if FindObjTPAMulti_Pat(x,y,[5213069,6265756],10,1,20,20,5,['Enter','nter']) then
begin
Mouse(x,y,2,2,mouse_Left);
Wait(2000+Random(500));
Result:=True;



end;
end;

Procedure WalkBack;
begin

Setup;

Path := ['46:41:12:1:7:55:89:1:7:48:81:1:7:45:63:1:7:32:74:1:7:36:85:1:7:90:32:1:7:40:97:1:7:36:108:1:7:47:122:1:7:44:105:1:7:85:135:1:7:28:97',
'77:31:10:1:7:113:59:1:7:128:71:1:7:113:36:1:7:36:105:1:7:43:112:1:7:59:112:1:7:55:124:1:7:74:124:1:7:85:120:1:7:93:128',
'69:30:11:1:7:102:67:1:7:109:47:1:7:102:39:1:7:91:32:1:7:117:43:1:7:121:55:1:7:51:39:1:7:40:43:1:7:121:82:1:7:133:75:1:7:120:106',
'89:26:18:1:7:66:70:1:7:63:90:1:7:55:78:1:7:27:78:1:7:43:82:1:7:51:93:1:7:39:66:1:7:51:66:1:7:63:58:1:7:67:43:1:7:59:27:1:7:113:39:1:7:105:55:1:7:121:55:1:7:118:71:1:7:113:90:1:7:101:82:1:7:113:117',
'48:36:14:1:7:113:55:1:7:75:27:1:7:63:27:1:7:125:51:1:7:31:50:1:7:23:62:1:7:51:82:1:7:58:97:1:7:54:114:1:7:58:125:1:7:97:109:1:7:105:94:1:7:117:82:1:7:121:67',
'42:42:15:1:7:98:70:1:7:109:70:1:7:90:59:1:7:82:48:1:7:70:43:1:7:56:39:1:7:39:58:1:7:47:70:1:7:58:74:1:7:58:86:1:7:67:94:1:7:58:105:1:7:39:97:1:7:85:125:1:7:70:125',
'48:36:12:1:7:90:58:1:7:82:43:1:7:106:59:1:7:98:78:1:7:121:67:1:7:113:82:1:7:125:87:1:7:101:114:1:7:90:110:1:7:82:98:1:7:43:66:1:7:43:54',
'54:36:10:1:7:118:86:1:7:125:102:1:7:78:110:1:7:66:118:1:7:66:102:1:7:78:98:1:7:42:94:1:7:38:78:1:7:34:66:1:7:39:54',
'25:56:7:1:7:62:82:1:7:66:98:1:7:54:102:1:7:62:110:1:7:65:122:1:7:38:78:1:7:34:93',
'24:63:8:1:7:98:102:1:7:82:106:1:7:94:119:1:7:81:122:1:7:69:110:1:7:49:110:1:7:37:106:1:7:41:94',
'31:71:9:1:7:70:98:1:7:65:114:1:7:49:98:1:7:45:112:1:7:98:115:1:7:82:114:1:7:93:127:1:7:58:29:1:7:42:25',
'32:122:6:1:7:73:31:1:7:86:39:1:7:104:43:1:7:117:116:1:7:96:117:1:7:91:131'];

begin

for I := 0 to 13 do
begin

ObjDTM_Walk(Path[i], 0, 100, 80, True);
end;

end;
end;

begin
Setup
DeclarePlayers
SetupSRL;
Pureess (x, y);
FindObject(x, y);
Unnote
WalkToAlter
enteralter
CraftRunes
Walktoportal
FindPortal
WalkBack
end.
Looks legit, from what I can see there's nothing harmful in it.
Mat

Markus

2012-02-02 10:23:42

Script is clean, yes. Seems that altar finding is Flight's, portal finding also isn't his.

Er1k

2012-02-02 10:25:35

No commits and foreign connections. It seems there's an unimplemented proggie as well. So yeah, clean