Good afternoon all!
I have a script that awards interest on gold held in the bank, and i want it to do the gold check once every ingame day.
I have to admit i'm not too sure how the realtime versus ingame times work.... could someone help change this so that it ticks every ingame day (e.g. using Map.Trammel)?
Actually, now that i mention it, this script has an infinite loop when the ontick is triggered. Just continuously runs
Console.WriteLine( "Timer tick {0}", DateTime.Now.Hour.ToString() );
any help is appreciated
I have a script that awards interest on gold held in the bank, and i want it to do the gold check once every ingame day.
I have to admit i'm not too sure how the realtime versus ingame times work.... could someone help change this so that it ticks every ingame day (e.g. using Map.Trammel)?
C#:
public static void Initialize()
{
new interestTimer();
}
public interestTimer() : base( TimeSpan.FromMinutes(60), TimeSpan.FromHours(0) )
{
//Priority = TimerPriority.FiftyMS;
this.Start();
}
protected override void OnTick()
{
Console.WriteLine( "Timer tick {0}", DateTime.Now.Second.ToString() );
if ( DateTime.Now.Hour == 1 )
{
Post automatically merged:
Actually, now that i mention it, this script has an infinite loop when the ontick is triggered. Just continuously runs
Console.WriteLine( "Timer tick {0}", DateTime.Now.Hour.ToString() );
any help is appreciated
Attachments
Last edited: