Results 1 to 9 of 9

Thread: Fighter Help

  1. #1
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Fighter Help

    ok, i desided i didnt like my old monk killer so ima re make it. right now im having an issue with my TPA, i tried both FindObjTPA and FindSpiralTolerance and they both give me the error: [Runtime Error] : Out Of Range

    heres my script. i pretty much just copied and pasted this TPA from another script i made to save time, and i realy dont understand why it worked in that one but now in this one =[

    Edit: btw i am having some trouble with my logging in, it wont click that big yellow "Click Here To Play" button on the login screen. whats up with that? D=

    SCAR Code:
    program New;
    {.Include SRL/SRL/Misc/SMART.SCAR}
    {.include SRL\SRL.Scar}
    {.include SRL\SRL\Skill\Fighting.scar}

    const
      MaxTime = 15; //How long you want each player to go
      Tolerance = 7;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
      Players[0].Integers[0] := 2;
    end;

    var
      PlayTime : LongInt;

    procedure SetupSmart;
    begin
    SMARTSetupEx(153, False, True, False);
      Wait(5000);
      SetTargetDC(SmartGetDC);
      repeat
        wait(100);
      until(SmartGetColor(253, 233)<>1118604);
    end;

    function RanInt(magnitude : Integer) : Integer;
    var
      product : Integer;
    begin
      product := Random(magnitude+1) - Random(magnitude+1);
      if(product=0) then Result := Random(magnitude) - Random(magnitude)
      else Result := product;
    end;

    Procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(100) of
        0..4:RandomRClick;
        5..18:HoverSkill('attack',False);
        19..30:SleepAndMoveMouse(7000);
        31..56:RandomRClick;
        57:BoredHuman;
        58..59:HoverSkill('random',False);
        60:RandomMovement;
        61:Wait(1500 + Random(750));
        62:begin
             SetAngle(false);
             Wait(Random(560 + Random(450)));
             MakeCompass('W');
             SetAngle(true);
             MakeCompass('N');
          end;
       end;
       Exit;
    end;

    {function AtackMonk: Boolean;
    var
       Color : TIntegerArray;
       TPA : TPointArray;
       ATPA : T2DPointArray;
       x, y, i : Integer;
    begin
      if not LoggedIn then exit;
      Result := False;
      Color := [8957142, 2900557, 1516072,3691618, 2438977];
      for i := 0 to 4 do
      X := MSCX;
      Y := MSCY;
      begin
        FindColorsSpiralTolerance(X, Y, TPA, Color[i], 153, 111, 246, 257, 7);
        begin
          ATPA := SplitTPA(TPA, 22);
          for i := 0 to High(ATPA) do
          begin
            MiddleTPAEx(ATPA[i], x, y);
            MMouse(x, y, 3, 3);
            Wait(100+Random(100));
            if IsUpText('tack') then
            begin
              Wait(100+RanInt(200));
              Mouse(x, y, 4, 4, True);
              Wait(100+RanInt(200));
              Result:= True;
            end else
            begin
              Mouse(x, y, 2, 2, False);
              Wait(100+RanInt(200));
              ChooseOption('tack');
              Wait(100+RanInt(200));
              Result:= True;
            end;
          end;
        end;
      end;
    end;}


    function AtackMonk: Boolean;
    var
       x, y, waitTree, count, i : integer;
       Color: TIntegerArray;
       Switch : Boolean;

    begin
      if(InvFull or not LoggedIn) then Exit;
      Result := False;
      Color := [8957142, 2900557, 1516072,3691618, 2438977];
      for i := 0 to 12 do
      begin
        if FindObjTPA(x, y, Color[i], Tolerance, -1, 15, 20, 4, ['tack', 'onk']) then
        begin
          if not IsFightAt(x, y) then
          begin
            MMouse(x, y, 2, 2);
            if IsUpText('tack') then
            begin
              Mouse(x, y, 4, 4, True);
              Wait(100+RanInt(200));
              Result:= True;
            end else
            begin
              Mouse(x, y, 2, 2, False);
              Wait(100+RanInt(200));
              ChooseOption('tack');
              Wait(100+RanInt(200));
              Result:= True;
            end;
          end;
        end;
      end;
    end;



    procedure ScriptSetup;
    begin
      SetupSRL;
      SetupSmart;
      ActivateClient;
      ClearDebug;
      DeclarePlayers;
      if {RSReady or} not LoggedIn then LogInPlayer;
      SetAngle(true);
      MakeCompass('n');
      SetRun(true);
    end;

    begin
      ScriptSetup;

      repeat
        MarkTime(PlayTime);
        repeat
          if InFight then
          begin
            Wait(1000+RanInt(1000));
            AntiBan;
          end else AtackMonk;
        until(not LoggedIn or (TimeFromMark(PlayTime) >= (MaxTime*60000)));
      until(CurrentPlayer = HowManyPlayers);
    end.
    Last edited by Lance; 04-29-2009 at 08:56 AM.
    Lance. Da. Pants.

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    for i := 0 to 12 do

    you only have five colors? so do what you used to have i := 0 to 4.

  3. #3
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I AM AN IDIOT. i guess thats why you dont copy / paste eh?
    and erm is the srl logging in broken?
    Lance. Da. Pants.

  4. #4
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just get last rev there have all fixe
    Formerly known as FrancisHelie

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

    Default

    Color := [8957142, 2900557, 1516072,3691618, 2438977];
    for i := 0 to 12 do


    For that I suggest doing this instead:

    Color := [8957142, 2900557, 1516072,3691618, 2438977];
    for i := 0 to High(Color) do


    This way you can add more colors and you won't get Out of Range errors.
    (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.

  6. #6
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i got the latest rev =[ idkk maby my srl is messed up or something

    ohhh very smart =O thanks man. i didnt think of useing a high(color)
    Lance. Da. Pants.

  7. #7
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think their is something wrong with SRL, maybe try replacing your login.scar with this one.

  8. #8
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    You have nice antiban procedure there, but
    SCAR Code:
    Procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(100) of
        0..4:RandomRClick; //<---
        5..18:HoverSkill('attack',False);
        19..30:SleepAndMoveMouse(7000);
        31..56:RandomRClick; //<--- you could combine these 2
        57:BoredHuman; // only 1% chance to occur?
        58..59:HoverSkill('random',False);
        60:RandomMovement; // only 1% chance to occur?
        61:Wait(1500 + Random(750)); //you already have sleepandmovemouse
        62:begin // only 1% chance to occur?
             SetAngle(false);
             Wait(Random(560 + Random(450)));
             MakeCompass('W');
             SetAngle(true);
             MakeCompass('N');
          end;
       end;
       Exit;
    end;

  9. #9
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ill try that Dark, thanks.

    and haha yeah thats not even mine i stole it from smarterchild, just forgot to credit. ill tell him his antiban sucks ;D

    and this script is gonna be for my own use so dont flame me for not crediting D= im not gonna spread it around with my stamp on it.
    Lance. Da. Pants.

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
  •