Coh3n
2009-07-22 08:39:50
Now that SMART is built into SRL it is very simple to add to scripts. It is your choice on how simple you want to make it. There is only one thing you need to do to make SMART work properly, but I'm going to add another two optional things that can be handy for both you, and the person using your script.
1: All you need to do is add this line to the top of you script:
{$DEFINE SMART}
Make sure you put this line before SRL, otherwise it won't work. The top of your script should now look like this:
program New;
{$DEFINE SMART}
{$i srl/srl.simba}
Now, by only doing this step, your script will load a random F2P signed world in safe mode.
There, simple as that, now you know how to add SMART to any script! Yay! :)
2: This and the next option are completely optional, it's just something I, as well as a lot of other people, find handy. With these few lines you can choose whether you want to load high or low detail and whether you want to use a signed or unsigned client. These four lines will do the trick:
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True; // Signed client?
Smart_SuperDetail := False; // SMART high detail?
SetupSRL;
As of right now, Smart_Server and Smart_Members don't do anything, since the world (and members) are chosen when you log your player in. If you're getting an error loading SMART, you may need to change Smart_Server to another number.Make sure you call those lines before SetupSRL, like I did above, otherwise it won't work.
There, now you can choose all the different SMART details right in your script. :)
3: This is mainly for your own, and the people who uses your script's convenience. You can setup constants at the top of your script so the user doesn't have to scroll all the way down to change the settings. You can do something like this:
program New;
{$DEFINE SMART}
{$i srl/srl.simba}
const
SMART_SIGNED = true;
SMART_HIGHDETAIL = false;
//The rest of your script goes here.
begin
Smart_Server := 10;
Smart_Members := false;
Smart_Signed := SMART_SIGNED;
Smart_SuperDetail := SMART_HIGHDETAIL;
SetupSRL;
end.
There, now you know everything I know about setting up SMART to run on any script. If you have any questions, don't hesitate to ask, and I, or someone else will get back to you as soon as possible. Also, suggestions and criticism is always appreciated.