SRL Archive - Outdated Tutorials

Temp Stats, using for scripting and general usage.


Wanted

2009-12-29 18:37:21

I. About SRL Stats

Temp Stats are the current alternative to the regular SRL stats system which has been under construction for quite some time now.

The Stats system is a way for scripts and script users to log total time, randoms, logins, ores mined, logs chooped ect.. for each and every script there is to offer on SCAR. It's basically an online data base that tally's up a scripts run time, your time using that script, and your total SCAR auoting… as well as everyone else's. It can also be used to remotely control your players info like .Active and loc.

II. Registering/ using your ID


Official homepage: http://scriptmanager.freehostia.com/index.php
Here is where you can register: http://scriptmanager.freehostia.com/register.php

Once you have registered you can click My Profile in the upper right corner where it will give you your profile page. Here you can see various statistics based on your macroing history which include scripts you have released (near bottom), times you used each script (very bottom), and your runescape account statuses (on the right.. don't worry it only logs your username/.Loc which is only visible to you) there you can change any variables you want it the script you are using will update during runtime.

The most important thing on this page is your UID number which will be labeled near the top (User ID 0) well not '0' but whatever it is, this number along with your login password to the main site will be what you use when filling in the setup fields in the script you are using. Just remember some scripts are updated via SVN and might reset it when you update… remember to check/update your script stats information before you run a script and ALWAYS make sure you remove that info if you are uploading a script to the public or committing a file to an SVN server.

Here is what POMS and RCrB info fields will look like:

const
YourStatsUserID = '0'; //User UID from scriptmanager.freehostia.com
YourStatsPass = 'yourpasshere'; //Your pass from scriptmanager.

III. Viewing statistics

'My Profile' is where you can observe all your individual run times for individual scripts as well as your total randoms/ time/ user rank.

'Users' http://scriptmanager.freehostia.com/users.php?pagec=50&monthsb=3&mintime=0 is where you can see who has the most run time on their account.

'Scripts' http://scriptmanager.freehostia.com/scripts.php is where you can see what all scripts are in the data base and what scripts have the highest total time, and if you click on anyone of the scripts it will open more information about that script. For example: http://scriptmanager.freehostia.com/scripts.php?sid=3 shows Total time for that script, last connection, total randoms, lots of custom vars like ess crafted ect.

Always SCAR to connect to internet and files!

if you want, here is a custom sig for your individual run time

just put in your ID and put in IMG tags

http://scriptmanager.freehostia.com/signature/signature.php?uid=YOURIDHERE

like this


if you are not a scripter and are not interested in scripting then you can leave the thread now as the next part of the script is nothing you need to worry about.

IV. Submitting scripts and using Stats in SCAR scripts

This will explain how you implement stats into your very own script. The first thing you need to do is get a copy of the current stat functions which you can find in the SRL member news section on this thread if you do not have access to SRL members section, one reliable place you can find the info you need is POMS svn where it is usually up to date here: http://srlpoms.googlecode.com/svn/trunk/Includes/SRLStats.scar . once you have the code it is important that you move all the global variables to the be with the rest of the global variables in your script near the top. Then you can place all the functions (4 of them currently) above the functions/procedures in your script to where you can call them below where ever you need to.

Update: Now you can simply add {.include SRL\SRL\Misc\Stats.scar} to your script below {.include SRL\SRL.scar}

Once you have done all that you will need to submit a script at 'My profile' -> release script. There you will need to fill in all the correct information about the script as well as custom variables (if you want custom vars that is). After you have done that go to your script's page and find it's ID number make sure this is not the same as your User ID number as submitting info to the wrong script is huge penalty/pain in the ass to that script owner.

Now that you have a registered script ID and all the functions and variables in place you will need to find where your variables need to be located:

Examples:

OresMined := OresMined + 1;
Stats_CustomVars[1] := Stats_CustomVars[1] + 1;

Inc(LogsChopped);
Inc(Stats_CustomVars[7]);

IncEx(TotalEss, EssenceBeingCarried);
IncEx(Stats_CustomVars[4], EssenceBeingCarried);

for adding banking:

Inc(Banks);

or

Banks := Banks + 1;

Logins is automatically managed by LoginPlayer and NextPlayer and whatnot, but it doesn't record the first login for some reason so that's an easy fix, right after LoginPlayer just do this

  if (SRL_Logs < 1) then
SRL_Logs := 1;

then you will need to add

  SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;

where it loops once a trip to send all the info to the server.

Add a simple simple user friendly account input at the top of your script

const
YourStatsUserID = '0'; //User UID from scriptmanager.freehostia.com
YourStatsPass = 'yourpasshere'; //Your pass from scriptmanager.

lastly find SetUpSRL; highlight delete it and replace it with this:

  SetUpSRL;
Stats_Link := 'http://scriptmanager.freehostia.com/submit.php';
Stats_ScriptID := '0'; //SCRIPT ID # HERE!
Stats_UserID := YourStatsUserID;
Stats_Password := YourStatsPass;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;

Always allow it to connect to internet and files!

If you followed all this correctly you should have working stats.

Comments/questions/concerns?

Gu3st...

2009-12-29 18:45:09

Good job! :D
I guessed that you were making one of these tutorials now that you had your dynamic sig.. :P

I can't find anything to fix/edit…

Ultra

2009-12-29 23:54:28

This should be moved, in my opinion.

Thanks for tutorial.

Wanted

2009-12-29 23:56:10

From: Ultra
This should be moved, in my opinion.

Thanks for tutorial.


Moved where?

Dynamite

2009-12-30 05:10:27

I made this, but hey :p

Sir R. M8gic1an

2009-12-30 07:52:49

Stickyfied.

~RM

Floor66

2009-12-30 08:34:02

Who did the PHP? ;P Looks good :)

