Results 1 to 9 of 9

Thread: The newbie guide to stats

  1. #1
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default The newbie guide to stats

    Hello! Chances are you were linked here from a thread where you got confused on how to setup stats.

    Every script is different! This is why we setup stats the way we do, so every script can use your stats and you the user only has to set it up once!
    That's right, once!


    Lets get started:
    What is stats, why do we use it?
    Stats is a system to keep track of everything we can think to keep track of.. exp made for everything, per script, per user, totals for example. Or even lobsters caught and cooked.
    Here you can see a great example of a script with many variables, remember to click the variable names on the bottom to toggle on/off
    http://stats.grats.pw/variable.php?sid=7

    and here you can see a great example of a script with many users:
    http://stats.grats.pw/script.php?sid=5

    as a scripter it's nice to know your script gets used and how much
    as a user it's nice to see all the scripts you use and compete for # 1 on a script

    But how do I set it up!?!?
    Well that's easy, most likely you've already gone here: http://stats.grats.pw/reg.php and registered
    From this page we get:
    email - what we use to login on the website and (assuming it's an actual email) what we use to recover password. You do not have to use an email for this field, however password recovery will not work if you don't. That's all.
    Nickname - This is your public name on the stats website, it's what other people see you as and what you see yourself as in graphs etc.
    Password - This is.. your password, used to commit to stats through a simba script AND used to login on the web page.
    ID - This is used to commit via scripts, this will be given to you after your first login.

    So now to the actual setup part, lets assume you've registered, now lets login! http://stats.grats.pw/login.php
    After logging in you will be on the front, homepage. You should see something like this:

    This tells you exactly what you need to know
    Your ID!
    Now some scripts have a nice GUI for you to input your ID and password in, however a lot do not. Lets manually set it up once so every script forever will be able to access your stats info and you won't have to put that in anymore:

    Navigate to:
    C:\Simba\Stats
    In there should be an Info.txt
    no? Lets make one, open up notepad!

    It should look like this!
    Code:
    [General]
    Stats_ID=YOUR ID #
    Stats_Pass=YOUR PASS
    You're done!

    This info can be found here reiterated by @Flight; who also made the simba system to commit to stats, thanks Flight!




    Post below if you have ANY questions and I will add more instruction.




    Here's a speedy video.
    This video ASSUMES you have registered already.. and logged in.

    http://youtu.be/MY9RcWNZ1MM
    the video is made to be quick, if you want more info.. read!
    there is 1080p on the video so everything is clear and easy to read.
    Last edited by grats; 06-26-2015 at 08:19 AM.
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  2. #2
    Join Date
    Mar 2015
    Location
    Netherlands
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Thanks for this, handy to know.

  3. #3
    Join Date
    Apr 2015
    Posts
    20
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Is there a way to view user stats? I wanted to see how much xp I've gained from botting =D

  4. #4
    Join Date
    Dec 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    This is great, using it for most of the scripts.

  5. #5
    Join Date
    Mar 2014
    Posts
    195
    Mentioned
    4 Post(s)
    Quoted
    92 Post(s)

    Default

    well this helped alot but for it being a newbie guide it is missing a couple of things that i had to figure out.
    1. stats_Setup('id'); add this after setupsrl() id = to the script id.
    2. When you get set your variables on the website you use that number as well --> stats_IncVariable('140', NumToAddon)
    [140] Potions (Made) is the variable so you use the 140.
    3. You have to commit your stats by , stats_Commit();
    4. To get this to work in non AeroLib script you add this to your script.
    Simba Code:
    {-----grats' stats!-----}
    {
    =====
    Stats
    =====
    }


    Const
      stats_Path = AppPath+'Stats\';
      stats_File = 'Info.txt';

    type
      TStats_Vars = record
        Name: string;
        Value: integer;
      end;

    var
      stats_Timer : integer;
      stats_ID,stats_Pass,
      stats_ScriptID : string;
      stats_Vars  : Array of TStats_Vars;


    procedure stats_Setup(_ScriptID : String);
    var
      id,pass : String;
    begin
      if (not directoryExists(stats_Path)) then
      begin
        forceDirectories(stats_Path);
        writeINI('General', 'Stats_ID', '', stats_Path+stats_File);
        writeINI('General', 'Stats_Pass', '', stats_Path+stats_File);
      end;

      id   := readINI('General', 'Stats_ID', stats_Path+stats_File);
      pass := readINI('General', 'Stats_Pass', stats_Path+stats_File);

      if id = '' then
      begin
        case MessageBox('No Stats ID found, would you like to register?','Stats',1) of
          1: openWebPage('http://stats.grats.pw/reg.php');
        end;
      end;

      stats_ID       := id;
      stats_Pass     := pass;
      stats_ScriptID := _ScriptID;
      stats_Timer    := getSystemTime();
    end

    procedure stats_InitVariable(VarName: String; InitValue: Integer);
    var
      len: Integer;
    begin
      len := Length(stats_Vars);
      SetArrayLength(stats_Vars, len + 1);
      stats_Vars[len].Name := LowerCase(VarName);
      stats_Vars[len].Value := InitValue;
    end;

    procedure stats_SetVariable(VarName: string; NewValue: Integer);
    var
      i, h: Integer;
    begin
      h := High(stats_Vars);
      VarName := LowerCase(VarName);

      if (h >= 0) then
        for i := h downto 0 do
          if (VarName = stats_Vars[i].Name) then
          begin
            stats_Vars[i].Value := NewValue;
            Exit;
          end;

      stats_InitVariable(VarName, NewValue);
    end;

    procedure stats_IncVariable(VarName: string; Value: integer);
    var
      i, h: Integer;
    begin
      h := High(stats_Vars);
      VarName := LowerCase(VarName);

      if (h >= 0) then
        for i := h downto 0 do
          if (VarName = stats_Vars[i].Name) then
          begin
            stats_Vars[i].Value := stats_Vars[i].Value + Value;
            Exit;
          end;

      stats_InitVariable(VarName, Value);
    end;

    function stats_Commit(): Boolean;
    var
      S : String;
      Client,i,Worked,
      ExtraTime : integer;
    begin
      ExtraTime := getSystemTime() - stats_Timer;
      Worked    :=  ExtraTime div 60000;

      if Worked < 5 then Exit;
      ExtraTime := ExtraTime - (Worked*60000);

      stats_Timer := GetSystemTime - ExtraTime;

      Client := InitializeHTTPClient(False);
      ClearPostData(Client);

      if (stats_ID = '') then
      begin
        stats_ID   := '5';
        stats_Pass := 'anon1337';
      end;

      AddPostVariable(Client, 'user_id', STATS_ID);
      AddPostVariable(Client, 'password', STATS_PASS);
      AddPostVariable(Client, 'script_id', STATS_SCRIPTID);
      AddPostVariable(Client, 'timeamount', toStr(Worked));

      if (Length(stats_Vars) > 0) then
       for i := high(stats_Vars) downto 0 do
        with stats_Vars[i] do
        begin
          if (Value <= 0) then
            Continue;

          AddPostVariable(Client, Name, toStr(Min(Value, 30000))); //Capped at 30000
        end;

      // Get & translate the return code
      S := PostHTTPPageEx(Client, 'http://stats.grats.pw/POST.php');
      FreeHTTPClient(Client);

      case StrToIntDef(ExtractFromStr(S, Numbers), -1) of
        42  : Result := True;
    //  666 : writeln('Stats: User ID/Password not setup.');  // Disabled because of the default name ID & pass given above
        9001: writeln('Stats: Invalid user ID/Password.');
        1337: writeln('Stats: Invalid Script ID.');
        255,
        496 : writeln('Stats: Committing too fast; shame on you!');
        else
              writeln('Stats: No POST return');
      end;

      if Result then
      begin
        if (Length(stats_Vars) > 0) then
          for i := high(stats_Vars) downto 0 do
            with stats_Vars[i] do
            begin
              if (Value <= 0) then
                Continue;
              Value := 0; //Clear for next commit
            end;
      end;
    end;
    {-----grats' stats-----}

    Added all together in a progress report procedure.
    Simba Code:
    procedure Report;
    begin
    //code that shows in the report.
    stats_IncVariable('140', NumToAddon)
     stats_Commit();
    end;
    Last edited by goodgamescript; 06-18-2015 at 11:25 PM. Reason: added info

  6. #6
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Quote Originally Posted by spaderdabomb View Post
    Is there a way to view user stats? I wanted to see how much xp I've gained from botting =D
    Adding it slowly, been busy & was in hospital for a while so who knows lol
    http://stats.grats.pw/user.php
    you can find your name there, and now/in the future there will be info & more info

    Quote Originally Posted by goodgamescript View Post
    well this helped alot but for it being a newbie guide it is missing a couple of things that i had to figure out.
    1. stats_Setup('id'); add this after setupsrl() id = to the script id.
    2. When you get set your variables on the website you use that number as well --> stats_IncVariable('140', NumToAddon)
    [140] Potions (Made) is the variable so you use the 140.
    3. You have to commit your stats by , stats_Commit();
    4. To get this to work in non AeroLib script you add this to your script.
    Simba Code:
    {-----grats' stats!-----}
    {
    =====
    Stats
    =====
    }


    Const
      stats_Path = AppPath+'Stats\';
      stats_File = 'Info.txt';

    type
      TStats_Vars = record
        Name: string;
        Value: integer;
      end;

    var
      stats_Timer : integer;
      stats_ID,stats_Pass,
      stats_ScriptID : string;
      stats_Vars  : Array of TStats_Vars;


    procedure stats_Setup(_ScriptID : String);
    var
      id,pass : String;
    begin
      if (not directoryExists(stats_Path)) then
      begin
        forceDirectories(stats_Path);
        writeINI('General', 'Stats_ID', '', stats_Path+stats_File);
        writeINI('General', 'Stats_Pass', '', stats_Path+stats_File);
      end;

      id   := readINI('General', 'Stats_ID', stats_Path+stats_File);
      pass := readINI('General', 'Stats_Pass', stats_Path+stats_File);

      if id = '' then
      begin
        case MessageBox('No Stats ID found, would you like to register?','Stats',1) of
          1: openWebPage('http://stats.grats.pw/reg.php');
        end;
      end;

      stats_ID       := id;
      stats_Pass     := pass;
      stats_ScriptID := _ScriptID;
      stats_Timer    := getSystemTime();
    end

    procedure stats_InitVariable(VarName: String; InitValue: Integer);
    var
      len: Integer;
    begin
      len := Length(stats_Vars);
      SetArrayLength(stats_Vars, len + 1);
      stats_Vars[len].Name := LowerCase(VarName);
      stats_Vars[len].Value := InitValue;
    end;

    procedure stats_SetVariable(VarName: string; NewValue: Integer);
    var
      i, h: Integer;
    begin
      h := High(stats_Vars);
      VarName := LowerCase(VarName);

      if (h >= 0) then
        for i := h downto 0 do
          if (VarName = stats_Vars[i].Name) then
          begin
            stats_Vars[i].Value := NewValue;
            Exit;
          end;

      stats_InitVariable(VarName, NewValue);
    end;

    procedure stats_IncVariable(VarName: string; Value: integer);
    var
      i, h: Integer;
    begin
      h := High(stats_Vars);
      VarName := LowerCase(VarName);

      if (h >= 0) then
        for i := h downto 0 do
          if (VarName = stats_Vars[i].Name) then
          begin
            stats_Vars[i].Value := stats_Vars[i].Value + Value;
            Exit;
          end;

      stats_InitVariable(VarName, Value);
    end;

    function stats_Commit(): Boolean;
    var
      S : String;
      Client,i,Worked,
      ExtraTime : integer;
    begin
      ExtraTime := getSystemTime() - stats_Timer;
      Worked    :=  ExtraTime div 60000;

      if Worked < 5 then Exit;
      ExtraTime := ExtraTime - (Worked*60000);

      stats_Timer := GetSystemTime - ExtraTime;

      Client := InitializeHTTPClient(False);
      ClearPostData(Client);

      if (stats_ID = '') then
      begin
        stats_ID   := '5';
        stats_Pass := 'anon1337';
      end;

      AddPostVariable(Client, 'user_id', STATS_ID);
      AddPostVariable(Client, 'password', STATS_PASS);
      AddPostVariable(Client, 'script_id', STATS_SCRIPTID);
      AddPostVariable(Client, 'timeamount', toStr(Worked));

      if (Length(stats_Vars) > 0) then
       for i := high(stats_Vars) downto 0 do
        with stats_Vars[i] do
        begin
          if (Value <= 0) then
            Continue;

          AddPostVariable(Client, Name, toStr(Min(Value, 30000))); //Capped at 30000
        end;

      // Get & translate the return code
      S := PostHTTPPageEx(Client, 'http://stats.grats.pw/POST.php');
      FreeHTTPClient(Client);

      case StrToIntDef(ExtractFromStr(S, Numbers), -1) of
        42  : Result := True;
    //  666 : writeln('Stats: User ID/Password not setup.');  // Disabled because of the default name ID & pass given above
        9001: writeln('Stats: Invalid user ID/Password.');
        1337: writeln('Stats: Invalid Script ID.');
        255,
        496 : writeln('Stats: Committing too fast; shame on you!');
        else
              writeln('Stats: No POST return');
      end;

      if Result then
      begin
        if (Length(stats_Vars) > 0) then
          for i := high(stats_Vars) downto 0 do
            with stats_Vars[i] do
            begin
              if (Value <= 0) then
                Continue;
              Value := 0; //Clear for next commit
            end;
      end;
    end;
    {-----grats' stats-----}

    Added all together in a progress report procedure.
    Simba Code:
    procedure Report;
    begin
    //code that shows in the report.
    stats_IncVariable('140', NumToAddon)
     stats_Commit();
    end;
    this thread is mostly for just basic users, I think you found the other dev thread by now though
    I haven't actually used simba in years either so <_<


    Quote Originally Posted by dutchp0wner View Post
    This is great, using it for most of the scripts.
    http://stats.grats.pw/user.php?u=dutchp0wner

    can see some of your individual stats now
    Last edited by grats; 06-26-2015 at 08:22 AM.
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  7. #7
    Join Date
    Nov 2015
    Posts
    73
    Mentioned
    1 Post(s)
    Quoted
    31 Post(s)

    Default

    I signed up for an account with an email and password that I know was consistent, but I never received an email and am unable to login. Is there an issue with account creation or am i just noob?

  8. #8
    Join Date
    Mar 2016
    Location
    Canada
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Whenever I get around to scripting I'll definitely look into this, thanks!

  9. #9
    Join Date
    Jun 2017
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Border line grave dig and spam post ..lol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •