Jump to content
  • 0

Gettime problem


Question

16 answers to this question

Recommended Posts

Posted

because your condition checking is wrong....it only check for monday...then your script only stopped on monday....

the correct condition would be

if( gettime(4) ) end;

refer gettime

so if i wan to held it on sunday only, it will be like this?

if(gettime(4) == 1 || gettime(4) == 2 || gettime(4) == 3 || gettime(4) == 4 || gettime(4) == 5 || gettime(4) == 6 )

Posted

because your condition checking is wrong....it only check for monday...then your script only stopped on monday....

the correct condition would be

if( gettime(4) ) end;

refer gettime

so if i wan to held it on sunday only, it will be like this?

if(gettime(4) == 1 || gettime(4) == 2 || gettime(4) == 3 || gettime(4) == 4 || gettime(4) == 5 || gettime(4) == 6 )

Yes or

if( gettime(4) != 0 ) end;

Posted

because your condition checking is wrong....it only check for monday...then your script only stopped on monday....

the correct condition would be

if( gettime(4) ) end;

refer gettime

so if i wan to held it on sunday only, it will be like this?

if(gettime(4) == 1 || gettime(4) == 2 || gettime(4) == 3 || gettime(4) == 4 || gettime(4) == 5 || gettime(4) == 6 )

Yes or

if( gettime(4) != 0 ) end;

what does the "!" means?

Posted
! - Logical Not.

Reverses the boolean result of an expression. True will become false and

false will become true.

Example:

if(!callfunc("F_dosomething"))

{

mes "Doing something failed.";

close;

}

trunk/doc/script_commands.txt

// If gettime(4) is not 0 --> if day is not Sunday
if( gettime(4) != 0 ) end;

Posted (edited)

OnClock1400://
if(gettime(4) == 0 || if(gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5 ) end;

Something wrong???? i wan to make it held on 2 4 6 only.

No it's working.

OnClock1400:
if( gettime(4) % 2 != 0 ) end;

Your code works also with gettime(0)

0 % 2 == 0

and

i wan to make it held on 2 4 6 only

Just to point it out

Edited by Capuche
Posted

if(gettime(4) == 1 || gettime(4) == 2 || gettime(4) == 3 || gettime(4) == 4 || gettime(4) == 5 || gettime(4) == 6 ) end;

hmm. why it's still held on thursday , friday? i wan to make it held on sunday only swt. quite cnofuse

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