SRL Archive - S.M.A.R.T. Tutorials

[Workaround] How to auto unsigned in SMART


Macro_FTW

2009-06-20 21:56:58

With the new updates in SRL Rev 35, you no longer need to do SetUpSmartEx.

To customize SMART, you only need to set four variables:

Smart_Members := ; //Members-only world?
Smart_Server := ; //World number
Smart_Signed := ; //Signed?
Smart_SuperDetail := ; //HD

However, the signed one has a glitch in it. If you don't specify a world, you always will get a signed server. Proof:
From SRL\SRL\Misc\Smart.Scar
procedure SmartInitServer;
var
p: String;
begin
if Smart_Server > 0 then Exit;
Smart_Server := RandomWorld(Smart_Members, False);
Smart_Signed := True;
Writeln('SmartInitServer Initialized: Loaded: Server ' + IntToStr(Smart_Server) + ', Free, Signed, Standard Client.');
end;
…Which says if the server is > 0 [predefined], it leaves your settings as-is. Otherwise, it always sets Signed to true all the time, regardless of whether you want it false or not.

Yet, you still want a random world to auto on, as autoing on the same world 24/7 would be less than desirable.

So, for the workaround:

Make a procedure called SetSmart (of course, it can be named whatever you want. ;) ) and put your settings in there. Here is an example:

procedure SetSmart;
begin
Smart_Members := False; //F2P
Smart_Server := RandomWorld(Smart_Members, False); //Random world picked, just as it is when not specified.
Smart_Signed := False; //Unsigned
Smart_SuperDetail := False; //Low detail
end;

This allows us to auto unsigned with a random world.

One more note:
This procedure must ALWAYS be called before SetUpSRL;. SetUpSRL now has the server loading functions built in, so that if these settings aren't defined beforehand, it will load whatever the default server is.

One final example of a program:

program SmartRunnerUnsigned;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}

procedure SetSmart;
begin
Smart_Members := False; //F2P
Smart_Server := RandomWorld(Smart_Members, False); //Random world
Smart_Signed := False; //Unsigned
Smart_SuperDetail := False; //Low detail
end;

begin
SetSmart;
SetUpSRL;
end.

…And that's it. You now know how to auto unsigned on a random world! Congratulations. :p

[[Also, Smart_Members must always be set before calling RandomWorld. Otherwise, RandomWorld will ALWAYS choose a F2P world, even if you want members. ;) ]]


Suggestions/comments/etc. appreciated. :)
~Macro_FTW

Coh3n

2009-06-29 04:23:36

Okay I guess I'll be the first to comment on this tutorial. :p

I like it, I think it's awesome. I do have a suggestion. AFAIK there isn't any other updated SMART tutorials out there (not any all-in-one TUTs anyway) and I was thinking, if you wanted to, you could expand on this TUT and have sections like "What is SMART?" and "How to add SMART to any script." Things like that.

Obviously you don't have to do this, it's just a thought. :) Also, if you decided to do this, I'm sure a Mod would be more than happy to change the title for you. ;)

Anyway, awesome tutorial, Rep+ (again ;)).