Results 1 to 8 of 8

Thread: [Server] fight bot

  1. #1
    Join Date
    Jul 2013
    Posts
    45
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Question [RSPS] check when npc is dead

    I have made a fight bot with a lot of help from this community, but now the server had an update.
    when you are max level in a skill the skill counter stopped counting up.
    my code now is:
    Code:
    Program AttachMonster;
    {$I RSPS/srlRSPS.Simba}
    function differentCount(time:integer): Boolean;
    var
    _white_count:integer;
    begin
      _white_count := countColorTolerance(16646143, 429, 80, 516, 95, 5);
      Wait(time);
      result := (_white_count <> countColorTolerance(16646143, 429, 80, 516, 95, 5));
    end;
    
    function inCombat:boolean;
    begin
      result := differentCount(3300);
    end;
    
    Procedure LoggedOut
    var
      X,Y:Integer;
    begin
    writeln('Couldnt find any monsters');
      MouseSpeed := 15;
      Mouse(452, 313);
      wait(500);
      Mouse(311, 344);
      wait(10000);
      Mouse(538, 87);
      wait(500);
    end
    
    Procedure AttackMonster
    var
      X,Y:Integer;
    begin
      if FindColorTolerance (X, Y, 10337744, 44, 91, 556, 425, 2) then
      begin
      MouseSpeed := 15;
      Mouse(x, y);
      end
    else
      begin
      LoggedOut
      end
    end;
    
    begin
      repeat
        while not inCombat() do
          attackMonster();
      until(false);
    end.
    but now it will attack another npc even if it's already in fight

    can someone help me?
    Can I make something like that it will search for an empty red bar, but then it will also attack again if someone else kills a monster?
    Last edited by xX4m4zingXx; 10-07-2014 at 08:36 PM.

  2. #2
    Join Date
    Mar 2013
    Location
    Argentina
    Posts
    758
    Mentioned
    27 Post(s)
    Quoted
    365 Post(s)

    Default

    Quote Originally Posted by xX4m4zingXx View Post
    I have made a fight bot with a lot of help from this community, but now the server had an update.
    when you are max level in a skill the skill counter stopped counting up.
    my code now is:
    Code:
    Program AttachMonster;
    {$I RSPS/srlRSPS.Simba}
    function differentCount(time:integer): Boolean;
    var
    _white_count:integer;
    begin
      _white_count := countColorTolerance(16646143, 429, 80, 516, 95, 5);
      Wait(time);
      result := (_white_count <> countColorTolerance(16646143, 429, 80, 516, 95, 5));
    end;
    
    function inCombat:boolean;
    begin
      result := differentCount(3300);
    end;
    
    Procedure LoggedOut
    var
      X,Y:Integer;
    begin
    writeln('Couldnt find any monsters');
      MouseSpeed := 15;
      Mouse(452, 313);
      wait(500);
      Mouse(311, 344);
      wait(10000);
      Mouse(538, 87);
      wait(500);
    end
    
    Procedure AttackMonster
    var
      X,Y:Integer;
    begin
      if FindColorTolerance (X, Y, 10337744, 44, 91, 556, 425, 2) then
      begin
      MouseSpeed := 15;
      Mouse(x, y);
      end
    else
      begin
      LoggedOut
      end
    end;
    
    begin
      repeat
        while not inCombat() do
          attackMonster();
      until(false);
    end.
    but now it will attack another npc even if it's already in fight

    can someone help me?
    Can I make something like that it will search for an empty red bar, but then it will also attack again if someone else kills a monster?
    in rs3 i look for the bar the appears when you fight, if its not there, then target another npc. i Use DTM finder for this, although you should add failsafes

  3. #3
    Join Date
    Jul 2013
    Posts
    45
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by undorak7 View Post
    in rs3 i look for the bar the appears when you fight, if its not there, then target another npc. i Use DTM finder for this, although you should add failsafes
    is it possible to do that in servers?
    and also is it possible to check for a red bar near my player?

  4. #4
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Of course it is, grab the color of the bar from inside your server, then search for it with one of the spiral methods which start from the center of your screen.

    This was one of the earliest ways of detecting whether someone is "inFight" in early SRL/SCAR.

  5. #5
    Join Date
    Jul 2013
    Posts
    45
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    How can I make it then that it will always be around my player and not that if a player around me kills a monster that it will detect that?

  6. #6
    Join Date
    Jul 2013
    Posts
    45
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    Bump

  7. #7
    Join Date
    Mar 2007
    Posts
    478
    Mentioned
    4 Post(s)
    Quoted
    4 Post(s)

    Default

    I have put a couple suggestions below, but they will only work if you are using SRL. From the look of your script, you're are currently not... https://villavu.com/forum/forumdisplay.php?f=648 I would take a look at atleast one of those.

    This might be of assistance. Only works if you can see your player.

    Code:
    while (mainscreen.isPlayerAnimating()) do
     begin
      wait(randomrange(50,100));
      AntiBan();
      Or whatever you do while fighting
     end;
    This will attack said monster and if no monster is found will log out using your log out function.

    Code:
    Procedure AttackMonster
    var
      X,Y:Integer;
    begin
     if not mainscreen.findObject(x, y, 10337744, 2, ['ttack'], MOUSE_LEFT) then LoggedOut;
    end;
    Great effort so far!! Keep it up!!
    Back from the dead.....

  8. #8
    Join Date
    Jul 2013
    Posts
    45
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    Ty, but this is not for RS3 I'm making a bot for an RSPS.

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
  •