Yanhua
2011-12-17 03:14:32
Hey guys,
For the last few hours I've been trying to make an al-kharid dessert beer glass collector.
It collects beer glasses (Searches the shelves) then banks them at the al kharid bank, then repeats.
The problem is the banking part, I've tried multiple methods to locate the bank booth or the banker, I've tried DTM, colour…All don't seem to work well.
Also, when I start the my script it will right click at the top left hand corner of the RS screen and just sit there? It's a common bug that always happens. Quite annoying and I've been trying my hardest to fix it, but I can't seem to find a valid reason.
Anyways, here's my script so far. Please tell me what I can improve on and what a better method to locate bank is.
Thanks guys :) Looking forward to comments.
For the last few hours I've been trying to make an al-kharid dessert beer glass collector.
It collects beer glasses (Searches the shelves) then banks them at the al kharid bank, then repeats.
The problem is the banking part, I've tried multiple methods to locate the bank booth or the banker, I've tried DTM, colour…All don't seem to work well.
Also, when I start the my script it will right click at the top left hand corner of the RS screen and just sit there? It's a common bug that always happens. Quite annoying and I've been trying my hardest to fix it, but I can't seem to find a valid reason.
Anyways, here's my script so far. Please tell me what I can improve on and what a better method to locate bank is.
program GlassGrabber;
{$i SRL\SRL.scar}
{$i sps/sps.simba}
Var
Path:TPointArray;
Procedure DepositGlass;
Var
X, Y:Integer;
Begin
Begin
X:=215
Y:=160
MMouse(X, Y, 3, 3);
wait(RandomRange(200,100));
Mouse(X, Y, 0, 0, False);
ChooseOption('quickly');
wait(RandomRange(1000,700));
DepositAll;
wait(RandomRange(2000,1000));
CloseBank;
end;
end;
Function GetGlass:Boolean;
Var
A, B:Integer;
Begin
SetAngle(True);
FindObj(A, B, 'earch Shelv', 3164471 , 5);
wait(RandomRange(500,200));
MMouse(A, B, 5, 5);
wait(RandomRange(500,300));
Mouse(A, B, 0, 0, False);
ChooseOption('alk here');
wait(RandomRange(3000,2000));
if FindObj(A, B, 'earch Shelv', 3164471 , 5) Then
Begin
MMouse(A, B, 5, 5);
wait(RandomRange(200,90));
if IsUpText('earch Shelv') Then
Repeat
wait(RandomRange(2500,1600));
Mouse(A, B, 0, 0, True);
until(InvFull);
writeln('Inventory is full. Going to bank.')
end;
end;
Procedure ToBank;
Var
Path:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['12_10', '12_9']);
Path := [Point(5089, 4084), Point(5040, 4069), Point(4980, 4058), Point(4941, 4027), Point(4921, 3996)];
writeln('Walking to the bank! :)');
SPS_WalkPath(Path);
wait(randomrange(1000,800));
End;
Procedure ToShelves;
Var
Path:TPointArray;
begin
SPS_SETUP(RUNESCAPE_SURFACE, ['12_10', '12_9']);
Path := [Point(4940, 4024), Point(4971, 4058), Point(5019, 4067), Point(5075, 4075), Point(5114, 4103)];
writeln('Walking back the the shelves to get more glass! :)');
SPS_WalkPath(Path);
wait(randomrange(1000,700));
end;
Procedure StepToBooth;
Var
X, Y, Tile:Integer;
begin
Tile := DTMFromString('mggAAAHicY2NgYFBlgAB2IBYBYj4g5gJiXyCeAMRZUHklIHYG4pkloQyP9k9neHVsNhj/urwMjJmAcsxYMCMODAEAL8sPOA==');
FindDTM(Tile, X, Y, MSX1, MSY1, MSX2, MSY2)
MMouse(X, Y, 2, 2);
Wait(500+random(500));
Mouse(X, Y, 3, 3, True);
Wait(1000+random(500));
FreeDTM(Tile);
end;
begin
SETUPSRL;
ClickNorth(True);
repeat
if not InvFull then
begin
wait(1000+random(500));
ToShelves;
wait(1000+Random(500));
Getglass;
end;
if InvFull Then
begin
wait(1000+random(500));
ToBank;
wait(1000+random(500));
StepToBooth;
Wait(1000+Random(500));
DepositGlass;
wait(1000+Random(500));
end;
until(false)
end.
Thanks guys :) Looking forward to comments.