SRL Archive - Help and Support

Help With Finding Fire


benjaa

2010-01-23 17:20:52

I need some help finding a fire without IsUptext..! Please aid me :)

This is what it is currently;

[php]if(ThereIsFire(fx, fy))then
begin
Mouse(fx+, fy, 6, 6, false);
MarkTime(ul);
repeat
Wait(100);
if(ChooseOption('Fire'))then
begin
result := true;
exit;
end;
until (TimeFromMark(ul) > 11000);
end else
begin
if(FindDTM(Fire, x, y, MSX1, MSY1, MSX2, MSY2))then
begin
Mouse(x, y, 6, 6, false);
MarkTime(t2);
repeat
Wait(100);
if(ChooseOption('Fire'))then
begin
result := true;
exit;
end;
until (TimeFromMark(t2) > 11000);
end;
end;[/php]

both FAIL

Sometimes people are standing on the fire, but even when they aren't, it still can't find.

ps, it's a cooker

Wanted

2010-01-23 17:21:52

DTMs for MS? That won't work

Use Tolerance Speed 2… collect colors with AutoColorAid in SRL/Scriptingtools/ACA.exe

benjaa

2010-01-23 17:23:15

From: IceFire908
DTMs for MS? That won't work

Use Tolerance Speed 2… collect colors with AutoColorAid in SRL/Scriptingtools/ACA.exe


the DTM has an area of 7 and tolerance of 10 for each point. would that suffice?

Wanted

2010-01-23 17:24:29

From: benjaa
the DTM has an area of 7 and tolerance of 10 for each point. would that suffice?


Tolerance 10? Probably not… why not just use CountColors if you're looking for text? OCR works in SCAR prerelease.

benjaa

2010-01-23 17:26:34

From: IceFire908
why not just use CountColors if you're looking for text?


hmm…!! brb :P

lordsaturn

2010-01-24 13:22:14

I made a fire function for my tut runner a while ago lemme find it, it finds the fire under you too.

Edit: Damn I just realized I lost all my backups of all my scripts I ever made D: Including unreleased ones..
function FindFire(var x, y: integer): Boolean;
var
P: TPointArray;
Fire, Tol, j, fx, fy: integer;
B: TBox;
a: extended;
begin
Result := False;
if not LoggedIn then Exit;
Debug('FindFire');
FindColorsSpiralTolerance(MSCX, MSCY, P, 3385314, MSX1, MSY1, MSX2, MSY2, 40);
RemovePointsInBox(P, PointToBox(Point(31, 4), Point(129, 24)));
if Length(P) < 10 then Exit;
Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');
Tol := 40;
B := GetTPABounds(P);
try
for j := 1 to 3 do
begin
FindDeformedBitmapToleranceIn(Fire, fx, fy, iAbs(B.x1-10), iAbs(B.y1-10), B.x2+10, B.y2+10, Tol, 2, True, a);
if a >= 1-j*0.2 then
begin
x := fx;
y := fy+4;
Result := True;
Exit;
end;
DecEx(Tol, 5);
end;
except
writeln('Exception');
finally
FreeBitmap(Fire);
end;
end;

Prolly not the quickest since it uses finddeformed but it works great as i recall

benjaa

2010-01-24 18:32:03

cheers saturn, i'll give it a go :)

..i wish reflection was up- the fire doesnt move!

HyperSecret

2010-01-24 18:54:53



function findFire(var x, y: integer): boolean;
var
i: integer;
fireColors, woodColors: TIntegerArray;
firePts, woodPts: TPointArray;
box: TBox;
begin
Result := false;
fireColors := [4766193, 10147576, 2722783, 2793711];
woodColors := [3506600, 3639473, 602687, 603458, 1725806];
for i := 0 to high(woodColors) do
findColorsTolerance(woodPts, woodColors[i], MSX1, MSY1, MSX2, MSY2, 20);
box := getTPABounds(woodPts);
Writeln('woodPts Length: ' + IntToStr(length(woodPts)));
Writeln('boxBounds : ' + IntToStr(box.x1) + ' ' + IntToStr(box.y1) + ' ' + IntToStr(box.x2) + ' ' + IntToStr(box.y2));
for i := 0 to high(fireColors) do
begin
if findColorsTolerance(firePts, fireColors[i], box.x1, box.y1, box.x2, box.y2, 20) then
begin
box := getTPABounds(firePts);
//DebugTPA(firepts, 'fire');
MouseBox(box.x1, box.y1, box.x2, box.y2, 3);
wait(50 + random(150));
Result := true;
exit;
end;
end;
end;

I started making a rogue den's cooker and this is what I got. It worked pretty dang good. It finds the fire under you, with people all around it on all 4 sides. Even found the fire directly with firemaking cape right next to it (close colors).

How it works: It looks for the color of the wood that surrounds the fire (logs) and then gets the bounds of those TPAs within certain size. After that looks for the fire colors inside of that area. If found it usually is the fire.

The Claw

2010-01-24 23:14:20

FindModelByID(x,y, FireID)

Probably faster and more accurate than the other functions above :p

Dervish

2010-01-25 01:28:37

From: The Claw
FindModelByID(x,y, FireID)

Probably faster and more accurate than the other functions above :p


Hahah, indeed, but I thought it only was for npc's ?

senrath

2010-01-25 01:35:42

From: Dr D. Dervish
Hahah, indeed, but I thought it only was for npc's ?


Anything animated counts as an NPC for that. At least, that's how I understood it.

Sabzi

2010-01-25 05:24:43

From: senrath
Anything animated counts as an NPC for that. At least, that's how I understood it.


I thought anything that is 3D can be found so even if the fire is not burning …, so I just wanted to show my interest.
Anyway:
http://www.villavu.com/forum/showpost.php?p=678649&postcount=163

benjaa

2010-01-30 01:36:56

From: The Claw
FindModelByID(x,y, FireID)

Probably faster and more accurate than the other functions above :p


any chance you know what rogues den fire ID is??

Daniel

2010-01-30 07:42:46

From: benjaa
any chance you know what rogues den fire ID is??


Apply the plugin and walk to the place yourself! :p