donkeyg Posted July 15, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Share Posted July 15, 2012 if(gettime(4) != 0 && gettime(4) != 6) end; <<< this is for saturday and sundayhow do i set this time to monday, webnesday and friday only? Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 // If Monday, Wednesday, or Friday perform an action. if(gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) { // Do Whatever } *gettime(<type>) This function will return specified information about the current system time. 1 = Seconds (of a minute) 2 = Minutes (of an hour) 3 = Hour (of a day) 4 = Day of the Week (0 = Sun, 1 = Mon, 2 = Tues, 3 = Wed, 4 = Thurs, 5 = Fri, 6 = Sat) 5 = Day of the month. 6 = Number of the month. 7 = Year. 8 = Day of the year. The example code I gave does the following: - gettime(4) returns the current day of the week as a digit between 0 (Sun) and 6 (Sat). - Using the if statement with || ("or"), I checked to see if the returned digit was either 1 (Mon), 3 (Wed), or 5 (Fri). - If the returned digit was 1, 3, or 5 it will then perform the task. Quote Link to comment Share on other sites More sharing options...
donkeyg Posted July 15, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted July 15, 2012 // If Monday, Wednesday, or Friday perform an action. if(gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) { // Do Whatever } *gettime(<type>) This function will return specified information about the current system time. 1 = Seconds (of a minute) 2 = Minutes (of an hour) 3 = Hour (of a day) 4 = Day of the Week (0 = Sun, 1 = Mon, 2 = Tues, 3 = Wed, 4 = Thurs, 5 = Fri, 6 = Sat) 5 = Day of the month. 6 = Number of the month. 7 = Year. 8 = Day of the year. The example code I gave does the following: - gettime(4) returns the current day of the week as a digit between 0 (Sun) and 6 (Sat). - Using the if statement with || ("or"), I checked to see if the returned digit was either 1 (Mon), 3 (Wed), or 5 (Fri). - If the returned digit was 1, 3, or 5 it will then perform the task. how if i make it 1 week have 3 days the event is open for everyone Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 how if i make it 1 week have 3 days the event is open for everyone Not entirely sure what you mean... can you re-phrase the question please? The script I posted should perform whatever code you put in it every Monday, Wednesday, & Friday on every week. Quote Link to comment Share on other sites More sharing options...
donkeyg Posted July 15, 2012 Group: Members Topic Count: 344 Topics Per Day: 0.07 Content Count: 1060 Reputation: 1 Joined: 02/13/12 Last Seen: November 14, 2016 Author Share Posted July 15, 2012 sorry my fault, didnt see clearly, thank you! Quote Link to comment Share on other sites More sharing options...
Question
donkeyg
how do i set this time to monday, webnesday and friday only?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.