Results 1 to 9 of 9

Thread: procedure UseRewardBox: Boolean;

  1. #1
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default procedure UseRewardBox: Boolean;

    SCAR Code:
    {*******************************************************************************
    procedure UseRewardBox: Boolean;
    by: Nava2, Timer
    Description: Finds the reward box, and opens it getting the reward.
    *******************************************************************************}


    function UseRewardBox: Boolean;
    var
      I, Time, Height, fx, fy, Index, bDTM: Integer;
      Text, TPA: TPointArray;
      B: TBox;

    begin
      Result := False;
      if (not LoggedIn) then exit;
      GameTab(tab_Inv);
      if (not(FindColorTolerance(fX, fY, 5510016, MIX1, MIY1, MIX2, MIY2, 20))) then Exit;
      { DTM updated 10th Januray 2010 - marpis }
      bDTM := DTMFromString('78DA63CC61626078C68002DA452219FE03694' +
           '620FE0F048C9940355719D00013986484F2187388509300E4DF23' +
           'A0A69C083520F77C20C2AED704D45400F96FF1AB0100750B108B');
      for I := 1 to 28 do
      begin
        B := InvBox(I);
        if FindItemEx(fx, fy, 'dtm', bDTM, B, []) then
        begin
          InvMouse(I, 3);
          Wait(RandomRange(100, 150));
          Result := IsUpText('ando');
          if (Result) then Break;
        end;
      end;
      FreeDTM(bDTM);
      if (not Result) then exit;

      GetMousePos(fx, fy);
      Mouse(fx, fy, 0, 0, True);

      Result := False;
      Text := LoadTextTPA('hoose', UpChars, Height);
      Time := GetTimeRunning + 10000;
      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;

      if (not Result) then
      begin
        SRL_Warn('OpenRewardBox', 'Could not open Reward Screen', Warn_AllVersions);
        Exit;
      end;
      Wait(Random(100));
      if (not FindBoxOption(B, Index)) then
      begin
        SRL_Warn('UseRewardBox', 'Could not find a usable option.', Warn_AllVersions);
        Exit;
      end;

      Mouse(B.X1, B.Y1, 0, 0, True);
      Time := GetTimeRunning + 2000;
      Result := False;
      while (not Result) and (GetTimeRunning < Time) do
      begin
        FindColorsTolerance(TPA, 1317148, 35, 70, 362, 311, 3);
        Result := Length(TPA) > 50;
        Wait(50 + Random(50));
      end;
      if (not Result) then
      begin
        CloseWindow;
        Exit;
      end;
      MouseBox(413, 171, 469, 200, 1);
      Time := GetSystemTime;
      while (CountColorTolerance(1317148, B.x1 - 10, B.y1 - 10, B.x1 + 10, B.y1 + 10, 3) > 50) and (GetSystemTime - Time < 5000) do
      begin
        if (Pos('thing else', GetChatBoxText(8, clBlack)) > 0) then
        begin
          CloseWindow;
          Wait(500 + Random(500));
          SetLength(RB_SkipArray, Length(RB_SkipArray) + 1);
          RB_SkipArray[High(RB_SkipArray)] := Index;
          Result := UseRewardBox;
          Break;
        end;
        Wait(100 + Random(200));
      end;
      RB_SkipArray := [];
      if (CloseWindow) then
        Result := False;
    end;

    IsUpText cause fail... So yeah here.

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There's a lot of very fatal problems with SRL these days... genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift.... random detection/recovery is pretty shaky too... the solvers work pretty good... but it kinda needs an overhaul

  3. #3
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    There's a lot of very fatal problems with SRL these days... genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift.... random detection/recovery is pretty shaky too... the solvers work pretty good... but it kinda needs an overhaul
    fixing lamp now..

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

    Default

    Quote Originally Posted by IceFire908 View Post
    There's a lot of very fatal problems with SRL these days... genie lamp doesn't work, pretty much all item DTMs that haven't been updated in the past month are broken from the outline color shift.... random detection/recovery is pretty shaky too... the solvers work pretty good... but it kinda needs an overhaul
    Sounds like something for SRL 5.



    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)

  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Sounds like something for SRL 5.
    SRL 4 needs work too, SRL 5 probably won't be around for ages.

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

    Default

    Quote Originally Posted by IceFire908 View Post
    SRL 4 needs work too, SRL 5 probably won't be around for ages.
    Not if I can help it.



    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)

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

    Default

    Timer, what did you even change..
    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
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Timer, what did you even change..
    I think he changed the IsUpText line to Result := IsUpText('ando');

    You can always replace this in your SRL folder then use Diff

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

    Default

    Thats a pain, especially when I do not have SCAR/SRL4 readily available.
    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

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
  •