How would i make guildwar only work on weekends?

05/26/2012 19:29 aisaiya#1
I want to make GW only work on weekends and auto-restart every time someone takes the pole until whatever time I would like to set it to.

Another question I would like the answer to. Is how do I make the pole have the same HP as the funds of the currently winning guild at the time they took the pole. Any help would be greatly appreciated.
05/26/2012 20:22 Zeroxelli#2
Make a boolean in the server called IsGW
Code:
public static bool IsGW = false;
Then do something like

Code:
Timer GWTimer = new Timer(60000); // Call the check every 60 seconds
GWTimer.Elapsed += delegate { if (!IsGW && DateTime.Now.DayOfWeek == DayOfWeek.Saturday) { IsGW = true; /* Your GW code here */ };
GWTimer.Start();
GC.KeepAlive(GWTimer);
Prolly better ways, but you get the idea.
05/26/2012 22:17 shadowman123#3
Y dont u try to Check Trinity Source .... Its Good Reference and check How is the GW Start Timer work
05/26/2012 22:45 aisaiya#4
I tried this but its not working



public static void GWautostart()
{
Timer GWStarter = new Timer(60000); // Call the check every 60 seconds
GWStarter.Elapsed += delegate
{
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
{
Features.GuildWars.StartWar();
}

GWStarter.Start();
GC.KeepAlive(GWStarter);
};
}
05/27/2012 01:50 |xabi|#5
just make code for time then put the action and it must work .....
05/27/2012 02:29 Zeroxelli#6
Did you call GWautostart(); ?
05/27/2012 02:54 -Sensei-#7
Quote:
Originally Posted by Zeroxelli View Post
Did you call GWautostart(); ?
I bet he just copy then paste the code.
05/27/2012 05:48 Zeroxelli#8
Quote:
Originally Posted by -Sensei- View Post
I bet he just copy then paste the code.
At least he made his own method. Though, it's best to just put it in his main program method and assign it along with other main variables.