Results 1 to 3 of 3

Thread: RuneAmount Question

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

    Default RuneAmount Question

    SCAR Code:
    function RuneAmount(area, runetype: string): Integer;
    //i wouldnt use shop for area here...
    //but you can :)
    var
      runebmp: Integer;
    begin
      runebmp := LoadRune(runetype);
      Result := AmountBmp(area, runebmp, 90);
    end;

    Because the result is
    SCAR Code:
    Result := AmountBmp(area, runebmp, 90);
    How can I read from that how many is there?
    And how to print it, I mean :
    SCAR Code:
    Writeln(IntToStr(AmountBmp)) //????
    But the bigger problem now is how can I make a Procedure that looks how many runes is there left and put it into an integer?

    No hurry though, I'm mainly doing my PwnzorChopper

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

    Default

    are you sure that the function results an int and not a extended or string
    "your always where you supposed to be"

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

    Default

    Well here's the AmounBmp
    SCAR Code:
    function AmountBmp(area: string; itembmp, tol: Integer): Integer;
    //counts stacks
    var
      coords: TPointArray;
      i: Integer;
    begin
      Result := 0;
      coords := ItemCoordsBmp(area, itembmp, tol);
      for i := 0 to GetArrayLength(coords) - 1 do
        Result := Result + GetAmount(coords[i].x, coords[i].y);
    end;

    and here's GetAmount
    SCAR Code:
    function GetAmount(itemx, itemy: Integer): Integer;
    //uses font cropped to work with "Opponent's Offer"
    //font is identical except 2 pixels shorter
    //coords are ones from istextinarea
    //'K' and 'M' work :)
    //non-stackable =1
    //blank = 0
    var
      amountstr: string;
      tempx, tempy: Integer;
    begin
      if (not (tradecharsloaded)) then
      begin
        tradechars := LoadChars2(AppPath + 'includes\SRL\CharsTrade\');
        tradecharsloaded := True;
        Wait(2);
      end;

      amountstr := Trim(GetTextAtEx(itemx, itemy + 4, 0, tradeChars, False, False,
        0, 2, 65535, 5, True, tr_AlphaNumericChars));
      if (Length(amountstr) > 0) then
      begin
        if (Pos('K', amountstr) > 0) then
        begin
          Delete(amountstr, Length(amountstr), Length(amountstr));
          Result := StrToInt(amountstr) * 1000;
        end else
          if (Pos('M', amountstr) > 0) then
          begin
            Delete(amountstr, Length(amountstr), Length(amountstr));
            Result := StrToInt(amountstr) * 1000000;
          end else
            Result := StrToInt(amountstr);
      end else
        if (FindColor(tempx, tempy, 65536, itemx, itemy, itemx + 30, itemy + 30))
          then
          Result := 1;
    end;

    I just can't understand this yet, . Help please


    EDIT: Been waiting for 7 days - Heelp!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. One Question?
    By gamer 5 in forum C#/Visual Basic Help and Tutorials
    Replies: 3
    Last Post: 01-06-2008, 10:45 PM
  2. Question?
    By SocCerSporTie in forum SRL Site Discussion
    Replies: 7
    Last Post: 10-28-2007, 02:55 PM
  3. I have a question.
    By Hey321 in forum News and General
    Replies: 1
    Last Post: 01-26-2007, 09:13 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
  •