Wednesday, October 14, 2020

How to send Monthly Reward to players

now I have this script I want to send the monthly reward to players by mail, here's my take on how to tackle this problem
yup, basically I just added a few more line down there

now break it into 3 parts

  1. when the server first load the script, it will execute OnInit: and store the $poringkill_last_given variable
    it will store the value as '202010', 2020 is the year, and 10 is the current month
  2.  then on 12:00am, it will execute OnClock0000: label,
    with the if (gettime(GETTIME_DAYOFMONTH) != 1) end; to halt the script if it isn't the day 1 of the month
    since it is a new month, '202011' is different from '202010' and thus execute the condition below
  3. The second condition of OnInit: label is to make sure it will run L_GiveMonthlyReward: label IF the server isn't online during 12:00am of day 1 of the month.
    It will compare to the $poringkill_last_given variable every time, if it is different month, then it will execute the statement below
    it has to bypass the if (gettime(GETTIME_DAYOFMONTH) != 1) end; so even if the server somehow didn't even online on day 1 of the month, it will still giving out monthly reward for previous month

External Link:
Monthly MVP Rank

See Also:
How to send Weekly Rewards to players

No comments:

Post a Comment

Linux compiler error that never shown on Visual Studio

let's just admit Visual Studio sux ... ok ? right now, if you want to host a Private Ragnarok Online server, its just better to choose...