Results 1 to 9 of 9

Thread: Counting Coins

  1. #1
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default Counting Coins

    For my next project, I need a method of counting the amount of coinage a person has.

    I currently have 30k in my inventory, but using get amount returns 1. Is there something else to use to count it?

    I tried using findcoins, but it is broken. I don't know what else to use?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  2. #2
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Do you have this get amount? Its in Dev svn.
    SCAR Code:
    {*******************************************************************************
    function GetAmount(ItemX, ItemY: Integer): Integer;
    By: Zeph, N1ke & Narcle
    Description: Returns the amount of an item at coordinates (ItemX, ItemY).
      Returns approximate values for 'K' and 'M'.
    *******************************************************************************}

    Function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      Col: TIntegerArray;
      X, Y, I: Integer;
      B: TBox;
      TPA: TPointArray;
      S: String;
    begin
      Result := 0;
      If Not FindColor(X, Y, 65536, ItemX-30, ItemY-30, ItemX+30, ItemY+30)then
        Exit;
      Inc(Result);
      Col := [65535, 16777215, 8453888];
      For I:=0 to 2 do
       If FindColor(X, Y, Col[I], ItemX-22, ItemY-22, ItemX+22, ItemY+22)then
       begin
         FindColors(TPA, Col[i], ItemX-22, ItemY-22, ItemX+22, ItemY+22);
         B := GetTPABounds(TPA);
         S := Trim(GetTextAtEx(B.X1-1, B.Y1-1, 0, StatChars, False, False, 0, 1, Col[I], 5, True, tr_AllChars));
         Result := StrToIntDef(GetNumbers(S), 1);
         Case I of
           1: Result := Result * 1000;
           2: Result := Result * 1000000;
         end;
         Exit;
       end;
    end;
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Do you have this get amount? Its in Dev svn.
    SCAR Code:
    {*******************************************************************************
    function GetAmount(ItemX, ItemY: Integer): Integer;
    By: Zeph, N1ke & Narcle
    Description: Returns the amount of an item at coordinates (ItemX, ItemY).
      Returns approximate values for 'K' and 'M'.
    *******************************************************************************}

    Function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      Col: TIntegerArray;
      X, Y, I: Integer;
      B: TBox;
      TPA: TPointArray;
      S: String;
    begin
      Result := 0;
      If Not FindColor(X, Y, 65536, ItemX-30, ItemY-30, ItemX+30, ItemY+30)then
        Exit;
      Inc(Result);
      Col := [65535, 16777215, 8453888];
      For I:=0 to 2 do
       If FindColor(X, Y, Col[I], ItemX-22, ItemY-22, ItemX+22, ItemY+22)then
       begin
         FindColors(TPA, Col[i], ItemX-22, ItemY-22, ItemX+22, ItemY+22);
         B := GetTPABounds(TPA);
         S := Trim(GetTextAtEx(B.X1-1, B.Y1-1, 0, StatChars, False, False, 0, 1, Col[I], 5, True, tr_AllChars));
         Result := StrToIntDef(GetNumbers(S), 1);
         Case I of
           1: Result := Result * 1000;
           2: Result := Result * 1000000;
         end;
         Exit;
       end;
    end;
    I just updated today. I should.

    SCAR Code:
    {*******************************************************************************
    function GetAmount(ItemX, ItemY: Integer): Integer;
    By: Zeph, N1ke & Narcle
    Description: Returns the amount of an item at coordinates (ItemX, ItemY).
      Returns approximate values for 'K' and 'M'.
    *******************************************************************************}

    Function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      Col: TIntegerArray;
      X, Y, I: Integer;
      B: TBox;
      TPA: TPointArray;
      S: String;
    begin
      Result := 0;
      If Not FindColor(X, Y, 65536, ItemX-30, ItemY-30, ItemX+30, ItemY+30)then
        Exit;
      Inc(Result);
      Col := [65535, 16777215, 8453888];
      For I:=0 to 2 do
       If FindColor(X, Y, Col[I], ItemX-22, ItemY-22, ItemX+22, ItemY+22)then
       begin
         FindColors(TPA, Col[i], ItemX-22, ItemY-22, ItemX+22, ItemY+22);
         B := GetTPABounds(TPA);
         S := Trim(GetTextAtEx(B.X1-1, B.Y1-1, 0, StatChars, False, False, 0, 1, Col[I], 5, True, tr_AllChars));
         Result := StrToIntDef(GetNumbers(S), 1);
         Case I of
           1: Result := Result * 1000;
           2: Result := Result * 1000000;
         end;
         Exit;
       end;
    end;

    Same thing, no?

    It returns 1 for the amount of coins instead of 33477.

    PHP Code:
    Creating the NickTPA.
    Found Coins
    Amount
    1
    Cost is
    83
    Going to buy


    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  4. #4
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    It works for me? Try this:
    SCAR Code:
    {.include SRL/SRL/misc/smart.scar}
    {.include srl/srl.scar}

    var
      T: TPoint;

    begin
      Smart_Server := 1;
      Smart_Members:= false;
      Smart_Signed := true;
      Smart_SuperDetail := false;
      SetupSRL;

      T := ItemCoords(3);//Inv slot its in
      Writeln(GetAmount(T.x, T.y));
    end.

    Note its best to use the center point of the inventory as GetAmount looks in a box.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    It works for me? Try this:
    SCAR Code:
    {.include SRL/SRL/misc/smart.scar}
    {.include srl/srl.scar}

    var
      T: TPoint;

    begin
      Smart_Server := 1;
      Smart_Members:= false;
      Smart_Signed := true;
      Smart_SuperDetail := false;
      SetupSRL;

      T := ItemCoords(3);//Inv slot its in
      Writeln(GetAmount(T.x, T.y));
    end.

    Note its best to use the center point of the inventory as GetAmount looks in a box.
    It works for me if I declare the inventory spot.

    I suggest updating the CoinAmount, FindCoins parts in Amount then, since those wont work with it.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  6. #6
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Yeah I'm trying FindCoins its not even finding them...
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  7. #7
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Yeah I'm trying FindCoins its not even finding them...
    I was having the same problem. Probably why it wouldn't count them.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  8. #8
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tell me if you need exact amounts for 100k+

  9. #9
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function InvCoins: Integer;
    begin
        Result := ItemAmount('inv', 'bmp', LoadCoinBmp, [80]);
        FreeBitmap(LoadCoinBmp);
    end;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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