Results 1 to 7 of 7

Thread: Problems Finding DTMs!!! HELP!!!

  1. #1
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problems Finding DTMs!!! HELP!!!

    In my script, my dtm's work for a while, then they stop working, idk whats going on here... So i always have to remake the damn dtms, someone plz tell me what the heck is going on!?
    Woot woot.

  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    255 main point tolerance?
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Are you looking for inventory items?

    SCAR Code:
    program New;
    {.include Srl\SRL.scar}
    var
    UIDB_Net: TPointArray;

    procedure UIDB_LoadNet;
    var tmpcount,hx,hy:integer;
    begin
      SetArrayLength(UIDB_Net,506);
      repeat
        hy:=9;
        hx:=hx+1;
        repeat
          hy:=hy+1;
          if (((hx mod 2)=0) or ((hy mod 2)=0)) then
          begin
            UIDB_Net[tmpcount]:=Point(hx,hy);
            Inc(tmpcount);
          end;
        until hy=31;
      until hx=31;
    end;



    Function InvBox2(i :Integer): TBox;
    begin
      if (i < 1) or (i > 28) then
      begin
        srl_Warn('InvBox', 'Incorrect index: ' + IntToStr(i), warn_AllVersions);
        exit;
      end;
      {1 x1 563 y1 213 x2 594 y2 244}
      {5 x1 605 y1 249}
      Result.x1 :=563+((((i+3)mod 4))*(605-563));
      Result.y1 :=213+((((i-1)/4))*(249-213));
      Result.x2 := Result.x1+31;
      Result.y2 := Result.y1+31;
    end;

    {*******************************************************************************
    function strToIntArrayEx(intArray, Separater : String) : Array of Integer;
    By: moparisthebest and modified by Ron
    Description: Loads a String into an array of integer. (Example String: '567 389 3234 98342 7998767')
    *******************************************************************************}


    function strToIntArrayEx(intArray, Separater : String) : Array of Integer;
    var
      i, spacePos: Integer;
    begin
      repeat
        SetArrayLength(Result, i + 1);
        spacePos := Pos(Separater, intArray);
        if (not (spacePos = 0)) then
          Result[i] := StrToInt(Copy(intArray, 1, spacePos - 1))
        else
        begin
          Result[i] := StrToInt(Copy(intArray, 1, Length(intArray)));
          break;
        end;
        Delete(intArray, 1, spacePos);
        i := i + 1;
      until (False)
    end;

    {*******************************************************************************
    function strToIntArray(intArray : String) : Array of Integer;
    By: moparisthebest and modified by Ron
    Description: Refer to strToIntArrayEx.
    *******************************************************************************}


    function strToIntArray(intArray : String) : Array of Integer;
    begin
      Result := strToIntArrayEx(intArray, ' ');
    end;

    {*******************************************************************************
    function intArrayToStrEx(intArray : Array of Integer; Separater : String) : String;
    By: moparisthebest and modified by Ron
    Description: Loads an array of integer into a String. (Example String: '567 389 3234 98342 7998767')
    *******************************************************************************}


    function intArrayToStrEx(intArray : Array of Integer; Separater : String) : String;
    var
      i, arrayLength: Integer;
    begin
      arrayLength := GetArrayLength(intArray);
      repeat
        Result := Result + IntToStr(intArray[i]);
        if (not(i = (arrayLength - 1))) then
          Result := Result + Separater;
        i := i + 1;
      until (i = arrayLength)
    end;

    {*******************************************************************************
    function intArrayToStr(intArray : Array of Integer) : String;
    By: moparisthebest and modified by Ron
    Description: Refer to intArrayToStrEx.
    *******************************************************************************}


    function intArrayToStr(intArray : Array of Integer) : String;
    begin
      Result := intArrayToStrEx(intArray, ' ');
    end;







    function CreateBL(Area:string; Slot:integer): TIntegerArray;
    var SlotBox:TBox;
    i,tmpAL:integer;
    begin
      case lowercase(Area) of
        'inv': SlotBox:= InvBox2(Slot);
        'bank': SlotBox:= BankIndexToMSBox(Slot);
      end;
      tmpAL:=1;
      SetArrayLength(result,tmpAL+1);
      for i:=0 to 505 do
      begin
        if getcolor(UIDB_Net[i].x+SlotBox.x1,UIDB_Net[i].y+SlotBox.y1)=65536 then
        begin
          result[tmpAL]:=i;
          Inc(tmpAL);
          SetArrayLength(result,tmpAL+1);
        end;
      end;
      SetArrayLength(result,tmpAL);
      result[0]:=tmpAL-1;
    end;

    function CompareBL(First,Second:TIntegerArray):boolean;
    var i:integer;
    begin
      if First[0]<> Second[0] then exit;
      for i:=1 to First[0] do
      begin
        if First[i] <> Second[i] then exit;
      end;
      result:=true;
    end;
    function CountBL(BlackList:TIntegerArray):integer;
    var i:integer;
    begin
      for i:=1 to 28 do
      begin
        if CompareBL(BlackList,CreateBL('inv',i)) then
          inc(result);
      end;
    end;


    var c,t,MyBMP:integer;
     MyBL:TIntegerArray;
    begin
      UIDB_LoadNet;

      for c:=1 to 28 do
      begin
        MyBL:=CreateBL('inv',c);
        WriteINI('Item'+inttostr(c),'Black', intArrayToStr(MyBL),AppPath+'\UIDB\UIDBdemo.ini');
      end;
      FreeBitmap(mybmp);
     
      t:=getsystemtime;
      if CompareBL( strToIntArray(ReadIni('Item3','Black',AppPath+'\UIDB\UIDBdemo.ini')),
      CreateBL('inv',8)) then
      writeln('yes, item 8 is the same as item 3');
      writeln(inttostr(getsystemtime-t));
    end.

  5. #5
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm trying to find the items on the screen and in inv . Heeeeeeelpz
    Woot woot.

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

    Default

    Post a screenie of it

    SCAR Code:
    program New;
    var MyBmp,w,h:integer;
    begin
    GetClientDimensions(w,h);
    MyBmp:=BitmapFromString(w,h,'');
    CopyClientToBitmap(MyBmp, 0,0,w,h);
    SaveBitmap(MyBmp,AppPath+'\itemscreenie.bmp');
    end.

  7. #7
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you using the right coords? MSX, MSY, MIX, MIY, etc


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Yohojo's DTM Tut 1(Item finding with DTMs)
    By YoHoJo in forum OSR Intermediate Scripting Tutorials
    Replies: 206
    Last Post: 07-31-2013, 12:45 AM
  2. finding DTMs
    By TheChineseMan in forum OSR Help
    Replies: 2
    Last Post: 08-30-2008, 01:03 PM
  3. Inventory DTMs and global problems :S
    By StrikerX in forum OSR Help
    Replies: 3
    Last Post: 07-15-2008, 03:19 AM
  4. Problems on Bitmap Finding?!
    By Raepor in forum OSR Help
    Replies: 10
    Last Post: 04-15-2008, 09:07 AM
  5. Finding BitMaps/DTMs
    By stupedspam in forum OSR Help
    Replies: 4
    Last Post: 05-19-2007, 01:32 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
  •