SRL Archive - Help and Support

07 Minimap DTMs


Total

2013-03-24 19:38:43

So in EoC I used DTM's alot for walking on the map and I find that in 07Scape it is much harder to get a Minimap DTM that works every time I log out/in. Am I the only one experiencing this? If you aren't what tolerance are you using for your DTM's?

Olly

2013-03-24 19:42:08

Apart from the minimap offset being there, the tolerance changes are massive in 07.

Le Jingle

2013-03-24 20:00:53

From: Ollybest
Apart from the minimap offset being there, the tolerance changes are massive in 07.


Agreed.

I don't use DTM's much, but as for MM searching, I've been making short color lists with cts2 modifiers instead of upping tolerances on searches.

Ashaman88

2013-03-24 20:27:05

From: Le Jingle
Agreed.

I don't use DTM's much, but as for MM searching, I've been making short color lists with cts2 modifiers instead of upping tolerances on searches.


I've been doing the same. I've found scripting in general to be more annoying in osr

Total

2013-03-24 21:11:38

From: Le Jingle
Agreed.

I don't use DTM's much, but as for MM searching, I've been making short color lists with cts2 modifiers instead of upping tolerances on searches.


Hmmm, color lists? Got an example? :p

Le Jingle

2013-03-24 21:21:30

From: Total
Hmmm, color lists? Got an example? :p


Personally, I make a custom type with search properties, then make an array of that type and setup the list when the script starts (Also helpful to have a Copy/AddTo/validity function checks for your creations - IMO). Can provide code snippet too if needed.

Total

2013-03-24 21:27:17

A snippet would be nice, I haven't really done anything with custom types yet.

Le Jingle

2013-03-24 22:34:56

Note that this is a very generic type, and I usually customize it according to what I need to get done.
I've seen other people use different (yet similar) types to do the same and/or different things. ( @zmon; / @superuser; )

Hope this helps;

program LJTest;
{$include_once srl/srl.simba}

type ID = (INVENTORY, MAINSCREEN, MINIMAP);

type
SearchModel = record
Name: string;
TypeID: ID;
BestColor, Tolerance, InitialColorToleranceSpeed, MinimumPixelCount: Integer;
Hue, Sat: Extended;
Bounds: TBox;
end;

type SearchModels = array of SearchModel;

// Find symbols that change colors or have People on top of them (sometimes)
var MinimapSymbolModels: SearchModels;

const MM_SYMBOL_BANK = 0;
const MM_SYMBOL_TREE = 1;

// Idea Credit = (Generally most well-supported high level languages) or (Zmon)
function CopyPSM(Other: SearchModel): SearchModel;
begin
Result.Name := Other.Name + ' - Copy';
Result.TypeID := Other.TypeID;
Result.BestColor := Other.BestColor;
Result.Tolerance := Other.Tolerance;
Result.Hue := Other.Hue;
Result.Sat := Other.Sat;
Result.InitialColorToleranceSpeed := Other.InitialColorToleranceSpeed;
Result.Bounds := Other.Bounds;
Result.MinimumPixelCount := Other.MinimumPixelCount;
end;

// Idea Credit = (Generally most well-supported high level languages) or (Zmon)
procedure AddModel(var TheList: SearchModels; NewModel: SearchModel);
var Index: Integer;
begin
Index := Length(TheList);
SetLength(TheList, Index + 1);
TheList[Index] := CopyPSM(NewModel);
end;

procedure InitializeSearchModels();
begin
SetLength(MinimapSymbolModels, 0);
end;

procedure Setup();
var Model: SearchModel;
begin
InitializeSearchModels();

with Model do
begin
Name := 'Minimap Symbol - Bank';
TypeID := MINIMAP;
BestColor := 7777;
Tolerance := 0;
Hue := 0.00;
Sat := 0.00;
InitialColorToleranceSpeed := 2;
case TypeID of
INVENTORY: Bounds := IntToBox(MIX1, MIY1, MIX2, MIY2);
MAINSCREEN: Bounds := IntToBox(MSX1, MSY1, MSX2, MSY2);
MINIMAP: Bounds := IntToBox(MMX1, MMY1, MMX2, MMY2);
else
Writeln('Invalid ID Type to search for!');
end;
MinimumPixelCount := 0;
end;

AddModel(MinimapSymbolModels, Model);
Writeln('Added the 1st Element');

with Model do
begin
Name := 'Minimap Symbol - Tree';
TypeID := MINIMAP;
BestColor := 5050;
Tolerance := 125;
Hue := 1.11;
Sat := 7.77;
InitialColorToleranceSpeed := 2;
case TypeID of
INVENTORY: Bounds := IntToBox(MIX1, MIY1, MIX2, MIY2);
MAINSCREEN: Bounds := IntToBox(MSX1, MSY1, MSX2, MSY2);
MINIMAP: Bounds := IntToBox(MMX1, MMY1, MMX2, MMY2);
else
Writeln('Invalid ID Type to search for!');
end;
MinimumPixelCount := 5050;
end;

AddModel(MinimapSymbolModels, Model);
Writeln('Added the 2nd Element');
end;

function ModelToString(TheModel: SearchModel): string;
begin
result := '';
result := result + 'Name = ' + TheModel.Name + #13 + #10;
result := result + 'Best Color = ' + IntToStr(TheModel.BestColor) + #13 + #10;
result := result + 'Tolerance = ' + IntToStr(TheModel.Tolerance) + #13 + #10;
result := result + 'InitialCTS = ' + IntToStr(TheModel.InitialColorToleranceSpeed) + #13 + #10;
result := result + 'Hue = ' + FloatToStr(TheModel.Hue) + ', ';
result := result + 'Sat = ' + FloatToStr(TheModel.Sat) + #13 + #10;
result := result + 'Min Count = ' + IntToStr(TheModel.MinimumPixelCount) + #13 + #10;
result := result + 'Bounds = ' + ToStr(TheModel.BestColor);
end;

var i: Integer;
begin
SetupSRL;
ClearDebug;

Setup();

for i := 0 to high(MinimapSymbolModels) do
begin
Writeln('');
Writeln(ModelToString(MinimapSymbolModels[i]));
end;

end.

(Writing further methods according to what you define in your types varies.)

Total

2013-03-24 23:15:06

Thanks, will take a bit to see whats going on exactly but I'll find it out. :p +Rep

Olly

2013-03-25 12:38:25

Should take use of nava2's best color functions, there pretty damn good :)