SRL Archive - General Botting Help

Stumped, something wrong with my logic?


Ian

2014-05-03 19:16:56

Background:
This part of the code should be waiting until the bankScreen is closed or the time since mark T is past 2500-3500. The issue is that the bankScreen closes as it should, but the script does not continue on to the writeLn immediately after the loop. It stops writing True once the bankScreen has closed, so I don't think it's stuck in the loop still. I'm just not sure what it's doing. Also the script does not end itself, it just doesn't do anything. Eventually RS logs it out due to inactivity. Also this does not happen every time, maybe 1/30 of the time or less.

If anyone has any ideas of what it is doing it would be very helpful.

Here is the part of the code that is not acting as I think it should:

T.start;
R:= randomRange(2500, 3500);
writeLn('Waiting for bankScreen to close.');
while (bankScreen.isOpen) and (T.getTime < R) do
begin
wait(random(100));
writeLn(bankScreen.isOpen);
end;
writeLn('test?');

This is the debug from that:

Waiting for bankScreen to close.
True
True
True
True
True
True
True
True
True
True
True
True
True
True

The Mayor

2014-05-03 19:28:15

I assume you declared your variables correctly, so update your SRL.

Turpinator

2014-05-03 20:05:37

do you want or?

Ian

2014-05-03 20:07:00

From: The Mayor
I assume you declared your variables correctly, so update your SRL.

T is a TTimeMarker and R is an Integer, so they should be correct.
Still using the version of SRL from here, so I don't want to update it. In any case bankScreen.isOpen seems to function fine so I don't think that is it.

From: Turpinator
do you want or?


I think I want and because I want it to wait while the bankscreen is open and the time is less than r. So if either of them are false, I want it to break from the loop.

Turpinator

2014-05-03 20:27:57

From: BMWxi
I think I want and because I want it to wait while the bankscreen is open and the time is less than r. So if either of them are false, I want it to break from the loop.


thats what its doing. it will run while the bank screen is open and until it times out. so you basically want it to sit at the bank for 2.5-3.5 sec?

Ian

2014-05-03 20:33:32

From: Turpinator
thats what its doing. it will run while the bank screen is open and until it times out. so you basically want it to sit at the bank for 2.5-3.5 sec?


If the bankscreen does not close, yes. Then after that it will attempt to close it again. The issue is that it is waiting much longer than 2.5-5.5 seconds, the bankscreen is closed (so it shouldn't be waiting at all at that point), and it doesn't appear to be still in the loop (because it stops printing True). So it should be moving on but isn't.

rj

2014-05-03 21:32:48

Uhh I doubt this would make a difference but you should always use () when your invoking a function

T.start();
R := randomRange(2500, 3500);
writeLn('Waiting for bankScreen to close.');
while (bankScreen.isOpen()) and (T.getTime() < R) do
begin
wait(random(100));
writeLn(bankScreen.isOpen());
end;
writeLn('test?');

Ian

2014-05-03 21:40:58

From: Robert
Uhh I doubt this would make a difference but you should always use () when your invoking a function (I'm surprised the compiler didn't call you out when you didn't use () in the writeln, but I think that's only if you add other things to the writeln)

T.start();
R := randomRange(2500, 3500);
writeLn('Waiting for bankScreen to close.');
while (bankScreen.isOpen()) and (T.getTime() < R) do
begin
wait(random(100));
writeLn(bankScreen.isOpen());
end;
writeLn('test?');


That would be necessary if I was writing code for the include as SRL's files disable lape's auto-invoke feature, but lape deals with that by default in other files. So it shouldn't make a difference.

Turpinator

2014-05-04 01:53:19

From: BMWxi
That would be necessary if I was writing code for the include as SRL's files disable lape's auto-invoke feature, but lape deals with that by default in other files. So it shouldn't make a difference.


Waiting for bankScreen to close.
47
True
110
True
203
True
250
True
281
True
359
True
468
True
515
True
593
True
702
True
765
True
858
True
983
True
1046
True
1108
True
1170
True
1202
True
1311
True
1373
True
1451
True
1529
True
1592
True
1670
True
1763
True
1857
True
1950
True
1982
True
2060
True
2169
True
2262
True
2387
True
2465
True
2528
True
2574
True
2652
True
2762
True
2840
True
2918
True
test?

and then… closing it out mid wait…
Waiting for bankScreen to close.
47
True
125
True
250
True
359
True
421
True
530
True
640
True
686
it just sits there…
hmm

tiffanygraff

2014-06-03 03:10:22

Nice thread you have to share here,, thanks