SRL Archive - Help and Support

Click on Yellow Dots?


Harry

2007-10-03 19:26:35

I need a function to click on yellow dots if it doesn't FindFight after 45 seconds (Its for my fight cave runner.) There is prolly a function somewhere, but it would be nice to have one posted here, Kai Thanks Bye.

~Harry

Bourdou!

2007-10-03 19:37:22

if find DDTM then
click
else
repeat
wait
until(find DDTM)
Like that?

Sp0rky

2007-10-03 19:39:00


{*******************************************************************************
function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
By: Stupid3ooo
Description: Finds color on Minimap with tolerance
*******************************************************************************}

function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2, tol);
end;

Ownz.

Harry

2007-10-03 19:40:22

From: Bourdou!
if find DDTM then
click
else
repeat
wait
until(find DDTM)
Like that?


Kinda.. like if it doesn't find a fight after 45 seconds of last fight, it will click on the yellow dot on the MM.

Edit:
From: Sp0rky

{*******************************************************************************
function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
By: Stupid3ooo
Description: Finds color on Minimap with tolerance
*******************************************************************************}

function FindMMColorTol(var x, y: Integer; color, tol: Integer): Boolean;
begin
Result := FindColorTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2, tol);
end;

Ownz.


Haha, not really. It has to click on the Dot, not just find it :rolleyes:

Sp0rky

2007-10-03 19:45:59

Wow, check this out >_>


if FindMMColorTol(YellowDotColor,4) then
begin
Mouse(x,y,1,1,True);
Flag;
end
else
Writeln('Didnt find yellow dot, omg...');
end;

Seeing as the floor is perfectly black on the minimap, why not just make a bitmap of the yellow dot and have it click on that? >_>
nab ^_^

Bourdou!

2007-10-03 19:47:33


if not InFight then
begin
Wait(45000+random(1000));
if find DDTM then
click
else
repeat
Wait(1000+random(1000));
until(find DDTM);
end else
LogOut;
Like that?

Harry

2007-10-03 19:48:55

You people too fast for my dialup XD

It can't have the whole script pause while waiting- it has to continue script then do the yellow dot function.

Bourdou!

2007-10-03 19:51:14

Then use if not and then labels

SKy Scripter

2007-10-03 20:28:29

Dhar that should do the trick :)



program New;
{.include srl/srl.scar}

const
yellowDot = 195836;// Dont Worry This Color always stays same in Runescape



function DotPoints : TPointArray;
var PL, PPL, I, n, L : Integer;
P : TPointArray;
CP: TPointArrayArray;
begin
FindColorsTolerance(P, yellowDot, MMX1, MMY1, MMX2, MMY2, 0);
Pl := Length(P);
if (Pl = 0) then exit;
for I := 0 to PL - 1 do
begin
PPL := Length(CP)-1;

for n := 0 to PPL do
if (NearbyPointInArray(P[i], 1, CP[n])) then
begin
L := length(CP[n]);
SetArrayLength(CP[n], l + 1);
CP[n][L] := P[i];
Break;
end;

if (PPL <= n) then
begin
L := Length(CP);
SetArrayLength(CP, L + 1);
SetArrayLength(CP[L], 1);
SetArrayLength(Result, L + 1);
Result[L] := P[i];
CP[L][0] := P[i];
end;
end;
end;

var P : TPointArray;
I : Integer;
Canvas : TCanvas;
begin
if (FindRS) then ActivateClient;
DisplayDebugImgWindow(MMX2, MMY2);
Canvas := GetDebugCanvas;
SetupSRL;
Wait(1000);
SafeCopyCanvas(GetClientCanvas, Canvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
P := DotPoints;
for i := 0 to length(P)-1 do
Canvas.pixels[P[i].x, P[i].y]:= 255;

//SafeCopyCanvas(Canvas, GetDebugCanvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
end.

Santa_Clause

2007-10-03 20:32:43

From: SKy Scripter
Dhar that should do the trick :)



program New;
{.include srl/srl.scar}

const
yellowDot = 195836;// Dont Worry This Color always stays same in Runescape



function DotPoints : TPointArray;
var PL, PPL, I, n, L : Integer;
P : TPointArray;
CP: TPointArrayArray;
begin
FindColorsTolerance(P, yellowDot, MMX1, MMY1, MMX2, MMY2, 0);
Pl := Length(P);
if (Pl = 0) then exit;
for I := 0 to PL - 1 do
begin
PPL := Length(CP)-1;

