Results 1 to 6 of 6

Thread: [advanced]multiple dtms to tpoint array

  1. #1
    Join Date
    Jul 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [advanced]multiple dtms to tpoint array

    i want to find multiple(about 5) dtms in the mm and and store all the locations in a tpoint array i was think i would find the dtm then at the point i found it some how block that spot so it would not search around that spot and repeat until it could not find anymore of the dtm please can someone help me
    "your always where you supposed to be"

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Yea I want that too. I'm working on that except for bitmaps right now, when I finish, you should be able to convert to dtms very easily.

  3. #3
    Join Date
    Jul 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i was looking through srl and i saw freddys FindColorSkipBox but it results then function FindColorSkipBoxD then i looked through scars build in function and didnt find what is this FindColorSkipBoxD i think i could help me a very lot
    "your always where you supposed to be"

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    It's in an obfuscated plugin. To see it in action check out my lumbridge thread.

    I finished. Run on attached pic
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    {*******************************************************************************
    function tPtArrayToStr(newTPoint: TPointarray): String;
    By: moparisthebest
    Description: Loads a TPointArray into a string. (Example String: '50,10 80,53 350,765 8560,1897 2348,346')
    *******************************************************************************}


    function tPtArrayToStr(newTPoint: TPointArray): string;
    var
      i, tPtLength: Integer;
    begin
      tPtLength := GetArrayLength(newTPoint);
      repeat
        Result := Result + IntToStr(newTPoint[i].x) + ',' +
          IntToStr(newTPoint[i].y);
        if (not (i = (tPtLength - 1))) then
          Result := Result + ' ';
        i := i + 1;
      until (i = tPtLength)
    end;


    function FindAllBitmapsIn(TheBmp,startx,starty,endx,endy:integer):array of tpoint;
    var tmpbool:boolean;
    AL:integer;
    curx,cury,tmpx,tmpy,height:integer;
    begin
      tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,starty,endx,endy);
      if tmpbool then
      begin
        curx:=startx;
        cury:=starty;
        /////auto height finder///////
        tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,starty,endx,endy);
        height:=0;
        repeat
          height:=height+1;
          tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,tmpy,endx,tmpy+height);
        until tmpbool;
        //writeln('height '+inttostr(height));
        ///////////
        repeat
          tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,curx,cury,endx,cury+height);
          if tmpbool then
          begin
            curx:=tmpx+1;
            AL:=getarraylength(result);
            setarraylength(result,AL+1);
            result[AL].x:=tmpx;
            result[AL].y:=tmpy;
          end;
          if not tmpbool then
          begin
            curx:=startx;
            cury:=cury+1;
          end;
        until cury=endy+1;
      end;
    end;




     var mytpa:array of tpoint;
     
     t,PlayerDot:integer;
    begin
      SetupSRL;

      PlayerDot := BitmapFromString(4, 5, 'z78DA3330000137570434C010' +
           '8140576710C41471310241B026435723107436054188880102182' +
           '28B0000E71C1BCB');
      t:=getsystemtime;
      mytpa:= FindAllBitmapsIn(PlayerDot,0,0,70,70);
      writeln(inttostr(getsystemtime-t)+'ms');
      writeln(tPtArrayToStr(mytpa));
    end.

    I had it before where you would put in the height of the bitmap, but that wouldn't work for DTMs, so I made it auto find the height.

    It returns points that are just above the bitmap, add
    for t:= 0 to getarraylength(myta)-1 do
    clickmouse(mytpa[t].x,mytpa[t].y,true)
    and select the pencil tool in paint to see where

  5. #5
    Join Date
    Jul 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    that is what it says mabey it have to do with me using it in divi?
    [Runtime Error] : Out Of Range in line 16 in script
    "your always where you supposed to be"

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    function tPtArrayToStr(newTPoint: TPointArray): string;
     var
       i: Integer;
     begin
       for i:=0 to GetArrayLength(newTPoint)-1 do
        begin
        Result := Result + IntToStr(newTPoint[i].x) + ',' +
           IntToStr(newTPoint[i].y);
            if (not (i = (GetArrayLength(newTPoint) - 1))) then
           Result := Result + ' ';
       end;
     end;

    Try that. If it still doesn't work, try on 2.03. Still after that, it could be because I wrote it months ago and don't feel like updating it.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Tpoint help.
    By Wade007 in forum OSR Help
    Replies: 3
    Last Post: 02-22-2008, 06:20 PM
  2. ItemColors: Array of Array of Integer
    By n3ss3s in forum Research & Development Lounge
    Replies: 5
    Last Post: 10-30-2007, 06:04 PM
  3. Array of Tbox - And TPoint array helps.
    By R0b0t1 in forum OSR Help
    Replies: 4
    Last Post: 06-10-2007, 06:43 PM

Posting Permissions

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