Results 1 to 6 of 6

Thread: Need help with making a fighting script.

  1. #1
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default Need help with making a fighting script.

    Hi

    I'm working to make a fighting script that can loot certain items and that will use a summoning familiar to help with the fighting.

    Onto my questions.
    If I'm in combat I want the script to click on the summoning icon() and on the monster I'm fighting.

    This is what I have so far, it works but it has some flaws.
    Simba Code:
    procedure FamiliarAttack;
    var
      X, Y, SumIcon: integer;

    begin
    SumIcon := BitmapFromString(6, 6, 'meJybN7N5/bLpEHTs9IG7b292VufB' +
            'RTZsXQsUDPB3AwrOQ1KZmZ0IFOyqzps/s3k+WByooAumBiII1AhBE' +
            'JGNW9cCAPuxQX4=');

    if srl_InFight then
       if (FindBitmapToleranceIn(SumIcon, X, Y, 688, 130, 725, 163, 10)) then
        begin
          MMouse(X, Y, 5, 5);
          Mouse(X, Y, 0, 0, True);
            if FindColorSpiralTolerance(X, Y, 7488848, 216, 106, 327, 227, 10) then
              begin;
                MMouse(X, Y, 5, 5);
                Mouse(X, Y, 0, 0, True);
              end;
        end;
        FreeBitMap(SumIcon);
        WriteLn('We are in fight and let the familiar attack');
    end;


    This checks if there is a HP bar above my character and if there is, it will click on the summoning icon, look for a color of the monster close to me and click on the monster.

    The problem is that it might click on a different monster that is close to me. And if a monster is walking around you can't really attack it with FindColorSpiralTolerance because it will misclick.

    Questions:
    • How can I make the script randomly click anywhere between the red outlined area: . A bitmap would only click around that part, how can I let the script click anywhere between the red outlined area? Is there any special function?
    • What is the best way of detecting monsters? I have been looking at other fighting scripts and they seem to use a lot of interesting stuff to detect the monsters, is there anyone that can help me out with a short guide or a link to a guide (I couldn't find one)
    • Is there a function hardcoded in Simba that can detect the HP bar of the monster you are fighting? If not, what is the best way of doing this?


    That's pretty much it for now
    Summarized:
    I'm looking for help with detecting and attacking walking monsters; detecting the HP bar of the monster I'm fighting and clicking anywhere on the summoning icon.

    Thanks in advance!

    Script source code available here: Github

  2. #2
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    To click the summoning Icon, since it doesn't move, I'd create something like this:

    Simba Code:
    Case Random(2) of
      0: MouseBox();
      2: MouseCircle();
    end;

    If you dont know how to use MouseBox and MouseCircle, look for it in the functions list.

  3. #3
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    To click the summoning Icon, since it doesn't move, I'd create something like this:

    Simba Code:
    Case Random(2) of
      0: MouseBox();
      2: MouseCircle();
    end;

    If you dont know how to use MouseBox and MouseCircle, look for it in the functions list.
    Thanks, about to look into this. I was also thinking of making a DTM for the summoning icon and let simba click somewhere randomly inside of the DTM. But I'm not sure if that works. I'll look into the mousebox and mousecircle.

    Script source code available here: Github

  4. #4
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    For monster misclicking, maybe check if monster has a health bar too b4 clicking to attack with summoned creature.

    Edit: sry sould have explained better.
    Make a bitmap or dtm of the health bar and look for it directly above where it found the monster.
    Last edited by bud_wis_er_420; 03-04-2012 at 01:25 AM.

  5. #5
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Quote Originally Posted by bud_wis_er_420 View Post
    For monster misclicking, maybe check if monster has a health bar too b4 clicking to attack with summoned creature.

    Edit: sry sould have explained better.
    Make a bitmap or dtm of the health bar and look for it directly above where it found the monster.
    Yeah I think that is the best way - as far as I know :P I've had some help from YoHoJo and I'm using auto color right now which is great. If anyone has some more tips, let me know

    Script source code available here: Github

  6. #6
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by RuneScapeJJ View Post
    Yeah I think that is the best way - as far as I know :P I've had some help from YoHoJo and I'm using auto color right now which is great. If anyone has some more tips, let me know
    Have a look at my monk script:
    http://villavu.com/forum/showthread.php?t=76595

    It's basic but it has the principles all there feel free to use it amigo

    just change the monk settings + add your parts

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
  •