Results 1 to 2 of 2

Thread: Check For Level Up Hitpoints

  1. #1
    Join Date
    Nov 2013
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default Check For Level Up Hitpoints

    I have recently created a working combat bot, I have created a progress report that will display level ups by recording the initial level when the script starts and taking that away from the current level, this works for stats such as strength and attack, but for hitpoints, due to the fact that it is a combat script and it records the top number in the stats and not the bottom when i take damage I get minus numbers in levels gained, how do I fix this so that it will use the bottom stat number not the top? or any other way I can fix this thanks in advance.
    Last edited by S_rose94; 04-25-2014 at 10:11 PM.

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    hard way
    I had a function that got all the stat levels

    Simba Code:
    procedure tStatInfo.getSkills;
    var
      i, k, basex, basey, c:integer;
    begin
      self.setSkillNames();
      openTab(TAB_STATS);
      basex := 586;
      basey := 300;
      for i := 0 to 2 do
        for k := 0 to 6 do
        begin
          try
            self.skillLevel[c] := StrToInt(getSimpleText([65535], basex + (i * 54), basey + (k * 32), basex + 14 + (i * 54), basey + 11 + (k * 32), 'statchars07'));
          except
            self.skillLevel[c] := -1;
          end;
          c := c + 1;
        end;
    end;

    the main point of concentration here is the formula:

    Simba Code:
    self.skillLevel[c] := StrToInt(getSimpleText([65535], basex + (i * 54), basey + (k * 32), basex + 14 + (i * 54), basey + 11 + (k * 32), 'statchars07'));

    x1 = basex + (i * 54)
    x2 = basey + (k * 32)
    y1 = basex + 14 + (i * 54)
    y2 = basey + 11 + (k * 32)

    base x and y are the top left coordinates of where the number starts, 54 is the x amount of pixels between each stat going left to right, 32 is the amount of pixels between each stat going up and down


    So the formula would be:

    Simba Code:
    function getStatBox(column, row:integer):Tbox;
    begin
      result := intToBox(586 + (column * 54), 586 + 14 + (column * 54), 300 + (row * 32), 300 + 11 + (row * 32)));
    end;

    This function gets the box in which the text is inside. What you have to edit is the number 586 and 300 to the lower number of the attack skill.





    The easiest way to do this would be:

    Simba Code:
    function getSimpleText(Color, tol:integer;x1, y1, x2, y2:integer;font:string):String;
    var
      textTPA:TPointArray;
      textATPA:T2DPointArray;
    begin
      findColorsTolerance(textTPA, color, x1, y1, x2, y2, tol);
      textATPA := SplitTPAEx(textTPA, 1, 10);
      filtertpasbetween(textatpa, 0, 1);
      SortATPAFromFirstPointX(textATPA, Point(0, 0));
      result := getTextATPA(textATPA, 3, font);
    end;

    Use this function, and insert the x1, y1, x2, and y2 of the text

    So it would look like

    Simba Code:
    getSimpleText(textColor, tolerance, x1, y1, x2, y2, 'statchars07');

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
  •