Jump to content
  • 0

Timer mistake, again.


Auryn

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Could someone explain to me what did I do wrong about timer ?

Cause once I gave my item, I can't talk to him anymore.

Short part :

mes "[Rain]";
mes "Please come back later, I need to concentrate.";
set .@timer, gettimetick(2)-q_timer;
set .@wait, 9000-.@timer; //15 minutes
set refat,1;
close;

if((refat == 1 || .@timer < 9000)){
mes "[Rain]";
mes "Please come back later, I need to concentrate.";
close;
}else{
set rain,2;
mes "[Rain]";
mes "Oh, it's you !";
next;
mes "[Rain]";
mes "Here for you.";
getitem 6090,1;
close;

Edited by Auryn
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1131
  • Joined:  05/27/12
  • Last Seen:  

set .@timer, gettimetick(2)-q_timer; // q_timer is not defined
set .@wait, 9000-.@timer; // variable .@wait is not used
set refat,1;
close;
// needs closing curly
if((refat == 1 || .@timer < 9000)){ // should be &&, and .@var is not defined
close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Ok, I think I get it.

So, is it correct this way ?

mes "[Rain]";
mes "Reviens me voir plus tard s'il te plait, j'ai besoin de me concentrer.";
set q_timer, gettimetick(2);
set refat,1;
close;
}
if((refat == 1 && .@timer < 9000)){
mes "[Rain]";
mes "Reviens me voir plus tard s'il te plait, j'ai besoin de me concentrer.";
close;
}else{ // (...)

Edited by Auryn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1131
  • Joined:  05/27/12
  • Last Seen:  

No, you didn't fix the last error. I posted a solution in your other thread yesterday, you must've missed it.

//...
set q_timer, gettimetick(2)+<delay time>;
//...
if (refat == 1 && gettimetick(2) < q_timer) {
//...

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Effectivly I missed it, thanks Euphy for your presence & support.

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