SRL Archive - Research & Development Lounge

Any bank GE Collector


Nose Smasher

2008-11-05 16:06:27

I used this in a script I'm workin on atm… I had to edit the banking function to open 'collect' instead of 'quickly' and to search for 'CollectionScreen' instead of 'BankScreen'…

The reason I made this is because I think it would be a nice anti-ban.. Looks a lil sketchy when you're running a script for a long time and the whole time you have items waiting in you collection box… :p

~Copy and paste this into SCAR
~Place your char in any bank (specify what bank)
~make sure you have items in your collection box (you never know how dumb some people can be ;) )
~Run the script While Logged IN

Lemme know what you think…

program GE_Item_Collector;
{.include SRL/SRL.scar}

var
Collector: Boolean;

const
TheBank = 'BankNameHere';


function CollectionScreen: Boolean; //edited bankscreen
begin
result:= FindTextTPA(2070783, 20, 135, 64, 388, 86, 'Collection', upchars, Nothing);
end;


function CloseCollect: Boolean;
var
Timer: Integer;
begin
if CollectionScreen then
begin
MarkTime(Timer);
repeat
Mouse(426, 75, 4, 4, True)
if not CollectionScreen then
begin
Result:= True;
Break;
end else
Wait(300+random(200));
until not (CollectionScreen) or (TimeFromMark(Timer) > 8000)
end;
end;


Function CollectBox(i :Integer): TBox; //similar to invbox
var
row, col: Integer;

begin
if (i < 1) or (i > 6) then
begin
srl_Warn('CollectBox', 'Incorrect index: ' + IntToStr(i), warn_AllVersions);
exit;
end;
row :=i mod 3; if row = 0 then row := 3;
col := i / 3 ; if i mod 3 <> 0 then Inc(col);
Result.x1 := (-12 + (row * 116));
Result.y1 := (40 + (col * 90));
Result.x2 := (69 + (row * 116));
Result.y2 := (75 + (col * 90));
end;


function ExistsCollect(i: Integer): Boolean; //like ExistsItem, but clicks it also
var
a, b: integer;
TB: TBox;
begin
TB := CollectBox(i);
if FindColorTolerance(a, b, 3355443, TB.x1 + 5, TB.y1 + 5, TB.x2 - 5, TB.y2 - 5, 5) or
FindColor(a, b, 65536, TB.x1 + 5, TB.y1 + 5, TB.x2 - 5, TB.y2 - 5) then
begin
MMouse(a, b, 2, 2);
wait(350+random(150));
if (IsUpText('ollect')) then
begin
Mouse(a, b, 0, 0, true);
wait(500+random(200));
Result:= True;
end;
end;
end;


function OpenBankFaster(Location: String): Boolean; //OpenBankFast edited
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
begin
Wait(400);
case LowerCase(Location) of
'akb', 'al kharid': Info := [MSCX, MSCY, 7969203, 25, 1];
'lb', 'lumbridge': Info := [MSCX, MSCY, 4807788, 10, 1];
'veb', 'varrock east': Info := [MSCX, MSCY, 2971236, 10, 1];
'vwb', 'varrock west': Info := [270, 270, 5689318, 25, 1];
'feb', 'falador east': Info := [MSCX, MSCY + 50, 4612728, 14, 1];
'fwb', 'falador west': Info := [MSCY, MSCY, 4612728, 14, 1];
'db', 'draynor': Info := [MSCX, MSCY, 605006, 4, 1];
'eb', 'edgeville bank': Info := [MSCX + 50, MSCY, 3230295, 9, 2];
else
begin
srl_Warn('OpenBankFast', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
end;

MakeCompass('n');
z := GetColorToleranceSpeed;
ColorToleranceSpeed(Info[4]);
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetArrayLength(t, 0);
t := Booths;
SetArrayLength(Booths, 0);
Booths := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(Booths) -1;
for i := 0 to l do
begin
if (not LoggedIn) or CollectionScreen then
Break;
if (LowerCase(Location) = 'vwb') or (LowerCase(Location) = 'varrock west') then
begin
Booths[i].X := Booths[i].X + 5;
Booths[i].Y := Booths[i].Y - 20;
end;
MMouse(Booths[i].X, Booths[i].Y, 3, 3);
Wait(75 + Random(75));
if IsUpText('ooth') Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(70 + Random(75));
if ChooseOption('ollect') then
begin
FFLag(0);
MarkTime(c);
repeat
Wait(500);
until (CollectionScreen) or (TimeFromMark(c) > 3000);
end;
end;
end;
Result := (CollectionScreen);
end;


function BlackTextMultiSingle(Text: TstringArray; ChatLine: Integer): Boolean;
var
n, i: Integer;
begin
n := Length(Text) - 1;
for i := 0 to n do
if (Pos(Text[i], GetBlackText(ChatLine)) <> 0) then
begin
Result := True;
break;
end;
Exit;
end;


function BlackTextMultiAnyLine(ChatTxt: TStringArray): Boolean;
var
I: Byte;
begin
for I := 8 downto 1 do
if (BlackTextMultiSingle(ChatTxt, I)) then
begin
Result := True;
break;
end;
exit;
end;


procedure GECollector(bank: string);
var
i: Integer;
begin
if not (loggedin) then exit;
if (collector = False) then exit;
if not BlackTextMultiAnyLine(['xchang', 'lectio', 'pdat', 'items']) then
begin
WriteLn('No items in collection box :)');
Collector:= False;
Exit;
end else
begin
if (Collector = False) then exit;
WriteLn('Items in collection box!');
OpenBankFaster(bank);
wait(750+random(200));
if not (CollectionScreen) then exit;
for i:= 1 to 6 do
begin
ExistsCollect(i);
wait(250+random(100));
ExistsCollect(i); //incase you got gp too (2 slots per box)
end;
CloseCollect;
end;
Collector:= False;
end;

begin
SetUpSRL;
ActivateClient;
GECollector(TheBank);
end.

Works? Input? Bugs?