SRL Archive - Research & Development Lounge

AreWeMoving: Boolean;


turbobk

2008-08-01 12:03:53

Hey guys!

I've found a way to find out if our runescape charactor is moving around.

It takes 2 color's from various spots on the mainscreen, then it wait's 200 milliseconds and then check's for that color in a very small 20px by 20px box with 5 tolerance.

I've tested it for the last 30 minutes and it's worked perfect everytime!!! :D


NOTE: The only flaw I can see with this is, if a NPC is in the exact spot at the exact time when colors were taken and then 200 milliseconds later it moves then it would think we are moving..

I'm going to test it with NO waiting time, so as SOON as it takes the colors it checks for the same color in the box. But then it could/might lag and think we arn't moving, if I can get the waiting time spot on.. Then I think this might just work :D

PLEASE HELP ME TEST IT, AND IF YOU HAVE ANY SUGGESTIONS TO MAKE IT BETTER THEN PLEASE POST

Function WeAreMoving: Boolean;
Var
Color1, Color2: Integer;
rx, ry: Integer;
Begin
Color1 := GetColor(500, 320); // Bottom Right Corner
Color2 := GetColor(500, 20); // Top Right Corner
Wait(200);
If Not FindColorTolerance(rx, ry, Color1, 490, 310, 510, 330, 5) And
Not FindColorTolerance(rx, ry, Color2, 490, 10, 510, 30, 5) Then
Begin
WriteLn('We are moving.');
Result := True;
Exit;
End Else
Begin
WriteLn('We are standing still.');
Result := False;
Exit;
End;
End;

Thanks,
TurboBk.

ShowerThoughts

2008-08-01 12:05:45

Filter the npc color, ;)

turbobk

2008-08-01 12:08:40

From: Hermpie
Filter the npc color, ;)


Oooh, and how would I do that, could you please explain this to me? :)

ShowerThoughts

2008-08-01 12:17:23

Don't feel trying but, many functions like this made check also reflection stuff ;)

turbobk

2008-08-01 12:20:30

From: Hermpie
Don't feel trying but, many functions like this made check also reflection stuff ;)


Ahh ok lol.. fair enough, but Reflection is only for SMART and some people dont use SMART, so it could be useful for Non-SMART scripts.. Somehow lol :p

Claymore

2008-08-01 12:22:00

reflection is awesome, but i feel like sticking to SRL normal stuff. Reflection jkust makes thuings way too easy. Come on! Make yourself a nice flawless walk…

WalkTile(1230, 1532);

Done! But what about the old way?

RoadColor := FindVarrockRoadColor;
if RoadColor <= 0 then
RoadColor := FindRoadColor
if (RadialRoadWalk(etc…)) then
begin
end else
begin
FailSafe

turbobk

2008-08-01 12:30:52

From: Deathscytex
reflection is awesome, but i feel like sticking to SRL normal stuff. Reflection jkust makes thuings way too easy. Come on! Make yourself a nice flawless walk…

WalkTile(1230, 1532);

Done! But what about the old way?

RoadColor := FindVarrockRoadColor;
if RoadColor <= 0 then
RoadColor := FindRoadColor
if (RadialRoadWalk(etc…)) then
begin
end else
begin
FailSafe


Thanks for the Information.. But please don't go off topic :p

bullzeye95

2008-08-01 13:33:39

Your way works, but it's a bit unreliable if you either 1. are in a place with a lot of NPCs, or 2. are in a place with a lot of the same color in it (such as Ardougne ).

I don't want to hijack this thread with mine, so if you want to see my way of doing it, just go here. Mine is about halfway down. I explained how it works on the bottom of the first page if you are interested.

Queso

2008-08-01 13:51:49

Wouldn't it be safer to check for the flag color on the minimap? I mean, if the flag color is there, you should be moving :duh:

PvH

2008-08-01 13:58:11

From: Queso
Wouldn't it be safer to check for the flag color on the minimap? I mean, if the flag color is there, you should be moving :duh:


Nope
Sometimes you get stuck, and the flagg is there, but you arn't moving;)

PvH

bullzeye95

2008-08-01 15:33:02

And sometimes you can't rely on the flag if you're walking around something and it goes off the MM.

MylesMadness

2008-08-01 17:53:49

From: bullzeye95
..if you're walking around something and it goes off the MM.
Procedure MyFlag;
begin
While FlagPresent do wait(100);
While Not FlagPresent do Wait(100);
FFlag(0)
end;

turbobk

2008-08-01 21:09:18

From: Mylesmadness
Procedure MyFlag;
begin
While FlagPresent do wait(100);
While Not FlagPresent do Wait(100);
FFlag(0)
end;


But that could be a never ending loop couldn't it?

I've been in a few occasions where the Flag is still visible on the MM, but the charactor is stuck and therefore it would Wait(100); forever? :o

And thanks bullzeye95.. I'll take a look :)

MylesMadness

2008-08-04 13:06:02

So it would

Hugolord

2008-08-04 13:15:43

From: Deathscytex
reflection is awesome, but i feel like sticking to SRL normal stuff. Reflection jkust makes thuings way too easy. Come on! Make yourself a nice flawless walk…

WalkTile(1230, 1532);

Done! But what about the old way?

RoadColor := FindVarrockRoadColor;
if RoadColor <= 0 then
RoadColor := FindRoadColor
if (RadialRoadWalk(etc…)) then
begin
end else
begin
FailSafe


Old way Fails, when the hooks are working reflection is much more reliable.

turbobk

2008-08-05 04:13:03

From: Hugolord
Old way Fails, when the hooks are working reflection is much more reliable.


The old way doesn't fail..
It's just as you said, reflection is more reliable..

bullzeye95

2008-08-05 12:32:38

From: Hugolord
Old way Fails, when the hooks are working reflection is much more reliable.


More reliable. More easy. Less SCAR.

Macrosoft

2008-08-06 23:55:58

I made one of these too, mine was more reliable but stopped working after a update. I never bothered to fix it because heck, reflection does the same thing!

Good job for trying though, its good practice!