Sign in to follow this  
Followers 0
13lack13lade

date not changing

4 posts in this topic

Hi All,

I have this script i run daily, which was working fine until a little while ago and im not sure what has happened... basically it runs a report every night using yesterdays date and todays date however when i let it run, it does it on the date its first run and then the next day it runs it uses the same date instead of getting the new yesterday and today values... its doing my head in!

When i go into autoit and run the code, works perfectly fine.. cant seem to figure out whats going on.

#Include<file.au3>
#include<ie.au3>
#include <date.au3>

$today = _NowCalcDate()
$today1 = _Convert($today)
$yesterday = _DateAdd('d', -1, $today)
$yesterday1 = _Convert($yesterday)

Func _Convert($date)
    Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1')
EndFunc   ;==>_Convert
;open calypso & login
Run("C:\Program Files\InterSoft International, Inc\NetTerm\netterm.exe")
Sleep(4000)
Send("{ENTER}")
Sleep(2000)
Send("dataload")
Sleep(1000)
Send("{ENTER}")
Sleep(1000)
Send("Load")
Sleep(1000)
Send("{ENTER}")
Sleep(500)
Send("ras")
Sleep(700)
Send("{ENTER}")
Sleep(700)
Send("k_arabian")
Sleep(700)
Send("{ENTER}")
Sleep(700)
Send("*") ;1
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;2
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;3
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;4
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("H") ;5
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("dxb") ;6
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("ara") ;7
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;8
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ; 9
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($yesterday1) ; 10
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($today1) ;11
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($today1) ;12
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("311014") ;13
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;14
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;15
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*") ;16
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("F") ;17
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("arabian_adventures.xls") ;18
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("y")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("X")
Sleep(500)
Send("{ENTER}")
Send("X")
Sleep(500)
Send("{ENTER}")
Send("X")
Sleep(500)
Send("{ENTER}")
Sleep(500)
WinClose("Calypso Host")

Share this post


Link to post
Share on other sites



my code is fine, im guessing its the computer.. anyone know reasons thsi would happen?

Share this post


Link to post
Share on other sites

Not sure if this is relevant, are you running the script at midnight?  Had a password reminder script that ran once every day at midnight, however when day-light savings kicked in the dates were off by one day, due to the 1 hour difference.

Share this post


Link to post
Share on other sites

I am running the script at mid night funnily enough..however the date doesnt seem to change over the weekend, so ill run it friday and sat night and sunday night it will still be sending fridays date even though i am using nowdate

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