Jump to content
  • 0

Show time remaning before claiming supply every 12 hours


Muskellunge

Question


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

Hello. Im requesting some help on how to show time remaining before they can get supplies again after 12 hours.


if(gettimetick(2) - #lastTimeTalked > (60 * 60 * 12)) {
mes .@rewname$;
mes "Hello "+strcharinfo(0)+"";
mes "Do you wish to receive your daily supplies today?";
mes "- ^0000FF100x Free Cold Medicine^000000";
mes "- ^0000FF25x Free Yggdrasil Seeds^000000";
mes "- ^0000FF25x Free Yggdrasil Berries^000000";
mes "^FF0000Note : Free Supplies have delays per use.";
next;
switch(select("- Yes,sure!:- No,bye!:- Cancel")) {
case 1:
.@weight = 100 * Weight / MaxWeight;
if (50 <= .@weight) {
mes .@rewname$;
        mes "You are currently at " + .@weight + " percent of your maximum weight.";
mes "Make sure that you are below 50% then come back";
        close;
    }
mes .@rewname$;
mes "Okay here is your items!!";
next;
mes .@rewname$;
getitem 8011,25;
getitem 8012,25;
getitem 8013,100;
mes "Okay have fun playing and come back tomorrow!!";
set #lastTimeTalked,gettimetick(2);
close;
case 2:
mes .@rewname$;
mes "Uhhh. Okay?? Lol..";
close;
case 3:
close;
}
}
mes .@rewname$;
mes "Sorry, you have to wait for 12 hours to claim your free supplies again.";
mes "Thank you!!";
close;

OnInit:
waitingroom "Daily Supplies",0;
}

So instead of 


mes .@rewname$;
mes "Sorry, you have to wait for 12 hours to claim your free supplies again.";
mes "Thank you!!";
close;

I'm hoping to get Sorry you have to wait for "Time Remaining" before claiming your supplies again. Thank you so much.

Edited by Emistry
use codebox
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

There you go

.@delay = 60*60*12 - (gettimetick(2) - #lastTimeTalked);
.@hours = .@delay / 60*60;
.@minutes = (.@delay - (.@hours*60*60)) / 60;
.@seconds = (.@delay - (.@hours*60*60) - (.@minutes*60));
mes "Sorry, you have to wait "+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@minutes+" minute"+(.@minutes>1?"s":"")+" "+.@seconds+" second"+(.@seconds>1?"s":"")+" to claim your free supplies again.";

Not tested :P

 

See you

Link to comment
Share on other sites

  • 0

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

 

 

.@delay = 60*60*12 - (gettimetick(2) - #lastTimeTalked);

.@hours = .@delay / 60*60;

.@minutes = (.@delay - (.@hours*60*60)) / 60;

.@seconds = (.@delay - (.@hours*60*60) - (.@minutes*60));

mes "Sorry, you have to wait "+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@minutes+" minute"+(.@minutes>1?"s":"")+" "+.@seconds+" second"+(.@seconds>1?"s":"")+" to claim your free supplies again.";

i tried using it inside the script, gave no errors but im sure its not working right.

 

 

ryrjQxx.png?1

 

That's what it says.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Oops

     .@delay = 60*60*12 - (gettimetick(2) - #lastTimeTalked);
--   .@hours = .@delay / 60*60;
++   .@hours = .@delay / (60*60);
     .@minutes = (.@delay - (.@hours*60*60)) / 60;
     .@seconds = (.@delay - (.@hours*60*60) - (.@minutes*60));
     mes "Sorry, you have to wait "+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@minutes+" minute"+(.@minutes>1?"s":"")+" "+.@seconds+" second"+(.@seconds>1?"s":"")+" to claim your free supplies again.";
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...