Results 1 to 5 of 5

Thread: [Fighting function by me]] Should work..

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

    Default [Fighting function by me]] Should work..

    Alright, made a function for fighting. Instead of clicking, it right clicks the monster then attacks. I'll soon add a Run feature.

    SCAR Code:
    function FightMonster(MonsterName: String; MColor,MColor2,MColor3: Integer; Tolerance: Integer): Boolean;
     var Number, Color: Integer;
    begin

      for Number := 1 to 3 do
      begin
       case Number of
       1: Color:= MColor1;
       2: Color:= MColor2;
       3: Color:= MColor3;
    end;
      if not InFight then
      begin
       FindObjFast(x,y,MonsterName,Color,Tolerance);
       Mouse(x, y, 0, 0, False);
       if not ChooseOption(x, y, 'Attack') then
          ChooseOption(x, y, 'Cancel')
       Wait(1000 + Random(5000));
      end;
    end;
    end;

    This may not be the best code out there but it works.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I'd suggest checking IsUpTextMulti, not right-clicking. It's probably pretty detectable. Or maybe do something like
    SCAR Code:
    case random(6) of
      0: RightClick := True;
      1: RightClick := True;
      2: RightClick := True;
      3: RightClick := True;
      4: RightClick := True;
      5: RightClick := False;
    end;

    Then do something like if (not(rightclick))then
    Then the procedure you have right now. Then put:
    else
    <the new procedure without right click here>

    Hope that helped.

  3. #3
    Join Date
    Sep 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the tip bullzeye! Next release I'll add that in.

  4. #4
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    That long wait at the end will definetly have some conflic if you encounter a random..

    Try this:
    SCAR Code:
    function FightMonster(MonsterName: String; WaitAfterClick, MColor,MColor2,MColor3: Integer; Tolerance: Integer): Boolean;
     var Number, Color: Integer;
    begin
      for Number := 1 to 3 do
      begin
       case Number of
       1: Color:= MColor1;
       2: Color:= MColor2;
       3: Color:= MColor3;
    end;
      if not InFight then
      begin
       FindObjFast(x,y,MonsterName,Color,Tolerance);
       if Random(6) = 1 then
       begin
         Mouse(x, y, 0, 0, False);
         wait( 100 + random ( 50 ));
         if not ChooseOption(x, y, 'Attack') then
            ChooseOption(x, y, 'Cancel')
       end  else
         Mouse(x, y, 0, 0, True);
       FTWait( WaitAfterClick / ( 200 + random(50)));
      end;
    end;
    end;

    I also added some other stuff like it will right click 5/6 times..

    Hope you like it.
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  5. #5
    Join Date
    Sep 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the modification! You beat me to adding on =D. Oh well, I'll try to make a function for other things =D.

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. A function doesnt work in new version of scar
    By fastler in forum OSR Help
    Replies: 3
    Last Post: 04-27-2007, 03:02 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
  •