Results 1 to 8 of 8

Thread: ScrollFriends (antiban option)

  1. #1
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Post ScrollFriends (antiban option)

    After deciding to put my main script (a Wood Cutter/Burner) on hold due to being a nooby programmer, I decided to review all the beginner tutorials to freshen up on my statements, usage, techniques, etc. When I was all done and had a more clear understanding of SRL, I thought "Okay, so I'mma test myself by making an antiban feature." I was actually very impressed with myself, seeing as I had very little knowledge of programming in general. Some of you may say "Wow, I can do that in ten minutes." Well you know what? .. :P

    Anyway.. I came up with an antiban feature that scrolls through your friends list (by looping a click+hold and a wait) with a few custom options:
    -Boolean for checking a friend's previous name, if the name-change icon is found
    -% chance to break out of the 'scroll down' loop
    -% chance to check a random name-change (if the boolean is true, of course)

    Here's the snippet:
    Simba Code:
    procedure ScrollFriends(Check: Boolean; BreakChance, CheckChance: Integer);
    var
      startTab, startMS, a, b, c, xx, yy: Integer;
      exists: TPointArray;
      d: Boolean;
    begin

      startTab := GetCurrentTab;
      startMS  := MouseSpeed;
      a        := BreakChance;
      b        := CheckChance;

      if (CheckChance > 95) then
      begin
        Writeln('ScrollFriends: Please don''t use a chance higher than 95, it''ll likely just keep mousing over every name.');
        Writeln('ScrollFriends: Setting chance to 95% for now.');
        b := 75;
      end;

      GameTab(tab_Friends);
      Wait(RandomRange(500, 1500));

      MouseSpeed := 10;

      if not (FindColor(xx, yy, 8231332, MIX1, MIY1, MIX2, MIY2)) then
      begin
        MouseSpeed := startMS;
        GameTab(startTab);
        Writeln('ScrollFriends: This antiban would be useless on this account, as it has no friends.');
        Exit;
      end;

      if not (Check) then
      if (GetColor(728, 473-50) = 526601) then
      begin
        MMouse(729, 483-50, 2, 2);
        GetMousePos(xx, yy);
        repeat
          HoldMouse(xx, yy, 1);
          Wait(RandomRange(250, 750));
          ReleaseMouse(xx, yy, 1);
          Wait(RandomRange(750, 2250));
          Case Random(100) of
            0..(a-1):
              begin
                Break;
              end;
          end;
        Until not (GetColor(728, 473-50) = 526601);
      end;

      if (GetColor(728, 473-50) = 526601) and (Check) then
      begin
        MMouse(729, 483-50, 2, 2);
        GetMousePos(xx, yy);
        repeat
          d := False;
          HoldMouse(xx, yy, 1);
          Wait(RandomRange(250, 750));
          ReleaseMouse(xx, yy, 1);

          Wait(RandomRange(750, 2100));

          Case Random(100) of
            0..(b-1):
              begin
                if FindColor(xx, yy, 9654281, MIX1, MIY1+100, MIX2, MIY2-10) then
                begin
                  FindColorsTolerance(exists, 9654281, MIX1, MIY1+100, MIX2, MIY2-10, 15);
                  c := Random(GetArrayLength(exists));

                  MoveMouse(exists[c].x+(RandomRange(20, 50)), exists[c].y);

                  Wait(RandomRange(2500, 3800));

                  d := True;
                end;
              end;
          end;

          Case Random(100) of
            0..(a-1): Break
          end;

          if (d) then
          begin
            MMouse(729, 483-50, 2, 2);
            GetMousePos(xx, yy);
          end;
        until (not (GetColor(728, 473-50) = 526601));
      end;

      FindColors(exists, 3911923, MIX1, MIY1, MIX2, MIY2);
      c := Random(GetArrayLength(exists));

      MouseSpeed := 15;
      DragMouse(exists[c].x, exists[c].y, 1, 1, 706, 273-50, 20, 20);

      Wait(RandomRange(250, 500));

      MouseSpeed := startMS;
      GameTab(startTab);
      Exit;

    end;

    Usage:
    ScrollFriends(True/False, BreakChance(%), CheckChance(%));
    IE: ScrollFriends(True, 20, 60);

    Please feel free to tweak it any way you please.
    Also, if you have any suggestions for improvement/perfection, do tell!

    NOTE: I don't recommend using this, if you have less than 20 friends on the account, since 16 (or 13?) friends is one page.

    P.S.
    If you'd like a heavily commented version for learning purposes, by all means.. ask.
    Without chaos... There would be no organization.

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

    Default

    That's pretty cool bud, nice job.

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


  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    An antiban function like this would be nice to have.... But I see lots of things that could be improved on before it would be added to the SRL include. But yeah great work!

    E: Sorry didn't realize this was snippets.

  4. #4
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    You should probably add a check for the scroll bar before attempting a scroll.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    You should probably add a check for the scroll bar before attempting a scroll.
    This, I have 4 friends on my bottling main!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  6. #6
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @Flight
    Thanks dude.

    @Nebula
    Anything in particular that you think should be improved or changed?

    @litoris and Footy

    (GetColor(728, 473-50) = 526601) The color is black, and the point is the area at the very bottom of the scrolling space.
    But yeah, I see where you're coming from. I thought about maybe adding functionality for just checking a friend's previous name, if found, but I figured that would be best as a separate function altogether, since this one is so long. Plus, if none of the friends have a name change icon, you'd be better off using just a plain ol' GameTab(tab_Friends); then a Wait(RandomRange(xxxx, xxxx)); afterward. For now, that's why I added "NOTE: I don't recommend using this, if you have less than 20 friends on the account, since 16 (or 13?) friends is one page."

    But I'll definitely update this tomorrow; I've gatta get some sleep now. But, it won't take any more than just a simple copy/paste of "if not (GetColor(728, 473-50) = 526601) then" followed by "if (Check) then" :P
    Without chaos... There would be no organization.

  7. #7
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Well for starters these aren't needed since you could just use Breakchance/Checkchance throughout the script instead of a/b
    a := BreakChance;
    b := CheckChance;

    I don't really want to go into deep detail about every little thing that can be changed. What you have now (probably) works fine, there are just ways to condense it more. As you learn more, you can improve on it.

  8. #8
    Join Date
    Jan 2012
    Location
    In A Farm
    Posts
    3,301
    Mentioned
    30 Post(s)
    Quoted
    444 Post(s)

    Default

    Haha, this is my personal antiban method i do when i check my bots.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •