Results 1 to 3 of 3

Thread: Function CountItemsInInv(ItemColor:Integer):Integer;

  1. #1
    Join Date
    Sep 2006
    Location
    In Finland
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Function CountItemsInInv(ItemColor:Integer):Integer;

    SCAR Code:
    {*******************************************************************************
    Function CountItemsInInv(ItemColor:Integer):Integer;
    by: Mage Of Begu
    Description: Counts items in your inventory with specified color.
    *******************************************************************************}

    And heres the function...i hope its usefull...:
    SCAR Code:
    Function CountItemsInInv(ItemColor:Integer):Integer;
     var ItemsCounted:Integer;
    begin
    MouseSpeed:=30;
     if(FindColor(x,y,ItemColor,569,215,602,245))then  //---1---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,606,218,643,247))then  //---2---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,648,215,684,245))then  //---3---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,693,216,729,247))then  //---4---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,568,253,599,281))then  //---5---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,608,250,643,280))then  //---6---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,650,251,684,280))then  //---7---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,693,251,728,282))then  //---8---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,568,287,601,317))then  //---9---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,609,288,645,319))then  //---10---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,651,287,685,318))then  //---11---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,693,287,727,318))then  //---12---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,569,321,600,354))then  //---13---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,612,325,640,353))then  //---14---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,652,326,684,351))then  //---15---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,692,326,726,353))then  //---16---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,571,359,599,390))then  //---17---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,607,360,642,390))then  //---18---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,652,360,682,388))then  //---19---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,694,361,724,390))then  //---20---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,570,396,598,425))then  //---21---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,610,397,641,425))then  //---22---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,653,398,684,424))then  //---23---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,694,396,726,426))then  //---24---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,570,434,598,460))then  //---25---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,611,430,642,461))then  //---26---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,650,432,687,461))then  //---27---\\
       ItemsCounted:=ItemsCounted+1;
     if(FindColor(x,y,ItemColor,691,431,727,460))then  //---28---\\
       ItemsCounted:=ItemsCounted+1;
        Result:=ItemsCounted;
    end;

    And for those who want to know inventory slots co-ordinates:
    SCAR Code:
    {---------------------------------------------}
    {---------------------------------------------}
    {-- INVENTORY SLOT CO-ORDINATES...ENJOY...! --}
    {---------------------------------------------}
    {---------------------------------------------}

    1st inv slot:
    (569,215)
    (602,245)

    2nd inv slot:
    (606,218)
    (643,247)

    3rd inv slot:
    (648,215)
    (684,245)

    4th inv slot:
    (693,216)
    (729,247)

    5th inv slot:
    (568,253)
    (599,281)

    6th inv slot:
    (608,250)
    (643,280)

    7th inv slot:
    (650,251)
    (684,280)

    8th inv slot:
    (693,251)
    (728,282)

    9th inv slot:
    (568,287)
    (601,317)

    10th inv slot:
    (609,288)
    (645,319)

    11th inv slot:
    (651,287)
    (685,318)

    12th inv slot:
    (693,287)
    (727,318)

    13th inv slot:
    (569,321)
    (600,354)

    14th inv slot:
    (612,325)
    (640,353)

    15th inv slot:
    (652,326)
    (684,351)

    16th inv slot:
    (692,326)
    (726,353)

    17th inv slot:
    (571,359)
    (599,390)

    18th inv slot:
    (607,360)
    (642,390)

    19th inv slot:
    (652,360)
    (682,388)

    20th inv slot:
    (694,361)
    (724,390)

    21th inv slot:
    (570,396)
    (598,425)

    22th inv slot:
    (610,397)
    (641,425)

    23th inv slot:
    (653,398)
    (684,424)

    24th inv slot:
    (694,396)
    (726,426)

    25th inv slot:
    (570,434)
    (598,460)

    26th inv slot:
    (611,430)
    (642,461)

    27th inv slot:
    (650,432)
    (687,461)

    28th inv slot:
    (691,431)
    (727,460)

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

    Default

    SCAR Code:
    {*******************************************************************************
    function CountItemColor(color: Integer): Integer;
    By: based of PPLSUQBAWLZ's InventoryCount by Stupid3ooo
    Description: Performs a count of inventory items by color.
    *******************************************************************************}


    function CountItemColor(color: Integer): Integer;
    var
      used, i, e: Integer;
    begin
      GameTab(4);
      while (i < 6) do
      begin
        if (i = 5) and (e < 8) then
        begin
          i := 0;
          e := e + 1;
        end;
        if (FindColor(x, y, color, (570 + 39 * i), (214 + 35 * e), (609 + 39 * i),
          (249 + 35 * e))) then
          used := used + 1;
        i := i + 1;
      end;
      Result := used;
    end;

    Good effort though.

  3. #3
    Join Date
    Sep 2006
    Location
    In Finland
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Boreas View Post
    SCAR Code:
    {*******************************************************************************
    function CountItemColor(color: Integer): Integer;
    By: based of PPLSUQBAWLZ's InventoryCount by Stupid3ooo
    Description: Performs a count of inventory items by color.
    *******************************************************************************}


    function CountItemColor(color: Integer): Integer;
    var
      used, i, e: Integer;
    begin
      GameTab(4);
      while (i < 6) do
      begin
        if (i = 5) and (e < 8) then
        begin
          i := 0;
          e := e + 1;
        end;
        if (FindColor(x, y, color, (570 + 39 * i), (214 + 35 * e), (609 + 39 * i),
          (249 + 35 * e))) then
          used := used + 1;
        i := i + 1;
      end;
      Result := used;
    end;

    Good effort though.
    Yeah...ty anyways...!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. function SendKeyboard(FKey:Integer; Text:String): Integer;
    By Daniel in forum Research & Development Lounge
    Replies: 4
    Last Post: 07-18-2007, 04:28 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
  •