// https://rathena.org/board/topic/108246-hourly-points/ - script hourly_point_main -1,{ OnInit: .max_minute = 300; bindatcmd "check",strnpcinfo(3)+"::OnAtcommand"; .npc_name$ = strnpcinfo(3); end; OnAtcommand: dispbottom "Accumulated "+#daily_minute_count+" / "+.max_minute+" minute(s) - "+ ( ( #daily_minute_count < .max_minute )?" In Progress":"Completed" ); end; OnClock0000: query_sql( "DELETE FROM acc_reg_num` WHERE `key` = '#daily_minute_count' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " ); addrid(0); #daily_minute_count = -1; OnUpdate: deltimer .npc_name$+"::OnUpdate"; #daily_minute_count++; switch ( #daily_minute_count ) { default: break; case 60: // 60 minutes #CASHPOINT += 1; getitem 512,1; break; case 120: // 120 minutes #CASHPOINT += 2; getitem 512,2; break; case 180: // 180 minutes #CASHPOINT += 3; getitem 512,3; break; case 240: // 240 minutes #CASHPOINT += 4; getitem 512,4; break; case 300: // 300 minutes #CASHPOINT += 5; getitem 512,6; break; } OnPCLoginEvent: dispbottom "Accumulated "+#daily_minute_count+" minute(s)"; if ( #daily_minute_count < .max_minute ) { addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate"; } end; }