Results 1 to 6 of 6

Thread: Fighting functions

  1. #1
    Join Date
    Oct 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Fighting functions

    I am deciding which fighting function to use and was wondering which one you guys think would be the easiest/least likely to mess up. I think some of these might not work, if you know they dont work please post so.

    FightNPC
    AttackMonster
    FindMonster / KAttackMonster
    FindAttackableNpc
    FindAttackableNpc2

  2. #2
    Join Date
    Jun 2006
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I use KAttackMonster for mine and it works pretty well, i think that most fighting functions may mess up once in a while or often unless you choose unique colors.

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    This is my NPC Attacker. There is a function like that in skill/fighting.scar. It inputs six colors (try grabbing unique NPC-colors, not common green colors for exampe), a tolerance for the colors and a TimeOut (exit elapsetime). Works well for me, its pretty basic; it clicks the colors when it sees 'ttac' in the upperleft corner. Many variations can be created, and every script needs its own unique FightNPC, but this is an ok framework.

    SCAR Code:
    {*******************************************************************************
    function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut: Integer): Boolean;
    By: WT-Fakawi
    Description: Fights NPC. Inputs 6 NPC Colors. (May be the same colors),
    tol = tolerance, TimeOut = amount of time before clicking on next NPC
    *******************************************************************************}


    Function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut: Integer):
    Boolean;
    var I,  Color: Integer;
    begin
      for I  :=  1 to 6 do
      begin
       case I of
       1: Color :=  Color1;
       2: Color :=  Color2;
       3: Color :=  Color3;
       4: Color :=  Color4;
       5: Color :=  Color5;
       6: Color :=  Color6;
      end;

      if (Loggedin) then
      begin
         if (FindObj(x,y,'ttac',Color,tol)) then
         begin
            Result := True;
            if(not (Loggedin) or (WeAreDead)) then break;
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, True);
            FFlag(10);
            FTWait(8);
            MarkTime(Mark);
            repeat
               if(not (Loggedin) or (WeAreDead)) then break;
               if (TimeFromMark(Mark) > TimeOut) then break;
               FTWait(5);
            until ( (not (inFight) or (WeAreDead) ));
            Players[CurrentPlayer].Killed := Players[CurrentPlayer].Killed+1;
         end
         else
          Result := False;
       end
     end
    end;
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  4. #4
    Join Date
    Oct 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im new to scripting, so this may sould pretty dumb.
    when I use FightNPC, is that the only function I need?
    or do I need other functions to tell it to find the colors, click etc.?

  5. #5
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    FightNPC does the following:

    1. it looks for a color on the mainscreen
    2. if it find it, it moves the mouse towards that color.
    3. it checks if there is a text in the upper left corner of the screen saying "ttac" ( from Attack...)
    4. if it does, it clicks the mouse. you atack the color.
    5. It waits for the Flag to disappear from the screen ( We are probably moving)
    6. next it enters a loop checking for either the green or the red color above your head.
    7. it exits the loop when the green and/or red are gone or when TimeOut msecs have passed.
    8. it returns true if t clicks a NPC, and false if it doenst.
    9. It performs at least two checks to see if we are loggeout or died.


    theoretically this might work:

    SCAR Code:
    setupsrl;
    repeat
    FightNPC(94224,84556,56675,345145,56367,22345, 10000);
    until false;

    though it is not very sophisticated.
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  6. #6
    Join Date
    Oct 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Fighting Trolls
    By NCDS in forum RuneScape News and General
    Replies: 2
    Last Post: 11-30-2008, 12:02 AM
  2. Fighting script
    By Bobzilla69 in forum First Scripts
    Replies: 4
    Last Post: 09-10-2007, 07:36 PM

Posting Permissions

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