Results 1 to 11 of 11

Thread: A working GetXP

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

    Default A working GetXP

    I spend awhile trying to get this to work so I could use in my autofighter.
    I started with the original and troubleshot the heck out of it. Finally I got the fix and it works!
    I found out it was reading the 0 as O's and of course not removing the spaces.

    SCAR Code:
    function GetXp2(skill: string): Integer;//Original by Masquerader, edited by Narcle
    var
      textx, texty, XPboxedge, len, x, y, x1, y1, I, II, l, WaitT: Integer;
      xp, Nums, text2, xpis : string;
      t: TPoint;
    begin
      XPboxedge := DTMFromString('78DA635CC2C8C0100CC458004C947131916A8' +
        '250D5FCFFBF0055CD124C3558CD3121600E488D3101739610A9C6' +
        '04BF1A00F7DF0C91');
      Result := -1;
      GameTab(2);
      t := skilltocoords(skill);
      MMouse(t.x, t.y + 12, 5, 5);
      repeat
        WaitT := WaitT+1;
        wait(10);
        if WaitT >= 3000 then exit;
      until findcolor(x, y, 10551295, 554, 205, 743, 465);
      wait(300 + Random(100))
        if FindDtm(XPboxedge, x1, y1, 554, 205, 743, 465) then
        if (istextinareaex(554, 205, 743, 465, textx, texty, 'XP', 0, smallchars, False, True, 0, 2, 0))then;
        begin
         len := (x1 - textx - 22) div 7;
            xp := Trim(gettextatex(textx+22, texty, 5, smallchars, False, False, 0, 3, 0, len, False, tr_AllChars))
            try
              begin
              for l := 1 to Length(xp) do
                begin
                if (xp[l] = 'O') then text2 := text2 + '0' else text2 := text2+ xp[l];
                end;
                Nums := '01234567890';
                for I := 1 to Length(Text2) do
                  begin
                  for II := 1 to 10 do
                    begin
                    if (Copy(text2, I, 1) = Copy(Nums, II, 1)) then
                      xpis := xpis + Copy(Text2, I, 1);
                    end;
                  end;
              end;
              result := strtoint(xpis);
          except
            WriteLn('Failed to get XP');
          end;
          WriteLn(Skill + ' = ' + IntToStr(Result));
        end;
      freeDTM(XPboxedge);
    end;

    Please tell me it works for you! It works for me. >.<
    (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.

  2. #2
    Join Date
    Feb 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, very nice, I've been looking for one of these for a while, I'll defo use it in my script I'm making...

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why!?, j/k ehm why is the old one not working?

  4. #4
    Join Date
    Feb 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dunno why, it just isnt for some reason :S

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

    Default

    Fishing = 1160
    XP = 1160
    The problem is any skill in the first column it wont find.

    SCAR Code:
    function GetXp(skill: string): Integer;
    var
      textx, texty, x1, y1, x2, y2, LeftCorner, RightCorner, len, x, y: Integer;
      xp: string;
      t: TPoint;
    begin
      LeftCorner := DTMFromString('78DA63346164603006622C0026CA684A841A9' +
        '03926449883A6E6FFFF0598E60411614E100173406A8289703301' +
        '3500C6560919');
      RightCorner := DTMFromString('78DA635CC2C8C0100CC458004C947131916A8' +
        '250D5FCFFBF0055CD124C3558CD3121600E488D3101739610A9C6' +
        '04BF1A00F7DF0C91');
      Result := -1;
      GameTab(2);
      t := skilltocoords(skill);
      MMouse(t.x, t.y, 5, 5);
      repeat
        wait(10);
      until findcolor(x, y, 10551295, 550, 212, 736, 465);
      wait(300 + Random(100))
        if ((FindDtm(LeftCorner, x1, y1, 540, 204, 741, 464)) and (FindDtm(RightCorner, x2, y2, 554, 205, 743, 465))) then
        if (istextinareaex(x1, y1, x2, y2, textx, texty, 'XP', 0, smallchars, False, True, 0, 2, 0)) then
        begin
          len := (x2 - textx - 22) div 7
            xp := Trim(gettextatex(textx + 22, texty, 5, smallchars, False, False, 0, 3, 0, len, False, tr_digits))
            try
            Result := StrToInt(xp);
          except
            WriteLn('Failed to get XP');
          end;
          WriteLn(Skill + ' = ' + IntToStr(Result));
        end;
      freedtm(leftcorner);
      freedtm(rightcorner);
    end;

    SRL GetXP fixed.

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

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

    Default

    well when i tested it and had it just return the string not the integer, I had O's where there should of been 0's. This has been working ever since for me in my fighting script.
    (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
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OMG THANKYOU SO MUCH!!

    Im going to use this to check if im infight (failsafe) again

    just get the xp every one and a while. and if it hasnt changed voila.
    ~ Metagen

  8. #8
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice, it works every time! i love it (woopsies double post)
    ~ Metagen

  9. #9
    Join Date
    Jun 2007
    Location
    brooklyn ny
    Posts
    683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cool this should be sick in some scripts

  10. #10
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks!
    Now my Experience per Hour function will work!

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

    Default

    Yep thats why I wanted a working one. I use it in my two fighter scripts, and whatever else I make thats for skill gaining in the future.
    (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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ~~~~Working Edge cooker WORKING~~~
    By NiCbaZ in forum RS3 Outdated / Broken Scripts
    Replies: 5
    Last Post: 10-29-2007, 11:16 PM
  2. getxp...?
    By Runescape Pro in forum OSR Help
    Replies: 9
    Last Post: 10-08-2007, 07:00 AM
  3. GetXP not working?
    By Metagen in forum OSR Help
    Replies: 2
    Last Post: 09-28-2007, 06:34 PM
  4. Replies: 5
    Last Post: 04-25-2007, 09:59 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
  •