SRL Archive - Help

Fight detection


Heya69

2012-01-02 01:09:48

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

2012-01-02 01:19:17

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

2012-01-02 01:24:01

From: Flight
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

2012-01-02 01:46:43

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

2012-01-02 01:49:29

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

2012-01-02 01:50:46

From: Flight
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

2012-01-02 02:00:46

Flight also MSNs, PM him and ask him for it. :D he's great!

Heya69

2012-01-02 14:57:24

bump