pwnaz0r
10-14-2007, 02:33 AM
Ok, well since alot of people had trouble using SRL Stat's, I thought I would post this here to help you guys out :D. (hy71194 :D)
Contents:
Setting up your own SRLId
Setting up Your Script Stats on SRL
Understanding SRLId and SRLPassword
Using Script Stats in your script
Setting up your own SRLId
To start off using SRL Stats, you must first make your own ID. To make a new id, go here (http://www.stats.srl-forums.com/?action=register). You will have to answer a confirmation letter through your email address so you can recover your SRL Id password if you loose it. Note that your SRL Stats Id (SRLId) is not the same as your username on SRL Forums!. Now, with your SRLId setup, you can add your SRLId (not your username, the number they give you) and your SRLPassword (the password for your SRLId) into certain scripts that support SRL Stats. This may be in declare players or in the constants at the top. If the script has SRL Stats, there must be a place for you to put your SRL Id and password.
Setting up Your Script Stats on SRL
Ok, now to learn how to set up a Script Stats page. This is not hard since SRL has so professionally added a template for you to fillout. Go here (http://www.stats.srl-forums.com/?action=register_script) to register a script. You need to insert variables that apply to your script only, such as rocks mined. All of the random variables are included for you. After filling in this template, SRL will give you a script id. Hold on to this number! you will need it!
Understanding SRLId and SRLPassword
Now, one of the biggest things that I had trouble with in the beginning of trying to learn SRL Stats was "why doesn't the SRL Stats register!", even after I did everythign right? Well the answer is(are you ready?): you must have a SRLId and a SRLPassword stated in your script before any stats can be sent. Therefore, if you dont enter any id or password, your script stats simply wont be sent!. Now SRLId and SRLPassword are variables, therefore you cannot add them to the constants. SO, there are two ways you can tell the script the SRL ID and Pass.
1. Make a constant with a similar name at the beginning of the script(like so)
YourSRLId = '';
YourSRLPassword ='';
note that these are not the same as SRLid and SRLPassword because they have your infront. Now add this at the beginning of the mainloop.
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
And now the second option.
2. Simply add this to DeclarePlayers (or whatever your procedure is named to declare your players)
SRLId:= '';
SRLPassword:= '';
either way, SRLid and SRLpassword will be set.
Using Script Stats in your script
Ok now, to the best part adding srl stats to your script. Now remember that Script Id I was telling you to keep? THIS IS WERE YOU NEED IT. At the beginning of your script, possible right after SetupSRL say
ScriptId:= '(ScriptIDHERE)';
so SCAR will know where to send the stats. Now every custom variable you set has a number. The first variable would be zero, the second would be 1 etc. Now these vars are called SRLReportVars. So, lets say you put "Rocks Mined" as your first var (check here (http://www.stats.srl-forums.com/index.php?action=view_script&id=287) for an example of this). Now, everytime I mined a rock, I would put.
SRLReportVars[0]:= 1;{Report var 0 because it was the first var and it equals 1 because
we mined one rock}
SendSRLReport;
every time you call SendSRLReport your variables get set back to zero!. Also, note that this does not depend on the number already in script stats.
SO DO NOT SAY
ReportVars[0]:= ReportVars[0] + 1;
THIS IS WRONG!
Last but not least, Call SRLRandomsReport in your progress report and you should be set!
Contents:
Setting up your own SRLId
Setting up Your Script Stats on SRL
Understanding SRLId and SRLPassword
Using Script Stats in your script
Setting up your own SRLId
To start off using SRL Stats, you must first make your own ID. To make a new id, go here (http://www.stats.srl-forums.com/?action=register). You will have to answer a confirmation letter through your email address so you can recover your SRL Id password if you loose it. Note that your SRL Stats Id (SRLId) is not the same as your username on SRL Forums!. Now, with your SRLId setup, you can add your SRLId (not your username, the number they give you) and your SRLPassword (the password for your SRLId) into certain scripts that support SRL Stats. This may be in declare players or in the constants at the top. If the script has SRL Stats, there must be a place for you to put your SRL Id and password.
Setting up Your Script Stats on SRL
Ok, now to learn how to set up a Script Stats page. This is not hard since SRL has so professionally added a template for you to fillout. Go here (http://www.stats.srl-forums.com/?action=register_script) to register a script. You need to insert variables that apply to your script only, such as rocks mined. All of the random variables are included for you. After filling in this template, SRL will give you a script id. Hold on to this number! you will need it!
Understanding SRLId and SRLPassword
Now, one of the biggest things that I had trouble with in the beginning of trying to learn SRL Stats was "why doesn't the SRL Stats register!", even after I did everythign right? Well the answer is(are you ready?): you must have a SRLId and a SRLPassword stated in your script before any stats can be sent. Therefore, if you dont enter any id or password, your script stats simply wont be sent!. Now SRLId and SRLPassword are variables, therefore you cannot add them to the constants. SO, there are two ways you can tell the script the SRL ID and Pass.
1. Make a constant with a similar name at the beginning of the script(like so)
YourSRLId = '';
YourSRLPassword ='';
note that these are not the same as SRLid and SRLPassword because they have your infront. Now add this at the beginning of the mainloop.
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
And now the second option.
2. Simply add this to DeclarePlayers (or whatever your procedure is named to declare your players)
SRLId:= '';
SRLPassword:= '';
either way, SRLid and SRLpassword will be set.
Using Script Stats in your script
Ok now, to the best part adding srl stats to your script. Now remember that Script Id I was telling you to keep? THIS IS WERE YOU NEED IT. At the beginning of your script, possible right after SetupSRL say
ScriptId:= '(ScriptIDHERE)';
so SCAR will know where to send the stats. Now every custom variable you set has a number. The first variable would be zero, the second would be 1 etc. Now these vars are called SRLReportVars. So, lets say you put "Rocks Mined" as your first var (check here (http://www.stats.srl-forums.com/index.php?action=view_script&id=287) for an example of this). Now, everytime I mined a rock, I would put.
SRLReportVars[0]:= 1;{Report var 0 because it was the first var and it equals 1 because
we mined one rock}
SendSRLReport;
every time you call SendSRLReport your variables get set back to zero!. Also, note that this does not depend on the number already in script stats.
SO DO NOT SAY
ReportVars[0]:= ReportVars[0] + 1;
THIS IS WRONG!
Last but not least, Call SRLRandomsReport in your progress report and you should be set!