Results 1 to 17 of 17

Thread: AntiRandom - Exploding Rock.

  1. #1
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default AntiRandom - Exploding Rock.

    Code:
    procedure P07_FindRockBomb;
    var
      tpa: TPointArray;
    begin
        SetColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.14, 0.51);
        FindColorsTolerance(tpa, 6190211, 217 , 127, 329, 228, 19);
        SetColorToleranceSpeed(1);
        SetColorspeed2Modifiers(0.2, 0.2);
        if Length(tpa) > 70 then
        begin
              MMouse(P07_MMCX,P07_MMCY,1,1);
              wait(95);
              ClickMouse2(mouse_left);
              wait(RandomRange(35000,60000));  // Edit this as you please.
        end;
    end;
    Last edited by speedster; 03-01-2013 at 01:40 AM.

  2. #2
    Join Date
    Feb 2013
    Location
    Liverpool, England
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    rep+

  3. #3
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by keerit View Post
    rep+
    This.

  4. #4
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by speedster View Post
    Code:
    procedure P07_FindRockBomb;
    var
      tpa: TPointArray;
    begin
        SetColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.14, 0.51);
        FindColorsTolerance(tpa, 6190211, 217 , 127, 329, 228, 19);
        SetColorToleranceSpeed(1);
        SetColorspeed2Modifiers(0.2, 0.2);
        if Length(tpa) > 65 then
        begin
              MMouse(P07_MMCX,P07_MMCY,1,1);
              wait(95);
              ClickMouse2(mouse_left);
              wait(RandomRange(35000,60000));  // Edit this as you please.
        end;
    end;
    Also, just forgot the second bracket on wait(RandomRange(35000,60000)), otherwise perfect!

  5. #5
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Thank you word, missed that Added the random range within this post, didn't compile it
    Il do more anti randoms when i get em this one was really annoying lol it broke me too many pickaxes lol

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Not reliable, it would be better to combine pixel shift and a what I call double TPA, Example:

    Simba Code:
    function Bank: Boolean;
    var
      i, CTS, c, Timeout: Integer;
      TPA, TPA1, TPA2: TPointArray;
      ATPA: T2DPointArray;
      P: TPoint;
    begin
      Result := False;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      Timeout := 5000 + Random(1000);
      SetColorSpeed2Modifiers(BankHue_1, BankSat_1);
      FindColorsTolerance(TPA1, BankCol_1, MSX1, MSY1, MSX2, MSY2, BankTol_1);
      SetColorSpeed2Modifiers(BankHue_2, BankSat_2);
      FindColorsTolerance(TPA2, BankCol_2, MSX1, MSY1, MSX2, MSY2, BankTol_2);
      SetColorSpeed2Modifiers(0.2, 0.2);
      ColorToleranceSpeed(CTS);
      CombineTPAWrap(TPA1, TPA2, TPA);
      SplitTPAWrap(TPA, 5, ATPA);
      SortATPASize(ATPA, True);
      if Length(TPA) < 1 then
        Exit;
      for i := 0 to High(ATPA) do
        if Length(ATPA[i]) > 30 then
        begin
          P := MiddleTPA(ATPA[i]);
          HumanMMouse(P.X, P.Y, RandomRange( - 5, 5), RandomRange( - 5, 5));
          if (P07_IsUpTextMultiCustom(['Use', 'Bank', 'ooth'])) then
          begin
            case LowerCase(ClickMethod) of
              'booth':
                Begin
                  RandomLeftClick;
                  clickmouse2(mouse_Right);
                  RandomChooseWait;
                  P07_ChooseOptionMultiHuman(['Use-q']);
                  RandomBankWait;
                  While (IsMoving) Do
                  FastWait;
                  If Not P07_BankScreen Then
                  Begin
                    Bank;
                  End;
                 Exit;
                End;
              'chest':
                Begin
                  RandomRightClick;
                  clickmouse2(mouse_Left);
                  Wait(RandomRange(100, 700));
                  RandomBankWait;
                  While (IsMoving) Do
                  FastWait;
                  If Not P07_BankScreen Then
                  Begin
                    Bank;
                  End;
                 Exit;
                End;
            End;
            Exit;
        End;
      End;
    End;

    It uses 2 colors for sharp object detection but if this works then it would be ok temporarily

  7. #7
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by speedster View Post
    Thank you word, missed that Added the random range within this post, didn't compile it
    Il do more anti randoms when i get em this one was really annoying lol it broke me too many pickaxes lol
    No problem, you did all the hard work, haha! I'm working on a few myself, but just the combat ones which seem to be simpler so far!

  8. #8
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Well your method would use a ton more CPU power - specially for a function which should be used quite often to check for randoms - you don't have that much time to react either., and I agree there is one bug for this thing, come in some sort of gray armor, but so far it doesn't take in to account Iron or Steel, so I don't know what else would be there to break it. Also pixelshift would have to scan the entire area around the character

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

    Default

    That's a good start mate! Indeed there's multiple ways to go about this.

    If it were me I'd use a combination of color and, like rjj95 said, pixelshift, to first detect the gas rock. Then probably walking within a couple of tiles, waiting until we've stopped moving, find that gas rock again, and wait until the color/pixelshift of the 'gas' has gone. It's much better than a static wait of X seconds.

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


  10. #10
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by speedster View Post
    Well your method would use a ton more CPU power - specially for a function which should be used quite often to check for randoms - you don't have that much time to react either., and I agree there is one bug for this thing, come in some sort of gray armor, but so far it doesn't take in to account Iron or Steel, so I don't know what else would be there to break it. Also pixelshift would have to scan the entire area around the character
    Pixel shift only takes around 50-100 ms lol

  11. #11
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    I still have no idea how pixelshift would work : If pixelshift > number => scan for color ? wait until color or pixelshift disappears.

    And i put a simple randomrange because I didn't want my script to use any more of my cpu power. A simple wait will do the trick taken someone could time how long the exploding gas lasts.

    And yes 50-100Ms, which should be checked every few miliseconds while mining (swinging pickaxe) causing a ton of lag. It might not be much if you are running a single script. I will take in to consideration and try to see how it would work with pixelshift, but so far this has worked for me for the past 2 hours
    Last edited by speedster; 03-01-2013 at 12:59 AM.

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

    Default

    Quote Originally Posted by speedster View Post
    I still have no idea how pixelshift would work > If pixelshift > number => scan for color ? wait until color or pixelshift disappears.

    And i put a simple randomrange because I didn't want my script to use any more of my cpu power. A simple wait will do the trick taken someone could time how long the exploding gas lasts.

    And yes 50-100Ms, which should be checked every few miliseconds while mining causing a ton of lag. It might not be much if you are running a single script. I will take in to consideration and try to see how it would work with pixelshift, but so far this has worked for me for the past 2 hours
    I know this tutorial isn't directly related to what you're trying to do here but it should aid you in figuring out how pixelshift works:
    http://villavu.com/forum/showthread.php?t=74090

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


  13. #13
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Thanks Will check it out - I will probably personalize my version to search within a dynamic box based on the tpa which is mined, that should save up a lot of cpu and time

    Still thinking on how to add pixelshift to the function so to work with any other kind of mining. There are usually a lot of pixels shifting around the player to scan the entire area around.
    Last edited by speedster; 03-01-2013 at 01:39 AM.

  14. #14
    Join Date
    Jan 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I use pixelshift in a very small location that the mining animation can't reach.

    If there is gas, the result is almost always 360.

    Works perfectly for me/

  15. #15
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    What do you do when you have different angles and multiple rocks that need to be mined? You need to identify that small location dynamically which would be quite hard to achieve.

  16. #16
    Join Date
    Mar 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thank you very much for this

  17. #17
    Join Date
    Jun 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank god

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
  •