Sign in to follow this  
Followers 0
erikson

statistics script

7 posts in this topic

Hi and thanks fo reading this.

i have a number of scripts ( for exapmle 5)

i whant to record how many times each script has been opened ( like a statistic)

example:

script1 - 3

script2 - 1

script3 - 6

script4 - 0

script5 - 8

and i whant to make a script that display me the result.

Share this post


Link to post
Share on other sites



Write a logging routine into each script to write to a log file.

Either increment the number found in the log file each time, or simply add some other details each time e.g. PC name, date / time, user etc.

Write a final script that will parse this log file and display it in a nice way for you.

Hows that for an idea?


----[ SandyD ]---

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Take a look at the Reg* or Ini* functions in the help file. Increment a variable with one of those.

Edited by Uten

Share this post


Link to post
Share on other sites

thx.

i solve this problem with a some sql commands

now i whant to to something else:

let`s supose that a script nr 1 remain opened for 30 minutes one time , and for 15 minutes other time. how i make to sum all time that script was oppened? like 20 + 15 ?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You can get your scripts top write the date/time to your datebase when they opened, and when they closed, then simply do some aritmetic on the date/times.

Look for OnAutoItStart () and OnAutoItExit ()

You may have problems though if someone terminates the script unexpectedly though, as it wont run the OnAutoItExit () function and you wont have your end details.

Edited by sandyd

----[ SandyD ]---

Share this post


Link to post
Share on other sites

You can get your scripts top write the date/time to your datebase when they opened, and when they closed, then simply do some aritmetic on the date/times.

Look for OnAutoItStart () and OnAutoItExit ()

You may have problems though if someone terminates the script unexpectedly though, as it wont run the OnAutoItExit () function and you wont have your end details.

ok

is a good idea but

if i start a scrip on 11 PM (23) and i stop it at 2 AM (2)..

if i do some aritmetic .. like end time - start time it will give me a negative result , in this case -21.

and i think this is the real problem :whistle:

Share this post


Link to post
Share on other sites

lookup the _DateDiff function, it will work that out for you ...


----[ SandyD ]---

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0