Results 1 to 3 of 3

Thread: FindDeformed making RS time out..

  1. #1
    Join Date
    Apr 2007
    Location
    California
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindDeformed making RS time out..

    Okay, so, for my AutoMiner, i wanted to make it move to the mining symbol (getting it near the center) and then from there move to the rocks it needed to. (Either copper, tin, iron, or gold.) To do this, i created bitmaps of the rocks on the minimap, and used FindDeformed to locate them. It all works fine, except that FindDeformed takes too long to find them, that RS logs out from not moving or clicking anything.

    From what i understand, FindDeformed searches for the bitmap, then lowers the tolerance, then searches, then lowers, and so on until it finds the bitmap. If i could alter FindDeformed to do something like click a gametab between searches, then it wouldn't log me out. If i did so, i'd have to put the altered version in my script. When i tried to make it like so:
    SCAR Code:
    function FindDeformed(var Xoff, Yoff: Integer; BMP, a, b, c, d: Integer):
      Boolean;
    var
      acc, ref: Extended;
      XT, YT, times, tol: Integer;
    begin
      ref := 0.9;
      tol := 0;
      for times := 1 to 50 do
      GameTab(2);  // This is
      GameTab(4);  // what I
      Wait(700+random(500));  // added
      begin
        FindDeformedBitmapToleranceIn(BMP, XT, YT, a, b, c, d, tol, 2, True, acc);
        if (acc >= ref) then
        begin
          Xoff := XT;
          YOff := YT;
          Result := True;
          Exit;
        end;
        if times mod 5 = 0 then
        begin
          ref := ref - 0.1;
          tol := tol + 10;
        end;
        Wait(1);
      end;
    end;

    And it compiled, but when i ran it all it did was the gametabs, and then gave me some access error thing. (I don't remember exactly what it said.) Could anyone explain to me what I did wrong, or what i should do instead?

    Also, i tried creating a DTM of the rocks. I made the parent point the ground near the rocks, with max tolerance, and then made the other points near the center of each rock. It worked perfectly, but then when i changed worlds the colors changed (which i was unaware that they did that, i thought only the roads did ) so i'm guessing i can't use that then. Currently in my script is checks for the DTM fives times, and if it still doesn't find it it does FindDeformed as a last resort (which has the above-mentioned problem)

    Could anyone help me out?

    Edit: Here's what the error was

    "[Runtime Error] : Exception: Access violation at address 006A975B in module 'scar.exe'. Read of address 00000000 in line 114 in script C:\ProgramFiles\SCAR3.06\Scripts\MyAutoMiner\Rimmi ngtonAutoMinerV0.6scar"

  2. #2
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    While not FindDeformedBitmapToleranceIn(BMP, XT, YT, a, b, c, d, tol, 2, True, acc) do
    begin
      FindNormalRandoms;
      FindTalk;
      Gametab(1+random(13));
    end;
    Something like that might work for your procedure.
    And did you declare your DTM properly?
    Huehuehuehuehue

  3. #3
    Join Date
    Apr 2007
    Location
    California
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well first off, i don't think that FindDeformedBitmapToleranceIn is a function in SRL..There's FindBitmapsProgressiveTol, FindDeformed, FindBitMapTol, and FindBitMapTolRaiser..and i'm not sure how that would work..?

    And yeah, i'm pretty sure i declared the DTMs right.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 67
    Last Post: 03-25-2009, 10:32 AM
  2. Need Help making my Anti Ban not work all the time!
    By Fruity-Lo0py in forum OSR Help
    Replies: 4
    Last Post: 09-14-2007, 06:51 PM
  3. Long time listener...first time caller
    By Ransom in forum Who Are You ? Who ? Who ?
    Replies: 0
    Last Post: 11-04-2006, 02:05 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
  •