Log in

View Full Version : Fight detection



Heya69
01-02-2012, 06:09 AM
begin
if IsUpText('gre') then
Begin
writeln('We found Ogre')
Mouse(x,y ,5,5, false);
MarkTime(WeAttacked);
ChooseOption('ttack');
writeln('Raping Ogre');
End;

Can someone help me to add fight detection?

I want to learn how to use isfightat and animation

Flight
01-02-2012, 06:19 AM
Ooooh yeah... Fighting is pretty tricky, that's for sure. Especially given that you're making a ranging script (I assume?). Pixel-shift (for animation detection) would be your best bet there.

Heya69
01-02-2012, 06:24 AM
Ooooh yeah... Fighting is pretty tricky, that's for sure. Especially given that you're making a ranging script (I assume?). Pixel-shift (for animation detection) would be your best bet there.

Yes, can you help me?

Flight
01-02-2012, 06:46 AM
Mm... What I would do is create a small debug script. What this script would do is constantly print your average pixel-shift and just run it first standing still, facing all directions. Take note of what your highest pixel shift count is. Then run the script using the ranging animation in all directions, and take note of the lowest pixel count.

Should the highest standing still count be lower than your lowest ranging count, then you know how to accurately detect if you're ranging or standing still.


Function MyShiftCount: Integer;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := AveragePixelShift(PBox, 250, 500);
end;

YoHoJo
01-02-2012, 06:49 AM
Been helping him on msn and suggested same.
You're really going to need to help him step by step though and explain everything, he's not too experienced yet.

Heya69
01-02-2012, 06:50 AM
Mm... What I would do is create a small debug script. What this script would do is constantly print your average pixel-shift and just run it first standing still, facing all directions. Take note of what your highest pixel shift count is. Then run the script using the ranging animation in all directions, and take note of the lowest pixel count.

Should the highest standing still count be lower than your lowest ranging count, then you know how to accurately detect if you're ranging or standing still.


Function MyShiftCount: Integer;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := AveragePixelShift(PBox, 250, 500);
end;


Do you have any chat messenger?

YoHoJo
01-02-2012, 07:00 AM
Flight also MSNs, PM him and ask him for it. :D he's great!

Heya69
01-02-2012, 07:57 PM
bump