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!