SRL Archive - MSI Archives

[Resolved] Out Of Range in Login.scar


Coh3n

2010-07-05 21:56:48

[INDENT]This started happening after I committed the most recent core updates. Sometimes it happens after a few hours, sometimes after a few minutes.

Error: Out Of Range at line 446

Line 446 (SRL's Login.scar):

B := GetTPABounds(ATPA[0 + Integer(not (Members))]);//When there's no demo mode
I can't think of what might cause this, so don't be afraid to post any ideas you may have. :)

Thanks,
Coh3n[/INDENT]

i luffs yeww

2010-07-06 00:28:40

if (Length(ATPA) > 2) then
B := GetTPABounds(ATPA[1 + Integer(not (Members))])//If demo mode is still up
Else
B := GetTPABounds(ATPA[0 + Integer(not (Members))]);//When there's no demo mode

So that means it will only do the Else if ATPA is less than two, so Integer(not(Members)) will always be 1 or 0, yes? 0 + 0 = 0; 0 + 1 = 1. There may not be ATPA[0] or ATPA[1]?

That's all I can think of. :p

NCDS

2010-07-06 00:30:39

From: i luffs yeww
if (Length(ATPA) > 2) then
B := GetTPABounds(ATPA[1 + Integer(not (Members))])//If demo mode is still up
Else
B := GetTPABounds(ATPA[0 + Integer(not (Members))]);//When there's no demo mode

So that means it will only do the Else if ATPA is less than two, so Integer(not(Members)) will always be 1 or 0, yes? 0 + 0 = 0; 0 + 1 = 1. There may not be ATPA[0] or ATPA[1]?

That's all I can think of. :p



if (Length(ATPA) > 2) then
;).

i luffs yeww

2010-07-06 00:36:47

^ wat.

That means that the length could be 0, right? And if they aren't a member then it'd try to do GetTPABounes(ATPA[1]), right?

NCDS

2010-07-06 00:38:28

From: i luffs yeww
^ wat.

That means that the length could be 0, right? And if they aren't a member then it'd try to do GetTPABounes(ATPA[1]), right?


No, that means the length must be greater than 2 for the following code to be executed.

i luffs yeww

2010-07-06 00:40:22

>_> yes, the initial "if" part. But there's an else.

NCDS

2010-07-06 00:45:08

From: i luffs yeww
>_> yes, the initial "if" part. But there's an else.


I see what your saying now. My bad, it's late.

I don't think it's a problem in SRL though as the problem only started happening after he updated MSI's core, and AFAIK no one else has reported this problem happening to them, but I could be wrong.

I'll look into this more in the morning, I'm beat.

Wanted

2010-07-06 01:23:47

TVariant Boolean integer form of true is 255 and not 1, however SCAR and simba interpret them differently. I believe I already corrected this. Check your rev?

NCDS

2010-07-06 03:05:20

From: IceFire908
TVariant Boolean integer form of true is 255 and not 1

Is there a reason for that? Just curious.

Thank you for the info though :)

Narcle

2010-07-06 04:36:29

There is another out of error somewhere in Login. Also a Try/Except is messing up JNI call I believe in Login. Might just have to switch it to If Members then +1 else 0;

PS, Variants are dumb.

ZephyrsFury

2010-07-06 05:46:08

Is there a chance that Length(ATPA) is returning 0 (ie no colour is detected by FindColors)? This could be due to lag and screens not loading fully etc. I think I've had this problem before (along with Login.scar clicking Demo when it shouldn't).

Coh3n

2010-07-06 06:04:22

From: IceFire908
TVariant Boolean integer form of true is 255 and not 1, however SCAR and simba interpret them differently. I believe I already corrected this. Check your rev?

I'm all up to date here, but I don't know why the problem would be in SRL. I never had this issue until I made a bunch of changes to the core or MSI.

From: ZephyrsFury
Is there a chance that Length(ATPA) is returning 0 (ie no colour is detected by FindColors)? This could be due to lag and screens not loading fully etc. I think I've had this problem before (along with Login.scar clicking Demo when it shouldn't).

I would think there should be an if (Length() = 0) then Exit; or something for that then. Also, Login seems to always try to login to members when all of my players are F2P, but I can't figure out why.

Coh3n

2010-07-07 09:58:03

I've added this in Login.scar and I'm going to test right now and see if it's the problem.

if (Length(ATPA) = 0) then
begin
Writeln('Length is 0!');
Exit;
end else
Writeln('Length = '+IntToStr(Length(ATPA)));

Wanted

2010-07-07 12:31:58

I've also noticed this isn't completely reliable, I do not ever get the option to play demo mode anymore and it never clicks the correct members/free tab. I had it working perfectly with all three options (demo|Free|members) but I don't think that it is working 100% anymore. I'm gonna try and fix this today.

Coh3n

2010-07-07 17:01:41

From: IceFire908
I've also noticed this isn't completely reliable, I do not ever get the option to play demo mode anymore and it never clicks the correct members/free tab. I had it working perfectly with all three options (demo|Free|members) but I don't think that it is working 100% anymore. I'm gonna try and fix this today.

Everything seems to be fixed, thanks. :)