From: ggzz
program new;
{$I SRL/SRL.Simba}
Function FindSymbolX(Which: String; var X, Y, Dist:Integer): Boolean;
var
B: TBox;
TPA, SymbolTPA: TPointArray;
I,CTS, Index: Integer;
ATPA: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(TPA, 12632256, MMX1, MMY1, MMX2, MMY2, 10);
ColorToleranceSpeed(CTS);
if Length(TPA) < 1 then
Exit;
ATPA := TPAtoATPAEx(TPA, 8, 8); //Size of the grey circle of the symbol..
B:= GetATPABounds(ATPA);
Case LowerCase(Which) of
'bank':
begin
FindColorsTolerance(SymbolTPA, 2216175, B.X1-8, B.Y1-8, B.X2+8, B.Y2+8, 10);
TPAInATPA(SymbolTPA, ATPA, Index); //Needed to find the gold bank symbol color in our ATPA..
end;
'cw','castlewars','castle wars':
begin
FindColorsTolerance(SymbolTPA, 2369228, B.X1-8, B.Y1-8, B.X2+8, B.Y2+8, 10);
TPAInATPA(SymbolTPA, ATPA, Index);
end;
'summoning','obby','obelisk':
begin
FindColorsTolerance(SymbolTPA, 1988939, B.X1-8, B.Y1-8, B.X2+8, B.Y2+8, 10);
TPAInATPA(SymbolTPA, ATPA, Index);
end;
end;
Result := (Length(ATPA[i]) > 0);
if Result then
begin
MiddleTPAEx(ATPA[i], X, Y);
Dist := Distance(MMCX, MMCY, X, Y);
Exit;
end;
end;
Function ExampleLunar: Boolean;
var
X, Y, Dist: Integer;
begin
MouseSpeed:= 500;
if FindSymbolX('Bank', X, Y, Dist) then
if Dist > 25 then
begin
MMouse(X, Y, 0, 0);
ClickMouse2(1); //Left clicks..
end;
while isMoving do
wait(1);
if FindSymbolX('Bank', X, Y, Dist) then
if Dist < 15 then
writeln('We are at the bank');
end;
//Some bleh.. usage... From my edited version of flight's nature script..
var
X, Y, Dist, Count, Home: Integer;
if (FindSymbolX('Bank', X, Y, Dist) = False) then
begin
if(GameTab(Tab_Magic)) then
begin
Home:= DTMFromString('mbQAAAHicY2VgYLBmYmBwBGJ7IDYGYnMgfgoUvw/Eb4H4JRDfBeJ9Rz4xtM25gYJZgeLomBELBgMAGDAQJg==');
if(FindDTM(Home, X, Y, MIX1, MIY1, MIX2, MIY2)) then
begin
MMouse(X, Y, 5, 5);
if(WaitUptextMulti(['Home', 'Teleport'], 2000)) then
ClickMouse2(True);
end;
While(FindSymbolX('Bank', X, Y, Dist) = False) do
begin
wait(1);
Count:= Count + 1;
if Count > 1000 then
break;
end;
end;
end;
if FindSymbol('Bank', X, Y, Dist) then
begin
MMouse(X, Y, 2, 2);
ClickMouse2(True);
Wait(RandomRange(350, 575));
FFlag(0);
While IsMoving do
wait(1);
FindSymbol('Bank', X, Y, Dist);
if(Dist < 15) then
begin
if(OpenBankLunar = False) then
OpenBankNPCEx;
wait(1000);
if (Not Bankscreen) then
//........................
//.......................
FreeDTM(Home);
I'd prefer if you wrote your own banking seeing as I just did the Symbol finding as the FindSymbol in SRL did not work for that bank :S No clue why.. no matter how low I put the accuracy.. Oh well.
Anyway happy trails.
Thanks for the help, I really appreciate it. Your code clicks on the water Droplet symbol next to the bank for me. I'll try and alter it and get it to work.
Edit: I actually have no idea what's wrong with it. The color and color tolerance are fine :S