Results 1 to 18 of 18

Thread: GetXP fix

  1. #1
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default GetXP fix

    It wasn't working due to the defined search area for the text. Since where the window pops up is pretty random, I changed it to search the inventory for the 'urrent' text.

    SCAR Code:
    {*******************************************************************************
    function GetXP(Skill: Variant): Integer;
    By: Nielsie95
    Description: Returns current xp for a skill. Returns -1 if failed.
    *******************************************************************************}


    function GetXP(Skill: Variant): Integer;
    var
      p: TPoint;
      tx, ty, x, y: Integer;
    begin
      Result := -1;
      if (not TabExists(tab_Stats)) then exit;
      GameTab(tab_Stats);
      if (GetCurrentTab <> tab_Stats) then exit;
      P := SkillToCoords(True, Skill);
      if (P.x < 1) then exit;
      MMouse(P.x, P.y + 5, 12, 4);
      if (not WaitFindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2, 0, 4000)) then exit;
      Wait(200 + Random(150));
      if IsTextInAreaEx(MIX1, MIY1, MIX2, MIY2, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
        Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end;
    There may be a better way to do it, but this works.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    It worked fine for me without a fix.
    There used to be something meaningful here.

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    It worked fine for me without a fix.
    What skill did you do? I did Woodcutting and every time it would return -1.

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Attack, worked fine :/
    There used to be something meaningful here.

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Try one of the lower skills (Woodcutting, Slayer, etc), the ones that when hovered, the xp box appears above the mouse rather than below.

    E: I've been testing the current version more, and it seems to work ~70ish% of the time, else it will return -1.
    Last edited by Coh3n; 03-28-2010 at 09:09 PM.

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Try one of the lower skills (Woodcutting, Slayer, etc), the ones that when hovered, the xp box appears above the mouse rather than below.

    E: I've been testing the current version more, and it seems to work ~70ish% of the time, else it will return -1.
    Yes, I have been experiencing this same problem alot lately. Mostly using SMART.
    There used to be something meaningful here.

  7. #7
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Does a box not pop up? Why not search for the box using a find colour, thus you have the top left corner, then you could do some math, perhaps another find colour to create a box to search for text in.

    Theoretically would be faster than doing text searching, as it has a tendency to be slow.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Does a box not pop up? Why not search for the box using a find colour, thus you have the top left corner, then you could do some math, perhaps another find colour to create a box to search for text in.

    Theoretically would be faster than doing text searching, as it has a tendency to be slow.
    The box pops up but it cant read the text correctly.
    There used to be something meaningful here.

  9. #9
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Does a box not pop up? Why not search for the box using a find colour, thus you have the top left corner, then you could do some math, perhaps another find colour to create a box to search for text in.

    Theoretically would be faster than doing text searching, as it has a tendency to be slow.
    Love that idea.

  10. #10
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    The box pops up but it cant read the text correctly.
    I'm not saying to read from that point, but to find the point from there.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    I'm not saying to read from that point, but to find the point from there.
    I was answering to your question
    Does a box not pop up?
    There used to be something meaningful here.

  12. #12
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    I was answering to your question
    I'm confused, does a box pop up, but the text inside the box cannot be read?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  13. #13
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    I'm confused, does a box pop up, but the text inside the box cannot be read?
    Yes, the text reading part fails.
    There used to be something meaningful here.

  14. #14
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Yes, the text reading part fails.
    Oh okay, it probably means that the coords are off. Which makes sense as they require them to be top left I believe.

    Either way, its arbitrary to fix that issue. Kinda comes with the new process
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  15. #15
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Oh okay, it probably means that the coords are off. Which makes sense as they require them to be top left I believe.

    Either way, its arbitrary to fix that issue. Kinda comes with the new process
    Do you (or anyone else) plan on making what you described above? or can I have some fun?

  16. #16
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Do you (or anyone else) plan on making what you described above? or can I have some fun?
    Isn't that what the original function did? All I did was change where it looked for the text. I'm pretty sure before, it looked from the top left corner of the "popup" box to something like halfway down it (or wherever the text ends).

  17. #17
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Go NCDS Go!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  18. #18
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Isn't that what the original function did? All I did was change where it looked for the text. I'm pretty sure before, it looked from the top left corner of the "popup" box to something like halfway down it (or wherever the text ends).
    Hmmm..I guess so. I never really looked at the original function I guess.

    What Nava was explaining just sounded fun

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
  •