Results 1 to 24 of 24

Thread: InPin to fast

  1. #1
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default InPin to fast

    I added a wait in InPin,in my version to compensate for lag....


  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Hey I noticed this aswell as the one where sometimes it types the username and password in the Username box and never logs you in unless you disable it and login manually or restart the script.
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    We shouldn't just be using a wait..? Do we not check to see if the numbers have moved? :x

    I'll make a change and post it.

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Uh, the numbers are all client-side (until you fill all four - then it sends to the RS server). Unless your computer is lagging bad, it shouldn't have any issues. But more failsafes are always nice.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  5. #5
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Just increase the wait.. I even commented that line so it should be easy to understand what to do if it was too fast / slow

  6. #6
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Why just increase the wait? :x The most logical thing to do, in my opinion, is just to do something easy like make a TPA of the first found yellow point in each box and then if that TPA has changed, the numbers have been updated. That would only add a few lines and would make it so lag doesn't matter.

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Why just increase the wait? :x The most logical thing to do, in my opinion, is just to do something easy like make a TPA of the first found yellow point in each box and then if that TPA has changed, the numbers have been updated. That would only add a few lines and would make it so lag doesn't matter.
    Sounds like a good idea

  8. #8
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Why just increase the wait? :x The most logical thing to do, in my opinion, is just to do something easy like make a TPA of the first found yellow point in each box and then if that TPA has changed, the numbers have been updated. That would only add a few lines and would make it so lag doesn't matter.
    Okay, and what if the numbers end up in the same position as before? I've seen it happen...
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  9. #9
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Doesn't have a little set of four characters that change when you put in a number? Use that.

  10. #10
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    The text saying "Please click the first number" or w/e changes for each number ("second", "third", "forth"). So we can use that.

  11. #11
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I just haven't been on windows long enough this whole time to do this. A CountColor would be all you'd need.

  12. #12
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    It was a simple fix:
    Simba Code:
    function InPin(Pin: string): Boolean;
    var
      Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer;
      Boxes: array of TBox;
    begin
      Result := False;
      if not PinScreen then Exit;

      if (GetNumbers(Pin) <> Pin) then
      begin
        srl_Warn('InPin', '''' + Pin + ''' is not a valid Pin', warn_AllVersions);
        Exit;
      end;
      if (Length(Pin) <> 4) then
      begin
        srl_Warn('InPin', 'Pin must be 4 digits long', warn_AllVersions);
        Exit;
      end;

      Boxes := [IntToBox(37, 107, 100, 170), IntToBox(127, 107, 190, 170), IntToBox(217, 107, 280, 170), IntToBox(307, 107, 370, 170),
                IntToBox(37, 179, 100, 242), IntToBox(127, 179, 190, 242), IntToBox(217, 179, 280, 242),
                IntToBox(37, 251, 100, 314), IntToBox(127, 251, 190, 314), IntToBox(217, 251, 280, 314)];

      while PinScreen do
      begin
        for I := 1 to 4 do
        begin
          if not PinScreen then Break;

          ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10);
          // Counts the "Now click the NUM_X digit.". This is used later on.

          GetMousePos(X, Y);
          if (FindText(Tx, Ty, Pin[I], UpChars, 30, 100, 383, 319)) then
          begin
            H := High(Boxes);
            for J := 0 to H do
              if IntInBox(Tx, Ty, Boxes[J]) then
              begin
                with Boxes[J] do
                  if PinScreen then
                    MouseBox(x1, y1, x2, y2, 1);
                Break;
              end;
          end else
          begin
            H := High(Boxes);
            for J := 0 to H do
              if IntInBox(X, Y, Boxes[J]) then
              begin
                with Boxes[J] do
                  if PinScreen then
                    MouseBox(x1, y1, x2, y2, 1);
                Break;
              end;
          end;

          Wait(100);
          while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do
            Wait(500);

          if BankScreen then
          begin
            Result := True;
            Exit;
          end;
        end;

        WaitFunc(@BankScreen, 50, 300);

        ClickContinue(True, True);
        while not FindColor(Tx, Ty, 0, 7, 460, 69, 474) do
        begin
          Wait(500);
          if not LoggedIn then
            Exit;
        end;
        Inc(Tries);

        if Tries > 2 then
        begin
          srl_Warn('InPin', '''' + Pin + ''' is not the correct Pin', warn_AllVersions);
          ClosePinScreen;
          Exit;
        end;

      end;
      Result := BankScreen;
    end;

    E: diff:
    Code:
    mar 15 18:28:37 2011
    @@ -115,7 +115,7 @@
     *******************************************************************************}
     function InPin(Pin: string): Boolean;
     var
    -  Tx, Ty, X, Y, H, I, J, Tries : Integer;
    +  Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer;
       Boxes: array of TBox;
     begin
       Result := False;
    @@ -141,6 +141,10 @@
         for I := 1 to 4 do
         begin
           if not PinScreen then Break;
    +
    +      ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10);
    +      // Counts the "Now click the NUM_X digit.". This is used later on.
    +
           GetMousePos(X, Y);
           if (FindText(Tx, Ty, Pin[I], UpChars, 30, 100, 383, 319)) then
           begin
    @@ -166,7 +170,9 @@
               end;
           end;
     
    -      Wait(200+Random(100)); // Had to add a wait here because humans aren't that fast.
    +      Wait(100);
    +      while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do
    +        Wait(500);
     
           if BankScreen then
           begin
    @@ -1243,4 +1249,4 @@
         end else
         Writeln('Could not find the deposit box');
       end;
    -end;
    \ No newline at end of file
    +end;
    Last edited by Zyt3x; 03-15-2011 at 10:55 PM.

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

    Default

    I just changed the wait(200+random(100)) to wait(400+random(300)), not because my computer was lagging, but it was too quick to seem human and sometime after clicking the fourth number, it'd go to click the first number again thinking the pin screen stayed open from entering the wrong pin. So the extra 200 ms helped make it not do that for me and looks more human in my opinion between clicking numbers.

  14. #14
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Yeah I have the same problems with this as well. I think the smartest fix for this is to get rid of the wait between inputting the different pin numbers, and instead go by the pin number displayed at the top of the screen. ("...Choose the SECOND number...") That way we know we're ready to click the next number.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


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

    Default

    Quote Originally Posted by ggzz View Post
    Hey I noticed this aswell as the one where sometimes it types the username and password in the Username box and never logs you in unless you disable it and login manually or restart the script.
    This was fixed the other day.

    Also, has anyone tested Zyt3x's fix?

  16. #16
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I'm going to give Zyt3x's a shot soon, I'll have to simulate some lag to see if it really is a fix. I suppose loading multiple youtube videos would do the trick. I'll let ya know after wards how it turns out.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


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

    Default

    Quote Originally Posted by Flight View Post
    I'm going to give Zyt3x's a shot soon, I'll have to simulate some lag to see if it really is a fix. I suppose loading multiple youtube videos would do the trick. I'll let ya know after wards how it turns out.
    Lol okay great, thanks.

  18. #18
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Baked0420 View Post
    I just changed the wait(200+random(100)) to wait(400+random(300)), not because my computer was lagging, but it was too quick to seem human and sometime after clicking the fourth number, it'd go to click the first number again thinking the pin screen stayed open from entering the wrong pin. So the extra 200 ms helped make it not do that for me and looks more human in my opinion between clicking numbers.
    This has been an issue for years for me with my slower machines/bandwidth, and this has always been my quick and easy fix, but Thank You to everyone else who went above and beyond to make sure proper fail-safes were in order.

    ~RAM


  19. #19
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Zyt3x's worked fine for me, I'm not really sure what what the changes were that he made, and I couldn't really 'lay' on a heavy amount of lag at the time, but it worked successfully when I tried.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  20. #20
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Zyt3x's worked fine for me, I'm not really sure what what the changes were that he made, and I couldn't really 'lay' on a heavy amount of lag at the time, but it worked successfully when I tried.
    I added a color check to make sure that the client had updated before it clicked a number

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

    Default

    What Zytex did was what I was thinking. I personally don't like to rely on 'waits' to continue a function. Always good to have a repeating loop of a wait to confirm the next step.
    (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.

  22. #22
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    What Zytex did was what I was thinking. I personally don't like to rely on 'waits' to continue a function. Always good to have a repeating loop of a wait to confirm the next step.
    Quote Originally Posted by Flight
    Yeah I have the same problems with this as well. I think the smartest fix for this is to get rid of the wait between inputting the different pin numbers, and instead go by the pin number displayed at the top of the screen. ("...Choose the SECOND number...") That way we know we're ready to click the next number.
    @Zyt3x: Smart I was gonna suggest using the OCR to grab the text at the top of the pin screen(that tells you which number order you're on), and going from there.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  23. #23
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    @Zyt3x: Smart I was gonna suggest using the OCR to grab the text at the top of the pin screen(that tells you which number order you're on), and going from there.
    Yes, that would work too
    The only reason why I didn't do that was because I though it was kind of over-doing it, as you already know what order the pin numbers will be entered, so we don't really have to rely on the OCR

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

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
  •