1. SRL Junior Member
Join Date
Jan 2012
Posts
82
Mentioned
0 Post(s)
Quoted
39 Post(s)

## DTM TBox question

Brushing up on some fundamentals and I can't figure out how to get DTMs working again. Digging into the includes, my understanding is that TInterfaceBase.getBounds() is the SRL-OSR version of mainscreen.getBounds() in SRL-6. To test, I'm trying to find the DTM of a bankbooth and click on it. If I'm reading this right, TInterfaceBase.GetBounds() returns the entire gamescreen as TBox which is then used as the search area for FindDTM.

Code:
program test;

{$define SMART} {$i srl/osr.simba}

var
testDTM, x, y: Integer;

procedure run();
begin
FindDTM(testDTM,x,y,TInterfaceBase.GetBounds());
mouse.Click(x,y,mouse_left);
end

begin
srl.Setup([]);
run();
FreeDTM(testDTM);
end.
When trying to compile, Simba is throwing up a variable expected error on row 11 (FindDTM) message but I can't figure out where I'm missing a variable.

Code:
function FindDTM(const DTM: Integer; var x, y: Integer; const SearchBox: TBox): Boolean; overload;
Code:
function TInterfaceBase.GetBounds(): TBox
Is there something I'm missing here?

2. It's MainScreen.getBounds()in SRL-OSR too.

3. SRL Junior Member
Join Date
Jan 2012
Posts
82
Mentioned
0 Post(s)
Quoted
39 Post(s)
Originally Posted by Olly
It's MainScreen.getBounds()in SRL-OSR too.
Ah. I was overthinking it.

I'm trying again now with mainscreen.getBounds() and I don't think my x, y integers are storing properly. When I writeln findDTM, it returns false. I'm just using the Simba 1.3 DTM editor to pick points and print DTM to string. Is there a step I'm missing here?

4. Originally Posted by hackingislol133
Ah. I was overthinking it.

I'm trying again now with mainscreen.getBounds() and I don't think my x, y integers are storing properly. When I writeln findDTM, it returns false. I'm just using the Simba 1.3 DTM editor to pick points and print DTM to string. Is there a step I'm missing here?

What are you making a DTM of?
FWIW, I think bitmaps are a lot easier to deal with, and from my own tests they're faster too.
Last edited by Citrus; 09-11-2019 at 12:49 AM.

5. SRL Junior Member
Join Date
Jan 2012
Posts
82
Mentioned
0 Post(s)
Quoted
39 Post(s)
Originally Posted by Citrus
What are you making a DTM of?
FWIW, I think bitmaps are a lot easier to deal with, and from my own tests they're faster too.
A bank booth for testing. I know that I can just use BankScreen.Open or even just use CTS. I'm just trying to refresh myself on all of the different color functions in Simba.

6. Originally Posted by hackingislol133
A bank booth for testing. I know that I can just use BankScreen.Open or even just use CTS. I'm just trying to refresh myself on all of the different color functions in Simba.
DTMs and bitmaps are good for static, flat objects, e.g. inventory items. Nothing on the mainscreen is a good candidate for a DTM or bitmap.
Use basic object finding for mainscreen stuff. FindColors -> Cluster -> Filter -> Sort, etc.

7. SRL Junior Member
Join Date
Jan 2012
Posts
82
Mentioned
0 Post(s)
Quoted
39 Post(s)
Originally Posted by Citrus
DTMs and bitmaps are good for static, flat objects, e.g. inventory items. Nothing on the mainscreen is a good candidate for a DTM or bitmap.
Use basic object finding for mainscreen stuff. FindColors -> Cluster -> Filter -> Sort, etc.
Thanks, I'll stick with DTMs for flat objects.