Results 1 to 7 of 7

Thread: DTM TBox question

  1. #1
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default 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([]);
      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.

    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. #2
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

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

  3. #3
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    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?

    Attached Images Attached Images

  4. #4
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by hackingislol133 View Post
    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. #5
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    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. #6
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by hackingislol133 View Post
    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. #7
    Join Date
    Jan 2012
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    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.
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •