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

Smart Test


Morten4800

2008-12-22 16:21:49

Hello guys, i found a script on the smart forum tutorial section about testing smart.

I used this script:

program TestSMARTLogin;

{.Include SRL\SRL\Misc\SMART.SCAR}
{.Include SRL\SRL.SCAR}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'mynameinhere';
Players[0].Pass := 'mypasswordinhere';
Players[0].Nick := 'letters'; //3-4 letters from name
Players[0].Active:= True;
end;

begin
SMARTSetUp('world38', True, True, False); {World prefix, safe mode, unsigned, RS-HD}
SetTargetDC(SMARTGetDC);
SetUpSRL;
DeclarePlayers;
LogInPlayer;
Wait(2000);
MMouse(388, 281, 3, 3);
Wait(2000);
MMouse(4, 100, 3, 3);
Wait(3000);
LogOut;
TerminateScript;
end.


but then it writes: Line 18: [Error] (16330:41): Invalid number of parameters in script

So what is wrong? I have scar 3.15b, and rev #30, just installed it.

Method

2008-12-22 16:26:46

That tutorial is outdated. We now use SmartSetupEx with a world number instead of prefix for the first parameter.

Morten4800

2008-12-22 16:29:05

okay, how works it then? Can you give me a tutorial? Its seems like that the tutorials in here is out of date if we dont use prefixs no longer

Method

2008-12-22 16:35:22

All you need to do is change the function call to SmartSetupEx and use a number instead of a string for the first parameter.

Morten4800

2008-12-22 16:41:34

Can you give me a example? Im suck at coding xD

begin
SMARTSetUpEx('world38', True, True, False); {World prefix, safe mode, unsigned, RS-HD}
SetTargetDC(SMARTGetDC);
SetUpSRL;
DeclarePlayers;
LogInPlayer;
Wait(2000);
MMouse(388, 281, 3, 3);
Wait(2000);
MMouse(4, 100, 3, 3);
Wait(3000);
LogOut;
TerminateScript;
end.

or how? (just change the code for me pls) :)

Method

2008-12-22 16:45:26

Change the first parameter ('world38') to a number (38, for example).

Morten4800

2008-12-22 16:47:44

begin
SMARTSetUpEx('38', True, True, False); {World prefix, safe mode, unsigned, RS-HD}
SetTargetDC(SMARTGetDC);
SetUpSRL;
DeclarePlayers;
LogInPlayer;
Wait(2000);
MMouse(388, 281, 3, 3);
Wait(2000);
MMouse(4, 100, 3, 3);
Wait(3000);
LogOut;
TerminateScript;
end.

but it say this now: Line 18: [Error] (16330:38): Type mismatch in script :S

Method

2008-12-22 16:57:20

Notice how the first example I gave (the one you originally had) had apostrophes in it, while the second one didn't. One is a string, and one is an integer. Remove those and you should be fine.

Morten4800

2008-12-22 17:10:20

thanks mate, it works now. But do you know how to fix the problem with member login? I have chosed a free world, and i can't login because it says i have to be member

HyperSecret

2008-12-22 17:12:45

SMARTSetUpEx(38, True, True, False); 

Replace 38 with world number as necessary.

SMARTSetupEx is now these parameters though :

procedure SmartSetupEx(worldnumber: integer; members, signed, superdetail: boolean);

Boolean - True/False (True = yes, False = No);
Integer - A Number

SMARTSetupEX(38, Members World? (True or False), Signed Client(True or False), High-Definition (True or False));

When I auto I use this for free-to-play

SMARTSetupEx(WorldNumber, False, False, False);

When autoing on a pay-to-play (members) world I use this

SMARTSetupEx(WorldNumber, True, False, False);

Hope that helped.

Also make sure your world number corresponds to the correct type of world.

Ex: World 100 is a members world so the boolean for that would have to be True, so it loads members.

Morten4800

2008-12-22 17:22:00

Thanks mate.

THAT helped me ALOT ;)