mIRC Home    About    Download    Register    News    Help

Print Thread
#233560 24/08/11 11:40 AM
Joined: Aug 2011
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2011
Posts: 4
Hey,
I hope that somebody can help me out,
I would like to have some script that would change my computer date and time into date and time I want so lets say my time and date now is 13:33h 24.08.2011 and I would like to change time into 07:33 and date into let say day 100 and after 24 h passes it would go to day 101 and so on

dredstre #233562 24/08/11 02:24 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I'm sure you could use a COM object to change your system's date and time, but I don't really know why you'd want to. Shouldn't your computer's date and time be correct? And if you did want to change it, it's easy to do right from the clock. Once changed, it won't change back if you disable the time syncing.

Or do you mean that you want the timestamp *in mIRC* to be different? That can easily be scripted if that's what you are asking. Though your examples are giving a different date and time and not just a different format.

Last edited by Riamus2; 24/08/11 02:27 PM.

Invision Support
#Invision on irc.irchighway.net
dredstre #233563 24/08/11 02:59 PM
Joined: Aug 2011
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2011
Posts: 4
sorry my bad it seems I didnt express myself right, here is what I would like to do:
on *:TEXT:.eTime:#mychan:{
set %etime $time(HH:nn:ss)
msg $chan %etime
}
this would bring up my computers time but what I want is that it brings $time(HH:nn:ss) - 8h and date not as $time(mm/dd/yyyy) but as day 100.
So its for some game and in that game day starts @ mylocal time - 8h and we are already in day 1360 so when smbdy writes .eTime I would like to see time and date of that game. I hope that its more clearer now what I want from script.

dredstre #233564 24/08/11 04:44 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, I understand now.

Try this:

Code:
on *:test:.etime:#chan: {
  var %startdate = 24/8/2011
  var %day = $calc(($ctime - $ctime(%startdate)) / 86400)
  var %time = $time($calc($ctime - 28800),HH:nn:ss)
  msg $chan %time - %day
}


You can format that as needed and you can combine the variables into one if you want. I just left them separate to allow for easier formatting in the /msg. You can adjust the startdate to whenever the game started. Use the format day/month/year for this as $ctime() doesn't accept month/day/year.

Now, I may still be missing something with the time. This will display the current local time minus 8 hours. If that's what you wanted, that's good. However, the time does not affect the %day. So if you meant that the day should increment at 00:00:00 of time-8, that isn't happening (yet). If you need that, let me know. Right now, the day increments at 00:00:00 local time.

Just in case you need it, here's the change if you want it to increment at 00:00:00 of local-8:

Code:
  var %day = $int($calc(($ctime - $ctime(%startdate 08:00:00)) / 86400))


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233565 24/08/11 04:56 PM
Joined: Aug 2011
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2011
Posts: 4
great and yes I would like that day would increase at actual day change in game and thx for your help

dredstre #233566 24/08/11 04:57 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
See above.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233567 24/08/11 05:09 PM
Joined: Aug 2011
Posts: 4
D
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2011
Posts: 4
thx works like charm


Link Copied to Clipboard