Gu3st...

2010-01-18 13:06:11

Where is the "I lost my password"-button? :)

Wanted

2010-01-18 13:16:38

From: Zyt3x
Where is the "I lost my password"-button? :)


Don't think there is one

Ask about it here http://www.villavu.com/forum/showthread.php?t=48887

karlkarlngng

2010-02-11 21:54:00

um ima noob so i want to know whats the update button when u click profile den your accounts

Hexinist

2010-04-11 20:34:54

RCrB Sounds awesome, sucks that it doesn't work anymore =\

Sex

2010-04-11 20:58:48

From: Floor66
Who did the PHP? ;P Looks good :)

How do you know that it looks good if you can't see the php :P. But Nielsie did.

i luffs yeww

2010-04-11 22:30:04

I think he means the end result looks good. ;)

aran armath

2010-04-22 18:30:58

I did something wrong,

Line 316: [Error] (23308:1): Variable Expected in script C:\games\scarprerelease\Scripts\ss.scar

Frement

2010-04-22 18:35:05

From: aran armath
I did something wrong,

Line 316: [Error] (23308:1): Variable Expected in script C:\games\scarprerelease\Scripts\ss.scar


Well, lines 310-320 would be nice to be included :)

aran armath

2010-04-22 18:40:12

procedure Setupsrl1;
begin
SetUpSRL;
DeclarePlayers;
Stats_Link := 'http://scriptmanager.freehostia.com/submit.php';
Stats_ScriptID := '49'; //SCRIPT ID # HERE!
Stats_UserID := YourStatsUserID;
Stats_Password := YourStatsPass;
end;

I dont think that contains the problem, but I really have no clue.

i luffs yeww

2010-04-22 18:48:33

^ do you have


const
YourStatsUserID = '0'; //User UID from scriptmanager.freehostia.com
YourStatsPass = 'yourpasshere'; //Your pass from scriptmanager.

at the beginning of your script?

aran armath

2010-04-22 19:35:53

const
SmartWorld = 15; // Which World/Server do you want to use?
SmartMembers = False; // Is it a Members World?
SmartSigned = True; // Signed/UnSigned Client?
SmartSuperDetail = False; // Use Super Detail?
YourStatsUserID = ''; //User UID from scriptmanager.freehostia.com
YourStatsPass = ''; //Your pass from scriptmanager.

i luffs yeww

2010-04-22 22:59:34

Can you say which lines are which? (Or just ACTUALLY copy lines 310-320.)

aran armath

2010-04-23 10:03:30

Figured it out finally. Had STATS_LINK twice in the script.

i luffs yeww

2010-04-24 04:04:22

:p Yeah.. I PM'd you the fixed version anyway, since I didn't see this post.

EvilChicken!

2010-12-31 09:34:25

Unstickied. :)