Jump to content
  • 0

Script working only one specified day.


Question

Posted

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.

5 answers to this question

Recommended Posts

Posted

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.";

Posted

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

Posted

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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...