Doesn't necessarily need to be in your mainloop.. In all of my scripts I have a procedure called SetupLogin where I put all of the general setting up business like so..
procedure SetupLogin;
begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 10;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
DeclarePlayers;
ActivateClient;
if not LoggedIn then
LoginPlayer;
Wait(RandomRange(2000,3000));
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('n');
ToggleXPBar(True);
OriginalXP := GetXPBarTotal;
ExitSquealOfFortune;
end;
Keep in mind it needs to be BEFORE your declaration of SetupSRL wherever you choose to put it. Treat the sixhourfix and fix speed as how you used to define SMART with smart_server and members etc.