mIRC Home    About    Download    Register    News    Help

Print Thread
#244176 29/01/14 08:29 AM
Joined: Jan 2014
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jan 2014
Posts: 3
Hey everyone! So we recently started using mIRC in my workplace, and I've learned of all these fascinating things you can do with scripts and stuff! So basically, my job is reports. I'm in the Army, in an ADA unit, and as a commo guy, I do the same thing... All day... Which is why learning how to write excel macros, and soon mIRC scripts is a lifesaver. I've figured out sending reports quickly via pop ups, and aliases, but I have one issue. My reports update their time automatically based on my computer time (script I wrote). The problem with that is when we train we start at 0000Z in the training scenario, so my times are always off. The unit I replaced had a script they wrote that they could change the time to 0000Z at the beginning of training, then change it back to rw Zulu time. If anyone has an idea how to do this, id be extremely grateful.

Joined: Mar 2004
Posts: 526
Fjord artisan
Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
this would of course, depend upon where you are in the world, and how your computer is setting its internal time. Once you know the time your computer is using (would assume it would get time from the network your connected to), you could write a mirc script that adjusts the time based on what is the difference from your computer time to Z time. What you want to look at is '$time' which Returns the current time in hour:minute:second format. (based on time your computer is using). the mirc script would adjust that time to Z time. If you can let us know how your computer gets the time I and others (im sure) would help you with this script. in mirc /help $time will give you some basic information.



Last edited by HorseC; 30/01/14 03:18 PM.

Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Jan 2014
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jan 2014
Posts: 3
Hey so I've looked into. The $time but I don't know where to put these commands smirk I'm a complete noob on mIRC. I've only done very basic aliases, and some popups set to play text files to make sending reports up quicker. I will say though, that I get my timing from the computer, because it is has no internet connection. It is just an internal network across my batallion on a server that we created.

Joined: Dec 2002
Posts: 252
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 252
$gmt will return the number of seconds elapsed since 00:00:00 GMT, January 1, 1970, where $ctime adjusts by adding/subtracting the timezone to the result of $gmt.

I'm in EST so I need to subtract hours from GMT. $timezone returns your current timezone setting in seconds.

Proof of concept:
//echo -a $asctime($ctime) vs. $asctime($calc($gmt - $timezone))

Result:
Fri Jan 31 19:34:15 2014 vs. Fri Jan 31 19:34:15 2014

Hope this helps point you in the right direction to get the proper timestamp you require.

Joined: Jan 2014
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jan 2014
Posts: 3
I still don't know where to put any of this. I literally haven't done anything but some short aliases. If someone can give me an example script and where to put it, I would learn best that way. I've found I learn best from dissecting coding/scripting done already.


Link Copied to Clipboard