SRL Archive - First Scripts

First script


Zezi

2008-04-02 17:29:50

Hi, is this script of standard to go to srl members.

Please tell me if you know better methods for the things i have done, or anything i've done but isn't needed :)

And are the standards wrong? :S

1) Adding srl stats atm
2) Removed the form, was kinda useless. lol

3) PLEASE suggest were i can add failsafes etc :(



program New;
{.include SRL/SRL.Scar}


// Vars
var
x,y, NotFoundHim, stonemason, a, summoning, blocks, gained, spent, antibans, dooropen, world, worldchanges: integer;
// For sleeping
var hours, minutes, seconds, sleeps, timer,starting: Integer;


// Constants
const
YourSRLID = '3138'; // Eneter your srl ID
YourSRLPassword = 'summoner'; // SRL password


//------Do NOT edit----- \\
version = 1;
// --------------------- \\


color1 = 7510470;
color2 = 2108229;
color3 = 3822649;
loads = 1;
worldhopping = True; // If false, world hopping does not occur
sleeping = True; // If false, Sleeping will not occur (Part of antiban)




// Call disguise and Bitmaps
procedure setupbox;
begin

Case Random(6) of
0 : Disguise('iTunes');
1 : Disguise('Windows Live Messenger');
2 : Disguise('FileZilla');
3 : Disguise('RuneScape - the massive online adventure game by Jagex Ltd - Mozzila Firefox');
4,5,6 : Disguise('iTunes');
end;

stonemason := BitmapFromString(15, 15, 'beNpjYMAEjEiAAS/Ysm' +
'8bMsKqBSgCV5BVkgNByFqwqiwJUcrPDASimLQ4IIKLYyoGqkz2EfQ' +
'xYPYO9YUgNMXIKqMtuYEqp8ybClEJZCC7H64YWSUcYfUskAGxHa6m' +
'vLEC6EE0Z8MVAxGaSrhiuHpkxXAElIWrRHY8JADR1KOphCiGBzVWw' +
'4Fq3Dwd0IzFqh4tTLDGOKYV+JMTIypAkQMAvWPn/Q==');

summoning := BitmapFromString(15, 15, 'beNpjYEADjIxsyIgBB4D' +
'I7tpztKRMJtVHNCXAAMjGqgWiDIJcwpRv3n8a4mE7c/YSiAiyemSV' +
'QOSkLARUbKQoDFeMrB5ZsU1Jzv5Tz4DGSgmKYCpGM3bFuhlA1wINR' +
'1MMdz+yCFBlW1kkkARaQVAx0HddsY5AkqDJQDcAvQZEQJMzYtyACI' +
'9iiBuAaoDqgYZjDRC4+iA9IaB6IAKqBIYJskvQgg4Ya0AEiT6gYmC' +
'AAF0F9CbWeAEqgyCIYqAbVLQ0IGGCNcaBCCiFjIhJTthTHQAdf+h+' +
'');

world := BitmapFromString(6, 22, 'beNpjYMAEZ3fWoKHjm8rREAMD' +
'4yiCoxRPTTQU76aOhhgIAgCAkiHT');
end;

//Declare players
Procedure DeclarePlayers;
Begin
NumberOfPlayers(2);
CurrentPlayer := 0;

Players[0].Name := ''; // Player Name
Players[0].Pass := ''; // Player Pass
Players[0].Nick := ''; // Player Nick (if your name is 'macroman' then your nick should be 'acro')
Players[0].Active := true; // Is this player active? (True / False)
//Players[0].loads := '300'; // Amount of loads, 28*300 = total items

Players[1].Name := 'z'; // Player Name
Players[1].Pass := '1'; // Player Pass
Players[1].Nick := 'ek'; // Player Nick (if your name is 'macroman' then your nick should be 'acro')
Players[1].Active := true; // Is this player active? (True / False)
//Players[1].loads := '300'; // Amount of loads, 28*300 = total items
end;



// AUTOCOLOUR BY SUMILLION AND NIELSIE +REP
function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(10.00, 0.16);

if not (FindColorsTolerance(arP, 6776671, MMX1, MMY1, MMX2, MMY2, 5)) then
begin
Writeln('Auto-Colouring Failed, please reload runescape and press play again.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

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

for i := 0 to arL do
begin
if (rs_OnMinimap(arP[i].x, arP[i].y)) then
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 9.03) and (X <= 15.05) and (Y >= 9.17) and (Y <= 15.26) and (Z >= 9.46) and (Z <= 16.35) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;

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

if (i = arL + 1) then
Writeln('Auto-Colouring Failed, please reload runescape and press play again.');
// logout;
//wait(5000 + random(5000));
//loginplayer;
end;





procedure hop;
begin
if worldhopping = False then
Exit;
if LoggedIn then
// Allowing for Us to switch worlds...
Logout;
// Find if logged off
if (FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,Nothing)) or (FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft)) then
a:= 0;
repeat
a:= a + 1;
wait(1000+random(500));
// Click world trade button
Mouse(50,480, 20, 8, true);
wait(1000+random(500));
Case Random(5) of
// Click World
0 : Mouse(288,13, 3, 3, true);
// Click Players
1,2,3 : Mouse(397,13, 3, 3, true);
// Click Type
4 : Mouse(620,13, 3, 3, true);
end;
wait(300+random(300));
if (a > 10) then
exit;
// Bitmap of empty space
until (FindBitmapSpiralTolerance(world,x,y,0, 60, 700, 700, 0));
repeat
Mouse(x - 3,y - 5, 0, 0, true);
until((FindTextTpa(clwhite,0,194, 174,564, 367,'xis',UpChars,Nothing)) or (FindTextTpa(clwhite,0,194, 174,564, 367,'Cancel',UpChars,ClickLeft)));
writeln('world hopped please');
end;

