mIRC Home    About    Download    Register    News    Help

Print Thread
#233560 24/08/11 11:40 AM
D
dredstre
dredstre
D
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

#233562 24/08/11 02:24 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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.
#233563 24/08/11 02:59 PM
D
dredstre
dredstre
D
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.

#233564 24/08/11 04:44 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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))

Riamus2 #233565 24/08/11 04:56 PM
D
dredstre
dredstre
D
great and yes I would like that day would increase at actual day change in game and thx for your help

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

Riamus2 #233567 24/08/11 05:09 PM
D
dredstre
dredstre
D
thx works like charm


Link Copied to Clipboard