Jump to content
  • 0

WoE Times


Severus

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  04/04/12
  • Last Seen:  

Hello rAthena Community,

I have a small problem and I think it's easy to solve but I don't want to make a mistake.

I have this script for War of Emperium times.

OnClock1900: //start time for Wend,Sun(0,3), Wend,Sun(0,3)
OnClock2000: //end time for Wend,Sun(0,3), Wend,Sun(0,3)

// starting time checks
if((gettime(4)==0) && (gettime(3)>=19 && gettime(3)<20) ||
(gettime(4)==3) && (gettime(3)>=19 && gettime(3)<20)) {

But I want Wednesday and Sunday: 19:00 - 20:30 o'clock

Can I just edit it to:

OnClock1900: //start time for Wend,Sun(0,3), Wend,Sun(0,3)
OnClock2030: //end time for Wend,Sun(0,3), Wend,Sun(0,3)

// starting time checks
if((gettime(4)==0) && (gettime(3)>=19 && gettime(3)<20) ||
(gettime(4)==3) && (gettime(3)>=19 && gettime(3)<20)) {

or

OnClock1900: //start time for Wend,Sun(0,3), Wend,Sun(0,3)
OnClock2030: //end time for Wend,Sun(0,3), Wend,Sun(0,3)

// starting time checks
if((gettime(4)==0) && (gettime(3)>=19 && gettime(3)<2030) ||
(gettime(4)==3) && (gettime(3)>=19 && gettime(3)<2030)) {

Thanks for your help!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

The function gettime() returns only what you specify.

gettime(3) will give you the hour only.

Since you can only arrive at the if check at two possible times, 19:00 and 20:30, you only need to check for the days and that specific hour.

OnClock1900: // Start time
OnClock2030: // End time
// Check for Sunday or Wednesday AND that it is starttime
if((gettime(4) == 0 || gettime(4) == 3) && gettime(3) == 19) {

I'm guessing you have an "end time check" at the end of that if. Make sure to change that check to something like this:


// Check for Sunday or Wednesday AND that it is endtime
if((gettime(4) == 0 || gettime(4) == 3) && gettime(3) == 20) {

*gettime(<type>)

This function will return specified information about the current system time.

...

3 - Hour (of a day)

...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  04/04/12
  • Last Seen:  

Thanks for your help!

I'm using this script: Random WoE by Brian http://www.eathena.ws/board/index.php?act=attach&type=post&id=5615

Forgot to write the end time.

Greetings,

Serverus

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

it seems that scrip can't be settled on minute 30

why not use this it was working for me

http://rathena.org/board/topic/57377-toastys-woe-controller/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  04/04/12
  • Last Seen:  

Because I'm looking for a random War of Emperium and I don't want to change the castles manually.

The script by Brian announces every War of Emperium which castle is open this season.

Link to comment
Share on other sites

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.

×
×
  • Create New...