Results 1 to 12 of 12

Thread: Antiban: MisMouse

  1. #1
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default Antiban: MisMouse

    This is not to be used on antiban on it's own, but rather as a multi threaded anti ban. (eg, misclicking a rock while mining, and then properly clicking it)

    SCAR Code:
    function MisMouse(Target: TPoint; rX, rY: integer; Right: boolean; MouseColor(Yellow, Red, Either)): boolean;
    var
      realX, realY, tx, ty, tt: integer;
      TimeFactor: extended;
    begin
      realX := Random(rX) + Target.x;
      realY := Random(rY) + Target.y;
     
      tx := Random(RMOUSE_X);
      ty := Random(RMOUSE_Y);
      tt := 50 + Random(CLICK_TIME) ;
      Timefactor := tt * 0.1;

      Mouse(realX, RealY, tx, ty, Right);
      wait(tt);
      Mouse(
        Target.x - round(TimeFactor*(realX + tx)),
        Target.y - round(TimeFactor*(realY + ty)),
        Right
      );

      Result := true;

      If MouseColor <> Either then
        if MouseColor = Red then
          if DidRedClick then
            Result := true
          else
            Result := false
       else //MouseColor = Yellow
         if DidYellowClick then
           Result := true
         else
           Result := false;
     
    end;

    Thoughts, comments?

    I could always add the % parameter to make it more user friendly, meaning you'd always call MisMouse instead of mouse, with a % possibility of it misclicking.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

    Default

    SCAR Code:
    Result := True;

      If MouseColor <> Either then
        if MouseColor = Red then
          if DidRedClick then
            Result := true
          else
            Result := false
        else //MouseColor = Yellow
          if DidYellowClick then
            Result := true
          else
            Result := false;
    SCAR Code:
    case MouseColor of
        Either: Result := True;
        Red: Result := DidRedClick;
        Yellow: Result := DidYellowClick;
      end;

  3. #3
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    SCAR Code:
    Result := True;

      If MouseColor <> Either then
        if MouseColor = Red then
          if DidRedClick then
            Result := true
          else
            Result := false
        else //MouseColor = Yellow
          if DidYellowClick then
            Result := true
          else
            Result := false;
    SCAR Code:
    case MouseColor of
        Either: Result := True;
        Red: Result := DidRedClick;
        Yellow: Result := DidYellowClick;
      end;
    Nicely pointed out. Was writing it under inspiration rather than with any specifics in my head, but nicely pointed out.

    Anyway, ideas on its usability?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

    Default

    It's a bit hard to understand just how it works and how random it is by looking at the code, and why is the parameter "Right" instead of "Left" when setting it to True would result in clicking with the left mouse button? Just change it to Left

    I suggest having two MisMosue functions, one that is like it is now and one that has %

  5. #5
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    I suggest having two MisMosue functions, one that is like it is now and one that has %
    Am i going or mad or could you just do

    If Random(100) = 1 Then
    MisMouse;
    Else Mouse(x,y,0,0,True)

    Or am i just mad?
    I see Now, says the blind man

  6. #6
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    It's a bit hard to understand just how it works and how random it is by looking at the code, and why is the parameter "Right" instead of "Left" when setting it to True would result in clicking with the left mouse button? Just change it to Left

    I suggest having two MisMosue functions, one that is like it is now and one that has %
    I don't see the point of having the two of them...

    SCAR Code:
    function MisMouse(Target: TPoint; rx, ry: integer; Left: boolean): boolean
    begin
      Result := MisMousePRCT(0, Target, rx, ry, Left);
    end;

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  7. #7
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by rya View Post
    Am i going or mad or could you just do

    If Random(100) = 1 Then
    MisMouse;
    Else Mouse(x,y,0,0,True)

    Or am i just mad?
    You could, but it's more friendly to have the % as a param. (Less lines of code for the 'normal' scripter to write)

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  8. #8
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    You could, but it's more friendly to have the % as a param. (Less lines of code for the 'normal' scripter to write)

    ~RM
    Is 3 lines of code so much compared to 1??

    and with extra paramenter my way would easyer for some one to read the code that does not know what the parameters are for MisMouse
    I see Now, says the blind man

  9. #9
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by rya View Post
    Is 3 lines of code so much compared to 1??

    and with extra paramenter my way would easyer for some one to read the code that does not know what the parameters are for MisMouse
    Alt + enter?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  10. #10
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    You should just add the %. That's a great idea and seems like it should have been done long ago.

  11. #11
    Join Date
    Oct 2009
    Location
    Connersille, Indiana
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not really good with the scripting as of yet, but I think miss-clicks would be great anti-ban. I miss-click all the time when playing legit so I would definitely use it.

  12. #12
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Are user-made types in Simba/SCAR case sensitive?
    If they are, I suggest changing the MouseColor(Red, Yellow, Either) to lowercase.

    How would you thread this?
    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

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
  •