SRL Archive - S.M.A.R.T. Questions and Answers.

Smart and Simba; IsClientReady Function


Lipcot

2014-08-06 16:33:15

Hey guys, i made a thread a while ago because my client is different from people in other parts of the world (cause of my Latin america IP), thus i can not currently Auto-login using Simba and Smart.
A possible solution proposed to me in the other thread i made was using a VPN, which i believe would solve my problem but this would cost $$$ and would make my connection slower.
So, i started looking around a bit and found that maybe, if someone helped me change the "isClientReady();" function i could make Simba recognize my (custom) login screen and start my script ( in which i added a procedure to make me login).
I´ve been trying to change the function, but due to my limited knowledge on scripting i was unable to do it succesfuly :duh:. So if someone could help me with this i would be really happy :spot:.

This is the screen my RS loads into (in which i have to click "Login To Jagex Account" and i get taken to the original and same as your login screen):


And this is the SRL code regarding the Client Login i believe i should change:

(*
Client
======

The Client file holds functions that have anything to do with the RS client or
client settings.

The source for this file can be found `here <https://github.com/SRL/SRL-6/blob/master/lib/core/client.simba>`_.

*)

{$include_once ../interfaces/lobby/lobby.simba}
{$include_once ../core/players.simba}

{$f-}

(*
isClientReady
~~~~~~~~~~~~~

.. code-block:: pascal

function isClientReady: Boolean;

Returns true if we are ready to auto (on loginscreen or logged in).
Useful for waiting until RS has fully loaded.

.. note::

- by ZephyrsFury
- Last updated: 22 July 2013 by Coh3n

Example:

.. code-block:: pascal

while (not isClientReady()) do
SleepAndMoveMouse(100 + Random(500));
*)
function isClientReady(): boolean;
begin
Result := (isLoggedIn() or lobby.isOpen() or __setInputBoxes());
end;

(*
waitClientReady
~~~~~~~~~~~~~~~

.. code-block:: pascal

function waitClientReady(): boolean;

Waits until the client is ready. Will terminate the script if the client loaded
isn't set to fixed size.

.. note::

- by Coh3n
- Last updated: 18/04/2012 by Ollybest

Example:

.. code-block:: pascal

if (waitClientReady()) then
writeln('Client is ready!');

*)
function waitClientReady(): boolean;
var
t: UInt32;
i: integer;
begin
result := false;

t := getSystemTime();
i := 1;

{$IFNDEF SMART}
print('You are not using SMART, be sure to use Simba''s crosshairs'+
' to select the RS client.', TDebug.HINT);
{$ENDIF}

print('Waiting up to 5 minutes for RS to load...');

while ((getSystemTime() - t) < (5 * 60000)) do // 5 minutes
begin
if (isClientReady()) then
exit(true);

if ((getSystemTime() - t) > (i * 60000)) then // each minute
begin
print(intToStr(i) + ' minute(s) have passed, client is not ready yet');
inc(i);
end;

wait(2000);
end;
end;

Thank you, Undorak7

Lipcot

2014-08-07 17:21:29

Bumpity bump! been trying all day to make it work but epic faillsss :fiery:

tls

2014-08-07 18:29:42

run this for me:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
begin
setupsrl;
Wait(10000);
savescreenshot('a.png');
end.

Unfold

2014-08-07 18:55:38

Why does your rs look so different?

tls

2014-08-07 19:01:47

From: tls
run this for me:
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}
begin
setupsrl;
Wait(10000);
savescreenshot('a.png');
end.


It should save the image to your simba directory, upload it here.

Lipcot

2014-08-08 20:56:06

double posted, Sry

Lipcot

2014-08-08 20:57:17

From: tls
It should save the image to your simba directory, upload it here.



nothing happened because it does not recognize the RS client when it loads like that :( . it went "1 minute has passed client is no" "2 minutes have passed.." etc etc.

The Mayor

2014-08-08 21:47:00

From: undorak7

nothing happened because it does not recognize the RS client when it loads like that :( . it went "1 minute has passed client is no" "2 minutes have passed.." etc etc.


It waits until it can see the Username and Password boxes. How do you login? Do you click "Login To Jagex Account" or the "Haz Click Aqui" button? Do you have to enter your username/pw? If so, post a screenshot of the next screen too.

Lipcot

2014-08-08 22:16:16

From: The Mayor
It waits until it can see the Username and Password boxes. How do you login? Do you click "Login To Jagex Account" or the "Haz Click Aqui" button? Do you have to enter your username/pw? If so, post a screenshot of the next screen too.


yes indeed, it waits until it can see the username and password boxes. NO i do not have to enter user/pass manually
I login by doing to following: click "disable Smart" -> click "login to jagex account" -> click enable smart. and then the script will proceed normally logging into my account (putting username and password, etc ,etc)

This is the next screen:

If you wish i can upload a video tomorrow to make it more explicit.

Thanks, Undorak7 :norris:

The Mayor

2014-08-08 22:44:28

From: undorak7
yes indeed, it waits until it can see the username and password boxes. NO i do not have to enter user/pass manually
I login by doing to following: click "disable Smart" -> click "login to jagex account" -> click enable smart. and then the script will proceed normally logging into my account (putting username and password, etc ,etc)

This is the next screen:

If you wish i can upload a video tomorrow to make it more explicit.

Thanks, Undorak7 :norris:


I can make you a modified players.simba that will click the "login to jagex account" and then proceed as normal.

Lipcot

2014-08-08 23:27:24

From: The Mayor
I can make you a modified players.simba that will click the "login to jagex account" and then proceed as normal.


Im in love with you dude, hahah :garfield:
anyways, thats what i´ve been trying to do but been unable to! so if you could give me a hand with this i will be very grateful

Thank you, Undorak7

The Mayor

2014-08-08 23:49:49

From: undorak7
Im in love with you dude, hahah :garfield:
anyways, thats what i´ve been trying to do but been unable to! so if you could give me a hand with this i will be very grateful

Thank you, Undorak7


try this:

C:\Simba\Includes\srl-6\lib\core\players.simba

Lipcot

2014-08-09 12:26:24

From: The Mayor
try this:

C:\Simba\Includes\srl-6\lib\core\players.simba



worked like a charm :wow: ! Thank you very much mayor for your support

The Mayor

2014-08-09 15:58:09

From: undorak7
worked like a charm :wow: ! Thank you very much mayor for your support


np :)