Vali Posted March 29, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Share Posted March 29, 2012 Hi, I'm looking to do an scrip that works only for one specified day when a monster is killed. I really do not know how to do the compare to do that if: header of the script{ end; OnNPCKillEvent: if(date() == 20120404) // This part { DoSomething(); } } Thank you. Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 29, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: Yesterday at 05:59 PM Share Posted March 29, 2012 you can try this *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 - Week day (0 for Sunday, 6 is Saturday) 5 - Day of the month. 6 - Number of the month. 7 - Year. 8 - Day of the year. It will only return numbers. if (gettime(4)==6) mes "It's a Saturday. I don't work on Saturdays."; Quote Link to comment Share on other sites More sharing options...
tr0n Posted March 29, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share Posted March 29, 2012 sample: - script npcname -1,{ end; OnNPCKillEvent: if(gettime(4)!=6) end; DoSomething() } This script would work only on Saturday Quote Link to comment Share on other sites More sharing options...
JayPee Posted March 29, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted March 29, 2012 Hi!, try this set .@date$,""+20120404; if(gettimestr("%Y%m%d",21)==.@date$) { //Do stuff } %Y - year %m - months with leading zero when the value is 1 - 9 %d - day with leading zeros when the value is 1 - 9 Quote Link to comment Share on other sites More sharing options...
Vali Posted March 29, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 128 Reputation: 7 Joined: 12/29/11 Last Seen: July 2, 2013 Author Share Posted March 29, 2012 Thank you. Quote Link to comment Share on other sites More sharing options...
tr0n Posted March 29, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share Posted March 29, 2012 Hi!, try this set .@date$,""+20120404; if(gettimestr("%Y%m%d",21)==.@date$) { //Do stuff } %Y - year %m - months with leading zero when the value is 1 - 9 %d - day with leading zeros when the value is 1 - 9 Good idea Quote Link to comment Share on other sites More sharing options...
Question
Vali
Hi,
I'm looking to do an scrip that works only for one specified day when a monster is killed. I really do not know how to do the compare to do that if:
Thank you.
Link to comment
Share on other sites
5 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.