Roflme
2012-10-29 16:42:15
Function isAnimating: Boolean;
var
B: TBox;
begin
B := PointToBox(Point(MSCX-20, MSCY-20),Point(MSCX+20,MSCY+20));
Result := Animating(B, 5, 300);
if Result then
Writeln('It is animating');
end;I'm trying to find a way to detect when the player is teleporting or not. I was going to try to use the above code. My goal is for it to try to detect the center of the screen (where the player is). Some animations will be going on while teleporting so I was going to try see if I could find a way to detect that. I was hoping the above would detect nothing when nothing was happening, and then when the player is teleporting it'd pick that animation up.
Well, it works for the most part…
The only problem is that when I have this on repeat, it will sometimes detect animation while it's just standing still. (I was testing it to repeat until(false). I'd click to walk and enable SMART and "It is animating" would spam until it stopped walking. It would spam the same while I was teleporting. But when I stood still sometimes it'd just randomly message that while doing nothing (nothing at all moved in the specified box. I made sure only my character was in the box).
So I have some questions:
- Would the above be an efficient way for detecting animation? I understand if anyone/thing moves near the center of the screen it will detect it as animation. But is there any better way for detecting any animation (specifically teleporting animation?)
- Is there any way to make the above function more accurate? I really want it only to detect animation when moving/*insert script action here*/teleporting.
- Why does the message only appear every so often while standing still?
- When it's counting the amount of pixels shifted (while the function is left on an indefinite repeat), will the count reset when it's restarted the function? I don't know, I'm just trying to find out why it will detect animation when it's just standing there (I made sure nothing could move in it's way). Would upping the minimum count/time length fix that? I don't want to make it too high of a minimum count because it may not be able to pick up the teleport animation :(
Err and I'll edit this when I come up with another question I guess. Someone tell me what you did to detect that the player is teleporting. :(