SRL Archive - SRL Suggestions

Gametab.Scar IsResting: Boolean;


NCDS

2010-06-28 19:31:00


{*******************************************************************************
function IsResting: Boolean;
By: Sabzi
Last Edit: 19 Sep 2009
Description: Returns True if you are currently resting.
*******************************************************************************}
function IsResting: Boolean;
begin
result := (CountColorTolerance(3712343,707, 95,732, 122,10)>10);
end;

First thing, the color is static so is there really any reason for a tolerance of 10??

Second, would a simple Result := (GetColor(x, y) = 3712343); not be better?

Sabzi

2010-06-28 19:50:40

I remember doing it with a simple GetColor check as the color is static.
I don't know :p. Someone changed it maybe?

EDIT: Good my memory is okay. Look at revision 241 -> 242. That's the original at least.
I think the color changed or something and a dev made it more survival.

EDIT2: Took like 10 min, but look at 513 -> 514 :).

Coh3n

2010-06-28 20:16:41

From: NCDS

{*******************************************************************************
function IsResting: Boolean;
By: Sabzi
Last Edit: 19 Sep 2009
Description: Returns True if you are currently resting.
*******************************************************************************}
function IsResting: Boolean;
begin
result := (CountColorTolerance(3712343,707, 95,732, 122,10)>10);
end;

First thing, the color is static so is there really any reason for a tolerance of 10??

Second, would a simple Result := (GetColor(x, y) = 3712343); not be better?

I wouldn't say it'd be that much better, this one will just work longer if Jagex decided to slightly change the colour. As long as the current one doesn't return false positives/negatives I think it should stay for now.

Sir R. M8gic1an

2010-06-28 20:26:24

Sometimes you aren't looking for the fastest method, but rather the longer lasting one.

It's a debate that never really comes to the "perfect answer", but sometimes, instead of saving ms it might be preferable to save minutes of fixing, especially with methods that are not often called, meaning those ms don't add up too much.

eg:
FindNormalRandoms has to be as fast as it can be. Gets called often.
LoginPlayer is called maybe every half an hour. Better to lose 10 ms, than fixing it every week and waiting for the fix.

A GetColor based method is very easy to break. Move it one pixel aside. Change the color.

edit: Big time ninja by Coh3n.

~RM

Coh3n

2010-06-28 20:28:58

From: Rasta Magician
edit: Big time ninja by Coh3n.

Meh, maybe, but your sounds smarter. :rolleyes:

NCDS

2010-06-28 20:33:17

From: Coh3n
I wouldn't say it'd be that much better, this one will just work longer if Jagex decided to slightly change the colour. As long as the current one doesn't return false positives/negatives I think it should stay for now.


From: Rasta Magician
Sometimes you aren't looking for the fastest method, but rather the longer lasting one.

It's a debate that never really comes to the "perfect answer", but sometimes, instead of saving ms it might be preferable to save minutes of fixing, especially with methods that are not often called, meaning those ms don't add up too much.

eg:
FindNormalRandoms has to be as fast as it can be. Gets called often.
LoginPlayer is called maybe every half an hour. Better to lose 10 ms, than fixing it every week and waiting for the fix.

A GetColor based method is very easy to break. Move it one pixel aside. Change the color.

edit: Big time ninja by Coh3n.

~RM


Yeah I see what you guy's are saying and understand it 100%

Thanks for clearing that up :)

i luffs yeww

2010-06-28 22:42:04

From: Coh3n
Meh, maybe, but your sounds smarter. :rolleyes:


<3 I lol'd.

Wanted

2010-06-29 13:04:43

I've been wanting to make a 2ndary system for the MM that does not use any OCR or getcolor ect… but more so something that should almost never fail like detecting the overall RGB of the circle and spitting out an accurate percentage… or something of that sorts that is super reliable for accurate HP readings and energy levels.

i luffs yeww

2010-06-29 15:51:20

^ I assume you mean strictly for HP/prayer/run energy, and not the actual minimap as a whole?

NCDS

2010-06-29 15:53:35

From: i luffs yeww
^ I assume you mean strictly for HP/prayer/run energy, and not the actual minimap as a whole?

From: IceFire908
or something of that sorts that is super reliable for accurate HP readings and energy levels.

;).

i luffs yeww

2010-06-29 21:49:37

"system for the MM"

:p That part confused me.