Jump to content
Sign in to follow this  

how to do a file write every 5 min ?

Recommended Posts

I made this script with autoiy bata 3.113 so i could use the com interface

once start this script i went this script to run as long as a program is runing an I went it to write to a file every 5 min thank for any help

Dim $omUIV

$omUIV = ObjCreate("UIView32.clsUIV")

MsgBox(0, "", "TEST" &$omUIV.intStationCount )

Dim $file

$file = FileOpen("yourIncludeFile.js", 2)

; Check if file opened for writing OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")



FileWrite($file, "var number="&$omUIV.intStationCount)


Share this post

Link to post
Share on other sites

Check Out:

AdlibEnable ( "function" [, time] )


If Mod(@MIN, 5) = 0 And $mod = 0 Then
      ControlClick($hwndTally, "", $buttonRefresh, $primary, 1)
      $mod = 1; flag variable.  This is so that a button isn't clicked like mad, once every 20 msec for a full minute.
   ElseIf Mod(@MIN, 5) > 0 And $mod = 1 Then
     ; this is to reset the flag variable, once we're no longer evenly divisible.
      $mod = 0

This little snippet runs inside my main GUI loop and gets executed every 20 ms or so. It only clicks the "refresh" button once when the system clock's minutes are evenly divisible by five. I'm sure that you could easily modify it to update a file.

Mod(number,divisor) (or Modulus)

Returns zero if the number is evenly divisible. Otherwise Mod will return the remainder.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...