Results 1 to 2 of 2

Thread: Problem: The script autofocus the Smart Client

  1. #1
    Join Date
    Mar 2012
    Location
    Grambling, LA
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problem: The script autofocus the Smart Client

    Hi,
    I have not used ActivateClient in the script. However, the script autofocuses the Smart Window on each and every loop. Please help me figure out which line causes Smart to activate focus.

    All credit goes to: TwilightSage
    http://villavu.com/forum/showthread.php?p=1008119

    I just modified it for my personal use.

    Simba Code:
    program BodyEssHound;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    {$i srl/srl/misc/paintsmart.simba}

    Const
    World       = 00;   /// Find a world where there is a less populated Law Esshound.
    AttackTimer = 6000; /// Wouldn't touch this unless you know what you're doing.

    Var
    X,Y,TimeGone,K:Integer;
    XPO,XPN,XPH,XP : Double;

    Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;
        Players[0].Name :='';
        Players[0].Pass :='';
        Players[0].Nick :='';
        Players[0].Active:=True;
        Players[0].Pin := '';
      end;

    procedure AntiBan;
      begin
        if(not(LoggedIn))then
            Exit;

        case Random(10000) of
         0: begin
               HoverSkill('Runecrafting', false);
               wait(1987+Random(432));
            end;
         1: PickUpMouse;
         2: begin
               MakeCompass('N');
               wait(100+random(133));
               MakeCompass('S');
               wait(50+random(133));
            end;
         3: RandomMovement;
         4: BoredHuman;
         5: ExamineInv;
         6: RandomRClick;
        end;
      end;

    Procedure IfRandoms;
    Begin
      FindNormalRandoms;
      AntiBan;
    End;


    Function IsAttack: Boolean;
    Var
    CTS: Integer;
    TPA: TPointArray;

    Begin
      CTS := GetColorToleranceSpeed;
      Begin
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.19, 0.85);
        FindColorsSpiralTolerance(x, y, TPA, 14010318, 215, 135, 280, 202, 15);
        ColorToleranceSpeed(CTS);
        result := (Length(TPA) > 0);

        If result Then
          Exit;
      End;
    End;


    Procedure AttackWait;

    Var
    T: Integer;

    Begin
      Marktime(T);
      Repeat
        If IsAttack Then Marktime(T);
        AntiBan;
        IfRandoms;
      Until(TimeFromMark(T) >= AttackTimer)
    End;

    Function FindMonster(x, y: Integer): Boolean;

    Var
    CTS, I: Integer;
    TPA: TPointArray;
    ATPA: Array of TPointArray;

    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.08, 2.99);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 16492968, MSX1, MSY1, MSX2, MSY2, 10)
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 30, 30);

      For I := 0 To High(ATPA) Do
      Begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);
        If(WaitUpTextMulti(['ody es','dy','Body','y ess'],500+random(100))) Then
        Begin
          Result := True;
          GetMousePos(x, y);
          Break;
        End;
      End;
    End;

    Procedure AttackMonster;
    Begin
      If FindMonster(X,Y) Then
        Begin
          ClickMouse2(True)
          If DidRedClick Then
            Begin
              IncEx(K,1);
              AttackWait
            End Else AttackMonster;
        End Else
        begin
          AttackMonster;
          writeln('Nothing found');
        end;
    End;


    begin
      Smart_Server := 25;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      ClearDebug;
      SetupSRL;
      DeclarePlayers; // Calls the procedure, you can't forget this!
      LoginPlayer; // You want your player to login, right?

      MakeCompass('N');
      SetAngle(0);

      XPO := GetXPBarTotal;
      MarkTime(TimeGone);;
      Repeat;
        AttackMonster;
        XPN := GetXPBarTotal;
        ClearDebug;
        XP := XPN-XPO;
        XPH := Round ((XP*3600000)/TimeFromMark(TimeGone));

        writeln('************************************');
        writeln('************************************');
        writeln('Xp Gained: ' + FloatToStr(XP) );
        writeln('Total Time: ' + FloatToStr(TimefromMark(TimeGone)/1000) + 'S ['+TimeRunning+']');
        writeln('Xp/Hour: ' + FloatToStr(XPH) );
        writeln('************************************');
        writeln('************************************');

        SMART_DrawTextEx(True, 50, 360,  UpChars, 'Xp Gained: ' + FloatToStr(XP), clBlue);
        SMART_DrawTextEx(false, 50, 380, UpChars, 'Total Time: ' + FloatToStr(TimefromMark(TimeGone)/1000) + 'S ['+TimeRunning+']', clBlue);
        SMART_DrawTextEx(false, 50, 400, UpChars, 'Xp/Hour: ' + FloatToStr(XPH), clBlue);
      Until(false);
    end.

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    4,326
    Mentioned
    153 Post(s)
    Quoted
    684 Post(s)

    Default

    I'd place my money on your anti-bans.

    BTW you have some bugs in your code.. Always reset your CTS and speeds after usage:
    SetColorSpeed2Modifiers(0.2, 0.2);
    I am Ggzz..

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
  •