Results 1 to 7 of 7

Thread: Lagging bad!

  1. #1
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Lagging bad!

    Ok, so i have some serious lag issues with this quick procedure. Can anyone point out why?

    SCAR Code:
    program New;
    {.include srl/srl.scar}

    Var
    WalkDTM: Integer;
    x, y: Integer;

    procedure Walk;
    begin
      WalkDTM := DTMFromString('78DA634C646260A86400032E08C5D05CA3CFF' +
           '01F483302F17F20608C07AAC96340011AFE8C0C1A503520C09803' +
           '54934F404D16504D0D013591986A6AA7ED44510300275E0E59');
           
        if DTMRotated(WalkDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
        begin
        Mouse(x, y, 2, 2, true);
        end else
         WriteLn('No DTM found.');
      FreeDTM(WalkDTM);
    end;

    begin
     SetupSRL;
     Walk;
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    DTMRotated is quite a slow procedure as it has to do FindDTM quite a lot of times at various angles. You can look into using the more advanced DTM rotation methods where you can specify angle increments etc or live with it
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    more advanced DTM rotation methods
    can you tell me what some of them are?

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    function FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; StartAngle, EndAngle, AngleStep: Extended; var Angle: Extended): Boolean;
    That's the one mainly used for more advanced finding, though I do believe there are a couple of other ones. All of the inputs are quite self explanatory, just remember to add a variable to store Angle in (which is the angle found). You can then play with the AngleStep to find a good value, though depending on what it's for, normally 05.-1 if good for accurate DTM's while you can sometimes get away with 2 if it's a loose DTM.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, so more like this?

    SCAR Code:
    program New;
    {.include srl/srl.scar}

    Var
    WalkDTM: Integer;
    x, y, b: Integer;

    procedure Walk;
    begin
      WalkDTM := DTMFromString('78DA634C646260A86400032E08C5D05CA3CFF' +
           '01F483302F17F20608C07AAC96340011AFE8C0C1A503520C09803' +
           '54934F404D16504D0D013591986A6AA7ED44510300275E0E59');
           
        if FindDTMRotated(WalkDTM, x, y, mmx1, mmy1, mmx2, mmy2, 160, 210, 1, b) then
        begin
        Mouse(x, y, 2, 2, true);
        end else
         WriteLn('No DTM found.');
      FreeDTM(WalkDTM);
    end;

    begin
     SetupSRL;
     Walk;
    end.

    i get an error with this one tho.
    SCAR Code:
    Line 14: [Error] (12657:80): Type mismatch in script C:\Program Files\SCAR 3.14\Scripts\Made\Walk.scar

  6. #6
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    First off, I'd say you should lower the angle step... Right now it's searching at (I think) about 6 different angles.

    And about the type mismatch, the variable b has to be an extended.

    EDIT: Just so you know, FindDTMRotated uses radians.

  7. #7
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, i appreciate the help guys. Seems to work a lot better.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. its keeps on lagging
    By cheese444222 in forum OSR Help
    Replies: 2
    Last Post: 10-08-2007, 09:58 PM
  2. Lagging etc!!
    By TravisV10 in forum OSR Help
    Replies: 10
    Last Post: 08-29-2007, 08:26 PM
  3. Why is this lagging?
    By Dude in forum OSR Help
    Replies: 4
    Last Post: 08-16-2007, 01:33 AM

Posting Permissions

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