Advertisement
Guest User

Untitled

a guest
May 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var days;
  2. function start() {
  3.     var date = new Date();
  4.     if (date.getDay() == 0) { // sunday
  5.         cm.sendNext("Sorry, I don't work on Sundays");
  6.     } else { // any other day
  7.         cm.sendNext("Hi ! Wow today is "+getDay(date.getDay())+" \r\n PinkGatsby is awesome :)");
  8.         cm.gainExp(date.getDay()*1000);
  9.     }
  10.     cm.dispose();
  11. }
  12.  
  13. function getDay(day) {
  14.     if (!days) { // Do not initialize until we need to (Yes the difference is very insignificant but its more robust I guess.
  15.         days = new Array(7);
  16.         days[0] = "Sunday";
  17.         days[1] = "Monday";
  18.         days[2] = "Tuesday";
  19.         days[3] = "Wednesday";
  20.         days[4] = "Thursday";
  21.         days[5] = "Friday";
  22.         days[6] = "Saturday";
  23.     }
  24.     return days[day];
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement