SRL Archive - OSR Help

DTM TBox question


hackingislol133

2019-09-09 20:23:33

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.

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([]);
testDTM := DTMFromString('mwQAAAHic42RgYNjEyMDQB8TXGBHsfiDeChW7AsRFTAwMvlAcCMTlQDwPiOcyQeRAdGyoG0NBpAZDTqgag6elEEOCBydDVpQ9Q5Y/N0Owpz5DmAMnA9UBAFvdEc0=');
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.

function FindDTM(const DTM: Integer; var x, y: Integer; const SearchBox: TBox): Boolean; overload;
function TInterfaceBase.GetBounds(): TBox

Is there something I'm missing here?

Olly

2019-09-09 21:14:41

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

hackingislol133

2019-09-09 22:41:13

From: 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?


Citrus

2019-09-10 20:38:50

From: 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.

hackingislol133

2019-09-10 23:33:29

From: 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.

Citrus

2019-09-11 00:10:32

From: 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.

hackingislol133

2019-09-11 15:17:06

From: 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.