Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: Reward Box Solver

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

    Default Reward Box Solver

    I wrote some reward box functions:

    It now looks for specific text, and will click that option. It will scroll through the scroll bar, if it doesn't find the item you want. It will pick the mystery box!

    SCAR Code:
    var
      SRL_RewardOption: String;

    // Finds the option using TPA Text, returns the corresponding box.
    function _FindOption(var Box: TBox): Boolean;

    var
      x, y, I, H: Integer;
      Text, TPA, xTPA: TPointArray;
      ATPA: T2DPointArray;
      Scroll: Boolean;

    begin
      Scroll := FindTextTPA(2070783, 3, Msx1, msy1, msx2, msy2, 'croll', StatChars, Nothing);
      Text := LoadTextTPA(SRL_RewardOption, UpChars, H);
      FindColorsTolerance(TPA, 2070783, 35, 69, 362, 311, 3);
      Result := FindTextTPAInTPA(H, Text, TPA, xTPA);
     
      if (not Result) and Scroll then
      begin
        x := RandomRange(371, 384);
        y := RandomRange(304, 317);

        MMouse(x, y, 0, 0);
        Wait(RandomRange(30, 60));
       
        HoldMouse(x, y, True);
        while (not FindColorTolerance(x, y, 657930, 374, 295, 380, 302, 3)) and (not Result) do
        begin
          if not LoggedIn then Exit;
          Wait(RandomRange(40, 50));
          FindColorsTolerance(TPA, 2070783, 35, 69, 362, 311, 3);
          Result := FindTextTPAInTPA(H, Text, TPA, xTPA);
        end;
        ReleaseMouse(x, y, True);
      end;

      if not Result then
      begin
        Text := LoadTextTPA('box', UpChars, H);
        Result := FindTextTPAInTPA(H, Text, TPA, xTPA);
      end;

      if not Result then Exit;
       
      FindColorsTolerance(TPA, 2634297, 35, 69, 362, 311, 3);
      ATPA := TPAToATPAEx(TPA, 147 + Integer( Scroll) * 2, 62 + Integer( Scroll) * 2);
      SortATPAFrom(ATPA, xTPA[0]);
      Result := True;
      Box := GetTPABounds(ATPA[0]);
    end;

    // Waits until the Reward Screen Appears.
    function _WaitForRewardScreen: Boolean;

    var
      Text, TPA: TPointArray;
      Height, Time: Integer;

    begin
      Result := False;
      Text := LoadTextTPA('hoose', UpChars, Height);
      Time := GetTimeRunning + 2000;
      FindColorsTolerance(TPA, 2070783, 185, 34, 327, 50, 3);
      while not Result and (GetTimeRunning < Time) do
      begin
        Wait(RandomRange(80, 100));
        FindColorsTolerance(TPA, 2070783, 185, 34, 327, 50, 3);
        if Length(TPA) > 10 then
          Result := FindTextTPAinTPA(Height, Text, TPA, TPA);
      end;
    end;

    // Finds the box in the inventory using a TPA
    function _FindRewardBox(var fx, fy: Integer): Boolean;

    var
      I, Tol: Integer;
      B: TBox;
      TPA: TPointArray;
     
    begin
      Result := False;
      if not LoggedIn then
      begin
        fx := 0;
        fy := 0;
        Exit;
      end;
      GameTab(4);
      Tol := GetColorToleranceSpeed;
      try
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.02, 0.11);
        for I := 1 to 28 do
        begin
          B := InvBox(I);
          if FindColorsTolerance(TPA, 5574780, b.x1, b.y1, b.x2, b.y2, 13) then
            Result := High(TPA) >= 250;
          if Result then
          begin
            MiddleTPAEx(TPA, fx, fy);
            Exit;
          end;
        end;
        fx := 0;
        fy := 0;
      finally
        ColorToleranceSpeed(Tol);
        SetColorSpeed2Modifiers(0.2, 0.2);
      end;
    end;
     
    // Opens the Box at fx, fy. Gets the reward presented by the global var.
    function _UseRewardBox(fx, fy: Integer): Boolean;

    var
      Time: Integer;
      TPA: TPointArray;
      B: TBox;

    begin
      Result := False;
      if (fx = 0) or (fy = 0) then Exit;

      MMouse(fx, fy, 5, 5);
      Wait(RandomRange(80, 100));
      if IsUpText('event gift') then
      begin
        GetMousePos(fx, fy);
        Mouse(fx, fy, 0, 0, True);
        if not _WaitForRewardScreen then
        begin
          SRL_Warn('OpenRewardBox', 'Could not open Reward Screen', Warn_AllVersions);
          Exit;
        end;
        Wait(Random(100));
        if not _FindOption(B) then
        begin
          SRL_Warn('UseRewardBox', 'Could not find a usable option.', Warn_AllVersions);
          Exit;
        end;
        MouseBox(B.x1, B.y1, B.x2, B.y2, 1);
        Time := GetTimeRunning + 500;
        while (not Result) and (GetTimeRunning < Time) do
        begin
          FindColorsTolerance(TPA, 1317148, B.x1,  B.y1, B.x2, B.y2, 3);
          Result := Length(TPA) > 50;
        end;
        if not Result then
        begin
          CloseWindow;
          Exit;
        end;
        Mouse(393, 166, 77, 39, True);
      end;
    end;

    Use:
    SCAR Code:
    var
      SRL_RewardOption: String;

      SRL_RewardOption := 'XP';
     
      //... Somewhere in SetupSRL ...
      if SRL_RewardOption = '' then SRL_RewardOption := 'ystery box';
      //...

      if _FindRewardBox(fx, fy) then
        _UseRewardBox(fx, fy);

    Please test this..

    Comments tell how it works, I want some feeeeeedback!
    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

  2. #2
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    If you got the boxes from frog tokens then yeah your prizes suck. But I have seen stuff like 2 grimmy kwuarms being offered which is much much more then 700 odd coins. I have also seen 40 pure ess and the such. I was thinking maybe a system could get all the item names and the amount and find which is the best profit.

  3. #3
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

  4. #4
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    wow I didn't know there could be that many options but apparently Nava2 didn't either. So I guess he'll have to update his solver. Nava2, watch that video then see if you can adjust your solver, in the video the person had like 10 choices, there was a scroll bar for when there's more then 6. I forget hwo many they exactly had but it was quite a few.

  5. #5
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Default

    Big update, uses Text now.

    I need an account with a scroll bar.

    Help me help you
    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

  7. #7
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    ... i have pics of scroll bar...
    1
    2
    3

  8. #8
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'd suggest doing this..
    (not gonna do exact coding cuz I'm lazy and watching Talladega Nights xD)

    SCAR Code:
    _UseRewardBox(var x, y: integer; item: string);
    begin
    if(FindItem('sandwhich'))then
      Mouse(x, y, 2, 2, true);
      end else
      if(FindDTM(DownArrowDTM))then
        HoldMouse(params?);
        Wait(TimeBeforeNextLayer);
        ReleaseMouse(params?);
    ....

    hopefully that makes sense.. and then look for the item, then GetColor of scroll bar at the bottom, and if it's not the scroll bar color, go down again, and yeah..

  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    umm... 99 why would you want the sandwich, i personally would like either the exp or the gp... that would be what i would make it choose everytime... if no exp then choose the gp

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I used sandwich because I was just looking at a sandwich solver

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

    Default

    Those pics should be enough.

    I will work on it tomorrow I think.
    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

  12. #12
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    umm... 99 why would you want the sandwich, i personally would like either the exp or the gp... that would be what i would make it choose everytime... if no exp then choose the gp
    Why would you ever want the GP is beyond me. The chaos runes, pure essence, coal, mithril ore and sapphires all make you more money. (I would personally pick the EXP every time however)

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

    Default

    Quote Originally Posted by Capricorn View Post
    Why would you ever want the GP is beyond me. The chaos runes, pure essence, coal, mithril ore and sapphires all make you more money. (I would personally pick the EXP every time however)
    There isn't always xp.

    Uhm, using the GE to get the price of certain things would be EXTREMELY slow, and not really worth it.
    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

  14. #14
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    No it wouldn't it only takes 400msec to get the price of something, then multiplying it by the quantity.

    Good Job, I made a crappier one a few days ago

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

    Default

    That is a lot...
    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

  16. #16
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    A human takes around about 1 - 2 seconds to respond and click, he won't do it in 400 msec, unless he isn't thinking.
    You have how many, 4 items, 4 * 400msec, just 1.6 seconds. Quite a short bit of time but it would be worth it.

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

    Default

    Oh, also. On that note, SRL doesn't use any functions which connect to the RuneScape website.

    The idea is nice, but it can also take a few seconds depending on the connection speed, as well, if you wanted it. Just write your own for your scripts.

    If it is allowed, I can reverse engineer my bank valuer to use it!
    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
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    But isnt the valuer reflection?
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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

    Default

    Quote Originally Posted by noidea View Post
    But isnt the valuer reflection?
    It is, but the price getter is in just scar language.

    Here is the functions which get the prices..

    SCAR Code:
    function GetMarketValue(var T: TBS) : string;

    var
      Name : string;
      I : Integer;

    begin
      if (T.Name = 'Members object') and (CheckMembersObjects = True) then
      begin
        Result := GetPage('http://itemdb-rs.runescape.com/viewitem.ws?obj=' + IntToStr(T.ID));
        Delete(Result, 1, 15130);
        Name := Copy(Result, 1, PosEx(#10, Result, 2) - 1);
        if Pos('not found', Name) = 0 then
          T.Name := Name
        else
          T.Name := '-= ??? =-';
        Delete(Result, 1, 270);
        Delete(Result, 1, Pos('Mark', Result) + 17);
        Delete(Result, Pos('</', Result) - 1, Length(Result));
        if Length(Result) > 20 then
        begin
          Result := '';
          Exit;
        end;
      end else
      begin
        Name := Replace(T.Name, ' ', '_');
        for I := 0 to 2 do
          if Pos('_' + IntToStr(100 - 25 * I), Name) <> 0 then
          begin
            Delete(Name, Pos('_' + IntToStr(100 - 25 * I), Name), Length(Name));
            Break;
          end;
        Result := GetPage('http://rscript.org/lookup.php?type=ge&search=' + Name);
        if InIntArray([53, 73], Length(Result)) or ((Pos(IntToStr(T.ID), Result) = 0) and (Pos(IntToStr(T.ID - 1), Result) = 0)) then
        begin
          Result := '';
          Exit;
        end;
        Result :=Between(Name + ' ', ' ', Result);
      end;
      Result := Replace(Result, ',', '');
    end;
    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

  20. #20
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    You could create a database, have it make a .ini. And everytime you start a script setupSRL can take 10-15 seconds at the start of the script to update its prices in the .ini file and only if its been longer then say 24 hours. How many items can these boxes give? Essences, runes and ores, some bars. I believe this idea can go somewhere.

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

    Default

    It can, but it wouldn't go into SRL. There was a rule set into place that NOTHING can connect to the RuneScape website.

    Edit: Added scroll bar functionality.

    Just needs to be tested now
    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

  22. #22
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Oh well, you could always put it on the site - I am sure lots would find it useful for it to pick the most valued option.

  23. #23
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't see the point of this, you could just drop the box...

    Anyway, nice solver.
    lol

  24. #24
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Quickmarch View Post
    I don't see the point of this, you could just drop the box...

    Anyway, nice solver.
    That would be a waste, and rather un-human.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Quote Originally Posted by Wizzup? View Post
    That would be a waste, and rather un-human.
    Omg. He posted.

    *faps*

    Anyways...
    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

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. LMAO look AT THIS AD! REWARD: REP 4 U!
    By P1nky in forum Semi Stupid Pictures
    Replies: 14
    Last Post: 03-27-2008, 09:02 PM
  2. OMFG I need help!! -- 100k reward!
    By brendon in forum News and General
    Replies: 25
    Last Post: 08-09-2007, 06:00 PM
  3. [REWARD]Lumby Swamp Miner
    By Zika in forum RS3 Outdated / Broken Scripts
    Replies: 7
    Last Post: 04-08-2007, 07:39 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
  •