I added a wait in InPin,in my version to compensate for lag....
I added a wait in InPin,in my version to compensate for lag....
Hey I noticed this aswell as the one where sometimes it types the username and password in the Username box and never logs you in unless you disable it and login manually or restart the script.
I am Ggzz..
Hackintosher
We shouldn't just be using a wait..? Do we not check to see if the numbers have moved? :x
I'll make a change and post it.
Uh, the numbers are all client-side (until you fill all four - then it sends to the RS server). Unless your computer is lagging bad, it shouldn't have any issues. But more failsafes are always nice.
Send SMS messages using Simba
Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!
Just increase the wait.. I even commented that line so it should be easy to understand what to do if it was too fast / slow
Why just increase the wait? :x The most logical thing to do, in my opinion, is just to do something easy like make a TPA of the first found yellow point in each box and then if that TPA has changed, the numbers have been updated. That would only add a few lines and would make it so lag doesn't matter.
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
Doesn't have a little set of four characters that change when you put in a number? Use that.
The text saying "Please click the first number" or w/e changes for each number ("second", "third", "forth"). So we can use that.
I just haven't been on windows long enough this whole time to do this.A CountColor would be all you'd need.
It was a simple fix:
Simba Code:function InPin(Pin: string): Boolean;
var
Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer;
Boxes: array of TBox;
begin
Result := False;
if not PinScreen then Exit;
if (GetNumbers(Pin) <> Pin) then
begin
srl_Warn('InPin', '''' + Pin + ''' is not a valid Pin', warn_AllVersions);
Exit;
end;
if (Length(Pin) <> 4) then
begin
srl_Warn('InPin', 'Pin must be 4 digits long', warn_AllVersions);
Exit;
end;
Boxes := [IntToBox(37, 107, 100, 170), IntToBox(127, 107, 190, 170), IntToBox(217, 107, 280, 170), IntToBox(307, 107, 370, 170),
IntToBox(37, 179, 100, 242), IntToBox(127, 179, 190, 242), IntToBox(217, 179, 280, 242),
IntToBox(37, 251, 100, 314), IntToBox(127, 251, 190, 314), IntToBox(217, 251, 280, 314)];
while PinScreen do
begin
for I := 1 to 4 do
begin
if not PinScreen then Break;
ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10);
// Counts the "Now click the NUM_X digit.". This is used later on.
GetMousePos(X, Y);
if (FindText(Tx, Ty, Pin[I], UpChars, 30, 100, 383, 319)) then
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(Tx, Ty, Boxes[J]) then
begin
with Boxes[J] do
if PinScreen then
MouseBox(x1, y1, x2, y2, 1);
Break;
end;
end else
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(X, Y, Boxes[J]) then
begin
with Boxes[J] do
if PinScreen then
MouseBox(x1, y1, x2, y2, 1);
Break;
end;
end;
Wait(100);
while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do
Wait(500);
if BankScreen then
begin
Result := True;
Exit;
end;
end;
WaitFunc(@BankScreen, 50, 300);
ClickContinue(True, True);
while not FindColor(Tx, Ty, 0, 7, 460, 69, 474) do
begin
Wait(500);
if not LoggedIn then
Exit;
end;
Inc(Tries);
if Tries > 2 then
begin
srl_Warn('InPin', '''' + Pin + ''' is not the correct Pin', warn_AllVersions);
ClosePinScreen;
Exit;
end;
end;
Result := BankScreen;
end;
E: diff:
Code:mar 15 18:28:37 2011 @@ -115,7 +115,7 @@ *******************************************************************************} function InPin(Pin: string): Boolean; var - Tx, Ty, X, Y, H, I, J, Tries : Integer; + Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer; Boxes: array of TBox; begin Result := False; @@ -141,6 +141,10 @@ for I := 1 to 4 do begin if not PinScreen then Break; + + ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10); + // Counts the "Now click the NUM_X digit.". This is used later on. + GetMousePos(X, Y); if (FindText(Tx, Ty, Pin[I], UpChars, 30, 100, 383, 319)) then begin @@ -166,7 +170,9 @@ end; end; - Wait(200+Random(100)); // Had to add a wait here because humans aren't that fast. + Wait(100); + while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do + Wait(500); if BankScreen then begin @@ -1243,4 +1249,4 @@ end else Writeln('Could not find the deposit box'); end; -end; \ No newline at end of file +end;
Last edited by Zyt3x; 03-15-2011 at 10:55 PM.
I just changed the wait(200+random(100)) to wait(400+random(300)), not because my computer was lagging, but it was too quick to seem human and sometime after clicking the fourth number, it'd go to click the first number again thinking the pin screen stayed open from entering the wrong pin. So the extra 200 ms helped make it not do that for me and looks more human in my opinion between clicking numbers.
Yeah I have the same problems with this as well. I think the smartest fix for this is to get rid of the wait between inputting the different pin numbers, and instead go by the pin number displayed at the top of the screen. ("...Choose the SECOND number...") That way we know we're ready to click the next number.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I'm going to give Zyt3x's a shot soon, I'll have to simulate some lag to see if it really is a fix. I suppose loading multiple youtube videos would do the trick.I'll let ya know after wards how it turns out.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
Zyt3x's worked fine for me, I'm not really sure what what the changes were that he made, and I couldn't really 'lay' on a heavy amount of lag at the time, but it worked successfully when I tried.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
What Zytex did was what I was thinking. I personally don't like to rely on 'waits' to continue a function. Always good to have a repeating loop of a wait to confirm the next step.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
Committed.![]()
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
There are currently 1 users browsing this thread. (0 members and 1 guests)