// Very crude sleeping, gets the job done.
procedure boxcropsleep;
begin
if sleeping = False then
Exit;
if LoggedIn then
Logout;
// Allow for a random sleep timer :\
Case Random(3) of
//Small Afk
0 : Timer := randomrange(10000, 100000);
// Activity, toilet / tv
1 : Timer := randomrange(20000, 1000400);
//Propper sleep
2 : Timer := randomrange(1000000, 10000000);
end;
Marktime(starting);
ConvertTime(Timer, Hours, Minutes, Seconds);
WriteLn('Sleeping for: '+inttostr(Hours)+' Hours, '+ InttoStr(Minutes)+' Minutes, and '+IntTostr(Seconds)+' Seconds')
repeat
ConvertTime(Round(Timer-TimeFromMark(starting)), Hours, minutes, Seconds);
// One minute and 40 seconds each time before checking
wait(100000);
writeln('Sleeping commenced at'+IntToStr(starting)+'');
writeln('Sleep '+ IntToStr(hours)+'hours, '+IntToStr(minutes)+'minutes remaining.'+IntToStr(Seconds)+'seconds remaining');
until(TimeFromMark(starting) >= Timer);
Writeln('Sleeping Finished');
cleardebug;
hop;
sleeps := sleeps + 1;
end;


procedure antiban;
begin
if(not(LoggedIn)) then
LoginPlayer;
Case Random(4) of
0 : AlmostLogout;
1 : RandomRClick;
2 : HoverSkill('random', False);
3 : PickUpMouse;
4 : BoredHuman;
end;
end;

procedure fixbankbox;
begin
// Fix bank custom
end;


procedure walktoshop;
begin
if (not(LoggedIn)) then
exit;
a:= 0;
RoadColor := AutoColor;
repeat
RadialRoadWalk(RoadColor, 80, 110, 55, 1, 1);
a:= a +1;
until(FindSymbol(X,Y,'farming spot')) or (a > 5);
writeln('Found Farming');
Mouse(x,y, 10, 10, true);
writeln('clicked farming spot');
timer := 20000;
Marktime(starting);
Case Random(3) of
0 : FFlag(7);
1 : antiban;
2 : FFlag(4 + random(5));
3 : wait(1000 + random(40))
end;
if(Timer-TimeFromMark(starting) < 100) then
writeln('FFlag failed, continuing');
writeln('waiting for flag to disappear');
FindNormalRandoms;
repeat
RadialRoadWalk(RoadColor , 170, 190, 50, 1, 1);
Until(FindBitmapSpiralTolerance(stonemason,x,y,MMX1,MMY1,MMX2,MMY2, 80));
writeln('Found The Shop symbol');
Mouse(x, y , 1, 1, true);
flag;
FindNormalRandoms;
end;


procedure walkfromshop;
begin
if (not(LoggedIn)) then
LoginPlayer;
RoadColor := AutoColor;
repeat
RadialRoadWalk(RoadColor, 345, 359, 70, 1, 1);
writeln('Finding summoning spot');
until(FindBitmapSpiralTolerance(summoning,x,y,MMX1,MMY1,MMX2,MMY2, 80));
writeln('Found Summoning spot');
Mouse(x,y, 10, 10, true);
writeln('clicked summoning spot');
wait(200 + random(300));
Case Random(1) of
0 : FFlag(10);
//1 : antiban;
// 2 : FFlag(2 + random(5));
// 3 : wait(1000 + random(40))
end;
writeln('waiting for flag to disappear');
FindNormalRandoms;
repeat
RadialRoadWalk(RoadColor , 300, 310, 50, 1, 1);
until(FindSymbol(X,Y,'bank'));
writeln('Found The bank symbol');
Mouse(x, y , 1, 1, true);
flag;
FindNormalRandoms;
end;