for n := 0 to PPL do
if (NearbyPointInArray(P[i], 2, CP[n])) then
begin
L := length(CP[n]);
SetArrayLength(CP[n], l + 1);
CP[n][L] := P[i];
Break;
end;

if (PPL <= n) then
begin
L := Length(CP);
SetArrayLength(CP, L + 1);
SetArrayLength(CP[L], 1);
SetArrayLength(Result, L + 1);
Result[L] := P[L];
CP[L][0] := P[i];
end;
end;
end;

var P : TPointArray;
I : Integer;
Canvas : TCanvas;
begin
if (FindRS) then ActivateClient;
DisplayDebugImgWindow(MMX2, MMY2);
Canvas := GetDebugCanvas;
SetupSRL;
Wait(1000);
SafeCopyCanvas(GetClientCanvas, Canvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
P := DotPoints;
for i := 0 to length(P)-1 do
Canvas.pixels[P[i].x, P[i].y]:= 255;

//SafeCopyCanvas(Canvas, GetDebugCanvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
end.


What the?! Just use a god damn DTM.

  NPC := DTMFromString('78DA63CC626260106440017FFE30317001694' +
'620FE0F048C394035420C6880118904D220738409A8C924C29C6C' +
'C2E60000956B0888');

SKy Scripter

2007-10-03 20:49:01

But what if he wanted to detect more then one!?!?! so he could find the closest npc and ect..


[ATTACH]7240[/ATTACH]

Sp0rky

2007-10-03 20:57:52

You always have to ruin it for everyone sky >_<" lol

Harry

2007-10-03 21:05:35

From: SKy Scripter
Dhar that should do the trick :)



program New;
{.include srl/srl.scar}

const
yellowDot = 195836;// Dont Worry This Color always stays same in Runescape



function DotPoints : TPointArray;
var PL, PPL, I, n, L : Integer;
P : TPointArray;
CP: TPointArrayArray;
begin
FindColorsTolerance(P, yellowDot, MMX1, MMY1, MMX2, MMY2, 0);
Pl := Length(P);
if (Pl = 0) then exit;
for I := 0 to PL - 1 do
begin
PPL := Length(CP)-1;

for n := 0 to PPL do
if (NearbyPointInArray(P[i], 1, CP[n])) then
begin
L := length(CP[n]);
SetArrayLength(CP[n], l + 1);
CP[n][L] := P[i];
Break;
end;

if (PPL <= n) then
begin
L := Length(CP);
SetArrayLength(CP, L + 1);
SetArrayLength(CP[L], 1);
SetArrayLength(Result, L + 1);
Result[L] := P[i];
CP[L][0] := P[i];
end;
end;
end;

var P : TPointArray;
I : Integer;
Canvas : TCanvas;
begin
if (FindRS) then ActivateClient;
DisplayDebugImgWindow(MMX2, MMY2);
Canvas := GetDebugCanvas;
SetupSRL;
Wait(1000);
SafeCopyCanvas(GetClientCanvas, Canvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
P := DotPoints;
for i := 0 to length(P)-1 do
Canvas.pixels[P[i].x, P[i].y]:= 255;

//SafeCopyCanvas(Canvas, GetDebugCanvas, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
end.


Holy cows! Thanks!

SKy Scripter

2007-10-03 21:33:31

actually use this one. :)



program New;
{.include srl/srl.scar}

function FindDots : TPointArray;
var P, T : TPointArray;
I, L, a: Integer;
begin
FindColorsSpiralTolerance(MMCX, MMCY, P, 195836, MMX1, MMY1, MMX2, MMY2, 0);
L := Length(P);
SetArrayLength(T, L);
SetArrayLength(Result, L);
for I := 0 to L-1 do
begin
if (not (NearbyPointInArray(P[i], 1, T))) then
begin
Result[a] := P[i];
a := a + 1;
end;
T[i] := P[i];
end;
SetArrayLength(Result, a);
end;

var i : Integer;
P : TPointArray;
c : TCanvas;
begin
if (FindRS) then ActivateClient;
SetupSRL;
Wait(1000);
P := FindDots;
DisplayDebugImgWindow(MMX2, MMY2);
c := GetDebugCanvas;
SafeCopyCanvas(GetClientCanvas, c, 0, 0, MMX2, MMY2, 0, 0, MMX2, MMY2);
for i := 0 to length(p)-1 do
c.pixels[p[i].x, p[i].y] := 255;


end.

mat_de_b

2007-10-04 01:34:00

Arent you better of creating a bitmap of the yellow dot and searching for that? thats what i did to find players in the wildy and it works a treat