Finaltwist

Member
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)?

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

  • Interest System.cs
    2.3 KB · Views: 1
Last edited:
any help on this by any chance? I'm having an issue with the script - it doesn't look at bankboxes just write "timer tick" in the console over and over and over... even if i remove the "if hour = 1". just an endless loop of "timer tick" notices.
 
There is a script by Felladrin that I use called GameTimePlatinumReward which will probably have the code you need.

It puts 1 platinum in a player's bank box every day (or at an interval you choose) provided the player is online.
 

Attachments

  • GameTimePlatinumReward.cs
    2.9 KB · Views: 12
There is a script by Felladrin that I use called GameTimePlatinumReward which will probably have the code you need.

It puts 1 platinum in a player's bank box every day (or at an interval you choose) provided the player is online.
thank you!!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back