[Help]Dayofweek

12/08/2009 22:34 hunterman01#1
Alright so i am writing a code and im wanting it to do something only on one day of the week

How i went about doing this is like this

Code:
if (DayOfWeek.Monday)
            {
                //blah blah blah
            }

I thought about using System.DayOfWeek.Monday

That did not seem to work either

so if someone could tell me a way of going about doing this id be appreciative

Thanks
12/08/2009 22:37 .Guru#2
try using dates? not sure. you'd just have to change more often.. i like your idea better, but im not sure how it'd work
12/08/2009 22:40 hunterman01#3
Yeah its saying That it cannot convert System.DayOfWeek to a bool but im a little confused
12/08/2009 22:52 Nirion#4
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
12/08/2009 23:16 Werew0lf#5
@Hunter
Why ain't you guardian anymore?
Inactivity?
12/08/2009 23:21 -Shunsui-#6
Quote:
Originally Posted by Nirion View Post
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
You Put that in world.cs ? To make A Certain thing Work on a Sertain time?

Ex..
Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Minute == 55))
{
QuizShow.Start
}
Where would i place something like that? not the actual thing tho
12/09/2009 02:29 .Guru#7
Quote:
Originally Posted by Nirion View Post
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
yeah that should work
12/09/2009 03:37 hunterman01#8
Quote:
Originally Posted by Werew0lf View Post
@Hunter
Why ain't you guardian anymore?
Inactivity?
idk just found out i wasnt a guardian wierd 0.0
12/09/2009 03:46 -Shunsui-#9
Stay on topic, If you got your answer Report close this thread.
12/09/2009 03:58 hunterman01#10
lol Yesa masta -.-
12/09/2009 04:16 Z0DIAC#11
#request close
Threadstarter got his answer
12/09/2009 04:24 ImFlamedCOD#12
Quote:
Originally Posted by -Shunsui- View Post
Stay on topic, If you got your answer Report close this thread.
Since the question was answered correctly I thought you let you know topic starters are premited to close there own topics and reopen them on will.
12/09/2009 04:36 Nirion#13
Quote:
Originally Posted by -Shunsui- View Post
You Put that in world.cs ? To make A Certain thing Work on a Sertain time?

Ex..
Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Minute == 55))
{
QuizShow.Start
}
Where would i place something like that? not the actual thing tho
Actually I placed my timed event in the run void in MyThread.cs....I don't know why I put it there but it wouldn't work anywhere else I tried.
12/09/2009 04:42 hunterman01#14
See no reason to close this thread people are still getting help here
(like me)

But yeah i just needed this i think i might need one other thing


How would i make something stop at a certain time lets saying 12:00
12/09/2009 08:38 Huseby#15
Quote:
Originally Posted by ImFlamedCOD View Post
Since the question was answered correctly I thought you let you know topic starters are premited to close there own topics and reopen them on will.
Nope, only mods(In there dedicated area), global mods and Admins are premited to use the #Close function

stay on topic guys.