SRL Archive - Senior Scripts and Snippets

SRL-Stats


WhoCares357

2008-11-01 14:12:35

I recently tried to add a "Average [Actions] Per Hour" to the SRL-Stats. However, I ran into a problem, because SRL-Stats adds a value to the ReportVar[x] even if you just set it equal to the value.

For example, if I had set
ReportVars[0] := 5;
SRL-Stats would do
ReportVars[0] := ReportVars[0] + 5;

I'm not sure if it was intended this way to prevent cheating, but it disallows some statistics functionalities.

The other thing I am wondering is whether or not it is possible to add an array of string variables to SRL-Stats. In my case, I was going to add a string to store the user who achieved the highest "Average [Actions] Per Hour".

n3ss3s

2008-11-01 14:21:55

You can go around this, parse the value of the earlier value stored on the SRL Stats from the SRL Stats page, uhh… How could I explain it… Like open the info about the hours done and loads (or w/e) done, add your thing and "re-pack"… I had the maths in my head but it dissapeared :(

Widget

2008-11-01 14:31:19

Wouldn't it be something like StatsThing := NewValue - OldValue;? You could just open up the stats page and parse it out :)

EvilChicken!

2008-11-01 15:51:33

Reporting negative vars isn't possible as far as I'm aware of.

WhoCares357

2008-11-01 15:52:57

I think I understand. You would store the old value, then set the new value (it would add it). Finally you would add the negative of the old value.

ReportVars[x] := -1 * ReportVars[x]; //make it 0
ReportVars[x] := NewValue;

Thanks :D.

And the question about adding an array of string variables still stands.

Edit:
From: EvilChicken!
Reporting negative vars isn't possible as far as I'm aware of.


I'm going to test it.

Edit 2: I can't seem to edit the stats at all now. Is there a time lapse between when the var is sent and when it is posted? Or maybe the delay (or nullification) is caused by multiple connections at once?

I'm using this script:

program New;

{.include SRL\SRL.scar}

begin
SetupSRL;
ScriptID := '1072';
SRLID := '4729';
SRLPassword := '***';
Wait(1000);
ReportVars[0] := ReportVars[0] + 4;
end.

I'm having a problem connecting to SRL-Stats. It worked earlier today. I wonder what it could be…

EvilChicken!

2008-11-02 17:29:48

WhoCares357, I think I know why your "script" isn't working; they made it so the script had to be running for atleast 5 minutes for it to have the ability to send SRL stats vars. They put this in as a way of preventing newbs to cheat their way to new ranks in SRL stats.

Anywone, correct me if I'm wrong.

WhoCares357

2008-11-03 18:49:32

From: EvilChicken!
WhoCares357, I think I know why your "script" isn't working; they made it so the script had to be running for atleast 5 minutes for it to have the ability to send SRL stats vars. They put this in as a way of preventing newbs to cheat their way to new ranks in SRL stats.

Anywone, correct me if I'm wrong.


Ah, thank you. I'll try run it for five minutes beforehand.

Edit: Nope, I can't connect even after 30 minutes.

EvilChicken!

2008-11-04 10:38:59

You also forgot to call SRLRandomsReport; xD


Sorry for not finding that out earlier, I didn't think of it back then ..

WhoCares357

2008-11-05 10:11:39

From: EvilChicken!
You also forgot to call SRLRandomsReport; xD


Sorry for not finding that out earlier, I didn't think of it back then ..


Haha. Hm, sorry about that. I didn't know that was the function that sent out SRL-Stats.

Edit: It appears as though SRL-Stats doesn't accept negative numbers. So is there any way to go around this?