SRL Archive - RS3 Outdated / Broken Scripts

My OpenDoor and BuyRune function


tim46

2007-06-12 21:59:45

Well, all this does is pretty much open a door. :p Returns true if the door was found and opened.

function OpenDoor(bmp: Integer): Boolean;
var
t, tx, ty: Integer;
begin
while (t < 65) do
begin
t := t + 5;
if (FindBitmapToleranceIn(BMP, tx, ty, MSX1, MSY1, MSX2, MSY2, t)) then
begin
Mmouse(tx, ty, 0, 0);
if(IsUpTextMulti('Open', 'pe', 'pen')) then
begin
Mouse(tx, ty, 0, 0, True);
Result := True;
WriteLn('Somebody closed the door! He is teh neebcake =O Door opened.');
end;
break;
end;
end;
FreeBitmap(BMP);
end;


For these next procedures to work you must have {.include SRL/SRL/Misc/Amount.scar} included in your script.

Procedure BuyRune will check to see if shop has that specific rune in stock, and will buy the rune until the shop runes out of stock or you run out of money.

procedure ClickRune(runetype : String);
var
rBMP, i: Integer;
begin
rBMP := LoadRune(runetype);
i:= Random(6);
if(FindBitmapToleranceIn(rBMP, x, y, 23, 61, 494, 315, 90)) then
begin
wait(200 + random(100));
Mouse(x, y, 4, 4, false);
wait(200 + random(100));
Case Random(5) of
0: ChooseOption(x,y,'uy 10');
1: ChooseOption(x,y,'uy 1');
2: ChooseOption(x,y,'uy 5');
3: ChooseOption(x,y,'uy 10');
4: ChooseOption(x,y,'uy 10');
end;
if(i = 0) then PickUpMouse else wait(400 + random(300)); // My antiban
FreeBitmap(rBMP);
end;
end;

procedure BuyRune(runetype: String);
begin
wait(200 + random(100));
if(((RuneAmount('shop',runetype)) > 0))then
repeat
ClickRune(runetype);
until(((RuneAmount('shop',runetype)) = 0) or(InChat('enough coin')));
end;


Hope these functions/procedures were usefull to you in some way :p

Santa_Clause

2007-06-14 08:47:16

Oo it opens doors. I hope it's as good as Nielsie's door opener…

tim46

2007-06-14 16:01:31

I doubt its as good, but it does its job right :p Never failed me yet.