procedure boxlog;
begin
repeat
LoginPlayer;
wait(300+random(400));
if(FindSymbol(x,y, 'bank')) then
begin
writeln('Found bank symbol, restarting script');
end else
begin
if(FindBitmapSpiralTolerance(stonemason,x,y,MMX1,MMY1,MMX2,MMY2, 80)) then
writeln('Found stone mason');
FindNormalRandoms;
walkfromshop;
end;
until(false);
end;



Function FindTheDoorSafe(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
var
a, b, c, i, x1, y1, x2, y2, x3, y3: Integer;
Start: Boolean;
begin
if (not(LoggedIn)) then
LoginPlayer;
For b := 0 to (GetArrayLength(Color)-1) do
Begin
if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
Begin
Start := True;
Break;
end;
end;
If(Start)then
Begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
If not(LoggedIn)then
break;
a := a + 1;
If (a = 1) then
c := c + 1
else If (a = 3) then
c := c + 1;
For i := 1 to c do
Begin
If (a = 1) then
Begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
If (a = 2) then
Begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
If (a = 3) then
Begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
If (a = 4) then
Begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
If (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
If (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
If (x2 > 515) then
Break;
For b := 0 to (GetArrayLength(Color)-1) do
Begin
If (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
Begin
if not FindColorTolerance(x3, y3, 4873581, (cx - 5), (cy - 5), (cx + 5), (cy + 5), 5) then
begin
Result := False;
end else
begin
MMouse(cx, cy, 0, 0);
Wait(50 + random(100));
if (IsUpTextMultiCustom(text)) then
Begin
Result := True;
Exit;
end;
end;
end;
end;
end;
if (a = 4) then a := 0;
until (x2 > 515) or (Result = True);
end;
end;



procedure door;
var
i: Integer;
begin
i:= 0;
if(FindTheDoorSafe(x, y, ['oor'], [5788242,3622225,1387833,5327691,7432553], 10))then
repeat
i:= i + 1;
writeln('finding door close/ open');
if(IsUpText('pen'))then
begin
wait(400+random(500));
Mouse(x, y, 5, 5, false);
wait(400+random(500));
writeln('door found');
if(ChooseOption('Open'))then
dooropen := dooropen +1;
wait(400 + random (300));
FindNormalRandoms;
exit;
end else
if(IsUpText('los'))then
Exit;
until(i >= 10);
end;







procedure banking;
var
b: Integer;
begin
if (not(LoggedIn)) then
exit;
a:= 0;
repeat
if (FindSymbol(x,y,'bank')) then
break;
a:= b + 1;
until(a >= 10);
begin
wait(200+random(600));
if(OpenBankQuiet('veb'))then
begin
DepositAll;
banks := banks +1;
fixbank;
wait(100+random(400));
OpenBankQuiet('veb');
wait(200+random(400));
Withdraw(-1, 1, 588);
FindNormalRandoms;
end
end;
end;

procedure BuyStuff;
begin
MakeCompass('N');
if (not(LoggedIn)) then
exit;
if shopscreen then
begin
mouse(76,115,10,10, false);
if ChooseOption('Buy X') then
begin
wait(1000+random(400));
typesend('28');
Wait(1000 + Random(500));
// Closes shop window
mouse(485,40,7,7, true);
FindNormalRandoms;
spent := spent + 588;
end;
end;
end;

Function FindTheDude(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
var
a, b, c, i, x1, y1, x2, y2, x3, y3: Integer;
Start: Boolean;
begin
if (not(LoggedIn)) then
exit;
For b := 0 to (GetArrayLength(Color)-1) do
Begin
if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
Begin
Start := True;
Break;
end;
end;
If(Start)then
Begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
If not(LoggedIn)then
break;
a := a + 1;
If (a = 1) then
c := c + 1
else If (a = 3) then
c := c + 1;
For i := 1 to c do
Begin
If (a = 1) then
Begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
If (a = 2) then
Begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
If (a = 3) then
Begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
If (a = 4) then
Begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
If (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
If (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
If (x2 > 515) then
Break;
For b := 0 to (GetArrayLength(Color)-1) do
Begin
If (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
Begin
if not FindColorTolerance(x3, y3, Color3, (cx - 5), (cy - 5), (cx + 5), (cy + 5), 5) then
begin
Result := False;
end else
begin
MMouse(cx, cy, 0, 0);
Wait(50 + random(100));
if (IsUpTextMultiCustom(Text)) then
Begin
Result := True;
Exit;
end;
end;
end;
end;
end;
if (a = 4) then a := 0;
until (x2 > 515) or (Result = True);
end;
end;



procedure findNtrade;
begin
if (not(LoggedIn)) then
exit;
repeat
case random(5)of
0: MakeCompass('S');
1: wait(random(100));
2: MakeCompass('W');
3: MakeCompass('N');
4: MakeCompass('E');
5: wait(random(500));
end;
If FindTheDude(x, y, ['Stonemason', 'mason'], [color1, color2], 6) then
begin
Mouse(X, Y, 1, 1, false);
Wait(20 + Random(70));
if ChooseOption('rade') then
Wait(700 + Random(200));
BuyStuff;
MakeCompass('N');
FindNormalRandoms;
exit;
end else
NotFoundHim := NotFoundHim+1;
FindNTrade;
wait(500+random(200));
until(shopscreen) or (NotFoundHim > 20);
if (notFoundHim > 20) or (ShopScreen = False) then
begin
writeln('Failed while finding the shopkeeper');
FindNormalRandoms;
end;
end;


Procedure ProgressReport;
begin
blocks := banks * 28;
gained:= ((blocks * 108) - spent);
writeln(' ');
WriteLn ('------------------------------------------');
WriteLn('|-------------------[Version '+inttostr(Version)+']-------------------|');
Writeln('Amount of banks:' + inttostr(banks) +'');
Writeln('Amount of Blocks:' + inttostr(blocks) +'');
Writeln('Money spent:' + inttostr(spent) +'');
Writeln('Money gained:' + inttostr(gained) +'');
writeln('Doors opened:' + inttostr(dooropen) +'');
writeln('Antibans performed:' + inttostr(antibans) +'');
writeln('World changes:' + inttostr(worldchanges) +'');
writeln('Slept:' + inttostr(sleeps) +' times');
writeln('Slept for:' + inttostr(hours) +' Minutes:'+inttostr(minutes) +' Seconds'+inttostr(seconds) +'');
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln('Started '+(TheTime)+'Worked for '+ TimeRunning);
SRLRandomsReport;
end;






begin
cleardebug;
SetupSRL;
setupbox;
activateclient;
DeclarePlayers;

banks := 0;
if (not(LoggedIn)) then
LoginPlayer;
repeat
case random(5)of
0,1,2,3: ;
4: hop;
5: boxcropsleep;
5: antiban;
end;
ProgressReport;
banking;
// Just incase
findnormalrandoms;
walktoshop;
door;
FindNTrade;
walkfromshop;
until(banks > loads) or (not(LoggedIn));
end.

Iron Man

2008-04-02 18:59:05

Your Anti Ban thing in your loop should be more than a Random 4… Like 1 in 10 chances. For your loop it should be Random(6) not Random(5).


Use MultiPlayer, without it you will not get into SRL members.


repeat
RadialRoadWalk(RoadColor, 345, 359, 70, 1, 1);
writeln('Finding summoning spot');
until(FindBitmapSpiralTolerance(summoning,x,y,MMX1,MMY1,MMX2,MMY2, 80));

Infinite loop? Add a MarkTime before or something. If thats a symbol, why not use a DTM instead of a bitmap?

Use:
FreeBitmap(Bitmap);

and if you use DTM's use
FreeDTM(DTM);

Otherwise their computer will eventually go very slow.

Zezi

2008-04-02 19:10:42

I've fixed antiban tyvm.

I still don't know what you mean by multiplayer XDD But okay, i'll look.


From: Iron man ftw


Use:
FreeBitmap(Bitmap);

and if you use DTM's use
FreeDTM(DTM);

Otherwise their computer will eventually go very slow.


I was told that i didn't need that, since it's only called once, rather than in a procedure or something :S (Markus said so, i THINK)

Iron Man

2008-04-02 19:17:42

For MultiPlayer you would make it so it would switch players after a certain amount of time/ after amount of loads or if something went wrong with the character.

Use NextPlayer to switch players…

NextPlayer(True); //Switches to Next player and leaves current player active true
NextPlayer(False); //Same as NextPlayer(True) but leaves the current players active false

EDIT: And you also don't need to disguise scar, Jaghex doesn't look at your toolbar.