I'm currently using Sader's Hourly Rewards, need help on how to put command that can check the time remaining for the player to get an hourly points?
Script is below:
//===== Hourly Points Script =========================================
//===== By: ==========================================================
//= GorthexTiger modified by Nibi
//===== Current Version: =============================================
//= 1.4.1
//===== Compatible With: =============================================
//= Any eAthena Version
//===== Description: =================================================
//= Get Points every successful hours of gameplay, you cannot get
//= the points even if you miss a second or a minute. A player will
//= get a very big bonus if they played 3 hours consecutively
//= or without logging out of the game. If the player is vending
//= the script will then stop.
//===== Additional Comments: =========================================
//= You can modify the script to your liking.
//= The default points is Free Points change it anyway if you like.
//= 1.1 = Check Chatting too
//= 1.2 = 5 Minute Idle Check & @at/@autotrade check.
//= 1.3 = Corrected the current balance line on 12 Hours Consecutive
//= 1.4 = Added command to check remaining time and updated idle check. (Skorm)
//= 1.4.1 = Modified the msgs to display according to .timer. (Skorm)
//====================================================================
- script hourlypoints3 -1,{
OnPointGet:
//Check for idle.
while(checkvending() >= 1 || checkchatting() == 1 || checkidle() >= .idle) {
if( .@mes$ == "" ) {
dispbottom set( .@mes$, "The hourly points event stopped because you were vending, chatting, or idle!" );
set @hourly_points_timer, 0;
}
sleep2 .delay;
}
@consecutive_timer++;
.@time_string$ = Time2Str( @consecutive_timer * ( .timer / 1000 ) );
dispbottom "You received "+.points+" Free Point(s) by staying ingame for 1 hour.";
#KAFRAPOINTS = #KAFRAPOINTS + .points;
dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Point(s)";
@consecutive_bonus++;
//Check for consecutive timer.
if(@consecutive_bonus == .cdelay) {
@consecutive_bonus = 0;
#KAFRAPOINTS = #KAFRAPOINTS + .cpoints;
dispbottom "You receive a bonus "+.cpoints+" Free Point(s) by playing for minimum 3 hours consecutively!!!";
dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Point(s)";
}
OnPCLoginEvent:
addtimer .timer,"hourlypoints3::OnPointGet";
@hourly_points_timer = gettimetick(2) + ( .timer / 1000 );
end;
OnCheck:
message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!";
end;
OnInit:
bindatcmd "check","hourlypoints3::OnCheck"; //@check to view time till next point.
.timer = 1000*60*10; //Timer in milliseconds. ( Default: 1000*60*60 [ = 1 Hour ] )
.cdelay = 3; //Delay before receiving the consecutive bonus. ( Default: 3 [ { ~ 3 Hours } *Using default timer ] )
.cpoints = 10; //Points gained for consecutive time online. ( Default: 10 )
.points = 1; //Normal points gained. ( Default: 1 )
.delay = 600000; //Delay for idle re-check check. ( Default: 1000 [ = 1 Second ] )
.idle = 60*5; //Player is idle after not moving for this many seconds. ( Default: 60*5 [ = 5 Minutes ] )
}
Question
DrakeSky
Hi! Scripters,
I'm currently using Sader's Hourly Rewards, need help on how to put command that can check the time remaining for the player to get an hourly points?
Script is below:
Use a codebox
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.