SRL Archive - SRL Stats

Stats error?


KingKong

2011-01-20 01:35:38

Ok, so I've finally decided to use stats in my script but seems that setvariable and Incvariable seem to do the same thing when commiting to the server.

Here are two commits when I used setvariable:
1) http://stats.villavu.com/commit/12734
2) http://stats.villavu.com/commit/12746

Here are two commits when I used incvariable:
1) http://stats.villavu.com/commit/12813
2) http://stats.villavu.com/commit/12825

Wizzup?

2011-02-06 17:53:32

I think you're not supposed to use setvariable at all.

KingKong

2011-02-14 05:14:15

I solved the problem by resetting the variable, but i don't see whats the point of having it in the includes, i thought setvariable just set the variable to whatever value you say, but it doesn't.

TomTuff

2011-02-14 05:37:53

The point of having it in the include is to initiate a variable that hasn't been added to yet. Don't go raging about because you can't read function headers.

KingKong

2011-02-14 06:21:10

(*
stats_SetVariable
~~~~~~~~~~~~~~~~~

.. code-block:: pascal
stats_SetVariable(VarName: string; NewValue: Integer);

Sets the passed variable to the new value regardless of old value. This method
behaves much like stats_InitVariable but checks for the variable present first.

Example:
.. code-block:: pascal
stats_SetVariable('runite', 10)
*)

Now, does that say anything about initiating a variable? Because there is already a proc for doing that, and if you actually used the function then you should've noticed that it does the same thing as Incvariable, which i was pointing out. Also, I was never raging, I was only wondering why it was included because its just a waste of 30 or so lines.

P.S. If i was raging I'd use an emote to show it, because words don't show emotions.

TomTuff

2011-02-14 06:33:37

I'm sorry, I thought you were trying to use "stats_InitVariable". The header for stats_InitVariable says not to call it anywhere else. Last time I looked at Stats.Simba, there were only 4 functions. Apologies.

KingKong

2011-02-14 07:05:18

No problemo, I understand, it was easy to be mistaken, apology accepted;)

KingKong

2011-11-18 21:06:31

A mighty BUMP here!:thumbsup:

Harry

2011-11-18 21:18:05

What are you bumping it for? Is your question not answered?

Coh3n

2011-11-19 01:55:42

You're only supposed to use stats_IncVariable and stats_Commit. The rest of the stats methods are used somehow in those functions.