Jump to content
Sign in to follow this  
13lack13lade

send time issues

Recommended Posts

13lack13lade

Hey guys,

I have a script that currently uses nowcalcdate to give me today and yesterdays date.. in the current format e.g 020314 ddmmyy and worked fine however now it is sending 2014/03/02

Need it to be fixed to return values in ddmmyy format and im not sure whats happened for it to suddenly change how it is sent..

Func _Convert($date)
         Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1')
      EndFunc
      $today = _NowCalcDate()
      $yesterday = _DateAdd('d', -1, $today)

Share this post


Link to post
Share on other sites
13lack13lade

That is the only code i use besides 

Send($yesterday)

send($today)

as send key strokes to get the date values entered into the system..

Share this post


Link to post
Share on other sites
13lack13lade

#include <date.au3>
#Include<file.au3>
#include<ie.au3>
;date function & variable
      Func _Convert($date)
         Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1')
      
      $today = _NowCalcDate()
      $yesterday = _DateAdd('d', -1, $today)
      EndFunc
;open calypso & login
Run("C:\Program Files\InterSoft International, Inc\NetTerm\netterm.exe")
Sleep(4000)
Send("{ENTER}")
Sleep(2000)
Send("username")
Sleep(1000)
Send("{ENTER}")
Sleep(1000)
Send("password")
Sleep(1000)
Send("{ENTER}")
Sleep(1000)
Send("ras")
Sleep(700)
Send("{ENTER}")
Sleep(700)
Send("k_arabian")
Sleep(700)
Send("{ENTER}")
Sleep(700)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("H")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("dxb")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("ara")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("*")
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($yesterday)
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($today)
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send($today)
Sleep(500)
Send("{ENTER}")
Sleep(500)
Send("311014")
Sleep(500)
Send("{ENTER}")

There is some more of the script... i just need $yesterday to be yesterdays date to be sent in ddmmyy format and $today to send todays date in ddmmyy format.. it worked absolutely fine then one day just broke..so im not sure whats happened :( guessing the function is what is used to change from yyyymmdd to ddmmyy as someone on the forum previously helped me but i cant seem to find it.

Found my previous post 

However that is the exact code im using and for some reason its not changing the format...

Edited by 13lack13lade

Share this post


Link to post
Share on other sites
JohnOne

#include <date.au3>

$today = _NowCalcDate()
MsgBox(0,"Today", _Convert($today))
$yesterday = _DateAdd('d', -1, $today)
MsgBox(0,"Yesterday", _Convert($yesterday))

Func _Convert($date)
    Return StringRegExpReplace($date, '\d\d(\d\d)/(\d\d)/(\d\d)', '$3$2$1')
EndFunc   ;==>_Convert


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
13lack13lade

im retarded... :>  needed to have $nowdate= _NowCalcDate() then $today =_convert($nowdate)

Thanks!!!!!! :D

Share this post


Link to post
Share on other sites
water

To make your script more reliable I suggest to replace Send with ControlSend.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.