Jump to content
  • 0

Hourly Script remaining time


Bringer

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  746
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

-	script	hourlypoints	-1,{
//--Start of the Script
OnPCLoginEvent:
	atcommand "@refresh "+strcharinfo(0);
	addtimer .timer,"hourlypoints::OnPointGet";
	set @hourly_points_timer, gettimetick(2) + ( .timer / 1000 );
	dispbottom "Hourly Rewards have been started for this character.";
	end;

OnPointGet:
	set #hourlypoints, #hourlypoints + .point_amt;
	dispbottom "You received "+.point_amt+" Reward Hourly Points by staying ingame for 1 hour";
	dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
	set @consecutive_hour, @consecutive_hour + 1;

	//Check for 2 hours consecutive
	if(@consecutive_hour == 2) {
		set #HourlyPoints, #HourlyPoints + .2cpoint_amt;
		dispbottom "You received "+.2cpoint_amt+" Reward Hourly Points due to playing for 2 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;

	}
    
	//Check for 3 hours consecutive
	else if(@consecutive_hour == 3) {
		set #HourlyPoints, #HourlyPoints + .3cpoint_amt;
		dispbottom "You received "+.3cpoint_amt+" Reward Hourly Points due to playing for 3 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 4 hours consecutive
	else if(@consecutive_hour == 4) {
		set #HourlyPoints, #HourlyPoints + .4cpoint_amt;
		dispbottom "You received "+.4cpoint_amt+" Reward Hourly Points due to playing for 4 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 5 hours consecutive
	else if(@consecutive_hour == 5) {
		set #HourlyPoints, #HourlyPoints + .5cpoint_amt;
		dispbottom "You received "+.5cpoint_amt+" Reward Hourly Points due to playing for 5 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 6 hours consecutive
	else if(@consecutive_hour == 6) {
		set #HourlyPoints, #HourlyPoints + .6cpoint_amt;
		dispbottom "You received "+.6cpoint_amt+" Reward Hourly Points due to playing for 6 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 7 hours consecutive
	else if(@consecutive_hour == 7) {
		set #HourlyPoints, #HourlyPoints + .7cpoint_amt;
		dispbottom "You received "+.7cpoint_amt+" Reward Hourly Points due to playing for 7 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;
	}
    
	//Check for 8 hours consecutive
	else if(@consecutive_hour == 8) {
		set @consecutive_hour,0;
		set #HourlyPoints, #HourlyPoints + .8cpoint_amt;
		dispbottom "You received "+.8cpoint_amt+" Reward Hourly Points due to playing for 8 consecutive hours";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
	}
	addtimer .timer,"hourlypoints::OnPointGet";
	end;

OnCmdHour:
	mes "^0033ff[ War Server ]^000000";
	mes "Total Hours Online " +@consecutive_hour+ "";
	mes "Reward Hourly Points : ^FF0000[ "+#HourlyPoints+" ]^000000";
	mes " ";
	message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!";
	end;

OnInit:
    bindatcmd "reward","hourlypoints::OnCmdHour";
    set .timer, 1000*60*60; //Timer in milliseconds.
    set .2cpoint_amt, 20;
    set .3cpoint_amt, 30;
    set .4cpoint_amt, 40;
    set .5cpoint_amt, 50;
    set .6cpoint_amt, 60;
    set .7cpoint_amt, 70;
    set .8cpoint_amt, 80; 
    set .point_amt, 10; //Normal points gained.
}

there 's a problem or a bug on the timer of hourly time remaining. Once i got the one hour reward points and i use @reward the timer show blank message. please check screenshot attached

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

Eh, that "Time2Str" exists?

I'm checking the script_commands.txt and am not being able to find it.

If that is a custom function, you should check it out because the proble might be there.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  746
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

1 hour ago, nakano15 said:

Eh, that "Time2Str" exists?

I'm checking the script_commands.txt and am not being able to find it.

If that is a custom function, you should check it out because the proble might be there.

https://github.com/rathena/rathena/blob/master/npc/other/Global_Functions.txt#L344

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...