SRL Archive - SRL Archives

New, More Efficent LoggedIn Function?


XxKanexX

2006-03-29 06:13:08

Should we use this, or stick to the old one? The old one gets a color, but this checks for the Compass. If the Compass angle results as -1 (Compass not found) it results as false. If it does find the compass angle, results as true. :)


function LoggedIn: boolean;
begin
if not(DetectRS2MinimapCompassAngle = -1) then
result:= true;
end;

and maybe we could add a LoggedOut function. It's just alot easier than not logged in.


function LoggedOut: boolean;
begin
if not(LoggedIn) then
result:= true;
end;

:)?

WT-Fakawi

2006-03-29 06:38:49

Good thought.

currently we check for only one pixel, from the text "Logout", GameTab(10?) While this is true for most cases, it is certainly not true while banking, since the text "Logout" disappears from the screen while Bank is open (This has cost he some days of severe headaches…:) )

I dont know how much DetectRS2CompassAngle weights on the system, but if it is a lag-hog, I would go for yet another pixel, like one or two pixels from the upper left and right chatedge. IFAIK they are always there, but please verify.

In Short: I agree with Kane, we need another LoggedIn check!

XxKanexX

2006-03-29 07:51:16

Well, it's quite fast. But, i will ask Kaitnieks now which would be faster and how much of a different the two are in time.

Edit:
Since Kait isn't replying, I timed them with GetSystemTime. ;)

Well, With Getcolor, it's around 1 - 5 ms. And with the Minimap compass angle detector it was around 1 - 10 ms.
I'm sure that's not much of a big difference and wouldn't effect it at all. :)

phantombmx

2006-03-30 15:39:35

heres a function i used in my script.. works just fine for me and doesnt seem to lag or anything.. not sure about the timing tho.. it will check for 2 colors in the bottom right of the chat screen.. 4 pixel check.. they are always there unless logged out..

function LoggedOut:Boolean;
begin
Result:=True;
If(FindColorTolerance(x,y,7707058,495,452,496,453,2))
or(FindColorTolerance(x,y,6917802,495,452,496,453,2))Then
begin
Result:=False;
end;
end;

Mutant Squirrle

2006-03-30 17:42:13

lol why dont u just find the : in the chat box next to the username? that way its either there or not the compass finding may fail sometimes when its acctually there (yeah ive tested it) idk why either but it has before so yeah : maybe?

phantombmx

2006-03-30 18:25:16

mine works flawlessly.. havent had a problem with it yet :p

the reason we dont look for the ':' next to the username is because it changes location depending on your username.. so you would have to do a findtext or a findbitmap.. and it would just take too long (what maybe an extra 15-30 ms.. lol) i think..

try testing out mine.. works quite well

Pwnd

2006-03-30 19:37:00

My DTM owns j00r an0r.

XxKanexX

2006-03-30 19:55:16

Well, if it dosn't find the compass, therefore it's not on the rs screen. So it can break any loops.

It's quicker than 2 Findcolortolerances, and has a better chance of returning successful. ;)

Pwnd, Good for j00.

phantombmx

2006-03-30 21:40:36

it may be a bit quicker kane but i tested yours a few times and it returned that i was logged out when i was actually logged in.. mine hasnt had any problems whatsoever and is only a few ms slower than yours.. i'll use mine over yours :p

XxKanexX

2006-03-30 21:56:13

If the compass is being covered by scar it won't work.

The compass needs to be in full view to work. I'll run it a few times and see what i get.

phantombmx

2006-03-30 22:01:01

well no duh.. :p i know it needs to be visible.. it just was wrong occasionally :rolleyes:

XxKanexX

2006-03-30 22:01:16

I ran a script:


Tested 4271 times until user stopped script.
Didn't Find: 0 times.
Took approx: 28691ms / 28.691 seconds.

masquerader

2006-03-30 23:28:30

er.. how about the center dot on the minimap,
648,83 color 16777215

it seems like that would use the minimap the same way, but be more efficient

i win

phantombmx

2006-03-30 23:33:23

From: masquerader
er.. how about the center dot on the minimap,
648,83 color 16777215

it seems like that would use the minimap the same way, but be more efficient

i win


not sure that will work.. does the center dot get overlapped by anything? if so i dont think it will work.. otherwise–good plan :rolleyes:

Pwnd

2006-03-30 23:35:18

From: XxKanexX
Well, if it dosn't find the compass, therefore it's not on the rs screen. So it can break any loops.

It's quicker than 2 Findcolortolerances, and has a better chance of returning successful. ;)

Pwnd, Good for j00.

You don't need to use FindColorTolerance.. The colors don't change at the login screen, nor the welcome screen.

Thank j00.

XxKanexX

2006-03-31 00:04:53

From: Pwnd
You don't need to use FindColorTolerance.. The colors don't change at the login screen, nor the welcome screen.

Thank j00.

We're not talking about them though.