Jump to content
  • 0

Hourly Reward Time Remaining


shockwar14

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   0
  • Joined:  04/19/13
  • Last Seen:  

Hi Guys,

 

 

Is it possible to have a @command script to know the time remaining before the hourly reward come?.

 

Ex:

 

If I type @ctr a display bottom will come out saying:

 

"10 minutes left before you get your Hourly Reward/s."

 

 

 

 

Thank you.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Please provide the script thank you.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   0
  • Joined:  04/19/13
  • Last Seen:  

Please provide the script thank you.

Here you go..

//===== Hourly Points Script =========================================
//===== By: ==========================================================
//= GorthexTiger modified by Nibi
//===== Current Version: =============================================
//= 1.0
//===== 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 12 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 Kafrapoints 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
//====================================================================

-	script	hourlyreward	-1,{

//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
    
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1 || checkchatting() == 1) {
    dispbottom "The Hourly Rewards event stopped because you were vending / chatting / afk. Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
//Check if Idle
getmapxy( .@map$, .@x, .@y, 0 );
if(@map$ == .@map$ && @x == .@x && @y == .@y) {
    set @afk, @afk + 1;
}
//If move timer resets
else {
    set @afk, 0;
}
    set @map$, .@map$; set @x, .@x; set @y, .@y;
//Idle Check for 7 Minutes
if(@afk == 7) {
    dispbottom "The Hourly Rewards event stopped because you were idle for 7 minutes. Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
end;

OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    getitem 25010,2;
    set #CASHPOINTS,2;	
    dispbottom "You received 2 "+getitemname(25010)+" by staying ingame for 1 hour.";
    dispbottom "You now have "+countitem(25010)+" Midgard Coin!";
    dispbottom "You now have "+#CASHPOINTS+" Cash Points!";
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 12) {
    set @consecutive_hour,0;
    getitem 25010,20;
    set #CASHPOINTS,20;
    dispbottom "You received 20 "+getitemname(25010)+" by playing for 12 consecutive hours.";
    dispbottom "You now have "+countitem(25010)+" Midgard Coin!";
    dispbottom "You now have "+#CASHPOINTS+" Cash Points!";
    }
stopnpctimer;
initnpctimer;
end;

}
//--End of the Script

Thanks

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Hi Guys,

Is it possible to have a @command script to know the time remaining before the hourly reward come?.

 

Ex:

If I type @ctr a display bottom will come out saying:

"10 minutes left before you get your Hourly Reward/s."

 

Thank you.

 

Literally just did this last week and I'd ask you to search a bit harder before posting but for some reason the advanced search function wasn't working for me.

Anyways if you want to see that post you can view it https://rathena.org/board/topic/105844-script-mod/

 

I've just went ahead and modified the script to your request and added a current idle check.

//===== Hourly Points Script =========================================
//===== By: ==========================================================
//= GorthexTiger modified by Nibi
//===== Current Version: =============================================
//= 1.4
//===== 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 Kafrapoints 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)
//====================================================================
-	script	hourlypoints	-1,{
    
OnPointGet:
	while(checkvending() >= 1 || checkchatting() == 1 || checkidle() >= .idle) {
		if( .@mes$ == "" ) {
			dispbottom set( .@mes$, "The hourly points event haulted because you were vending, chatting, or idle." );
			set @hourly_points_timer, 0;
		}
		sleep2 .delay;
	}
	set #CASHPOINTS, #CASHPOINTS + .point_amt;
	dispbottom "You received "+.point_amt+" Kafrapoints by staying ingame for 1 hour";
	dispbottom "Current Balance = "+#CASHPOINTS+" Kafrapoints";
	set @consecutive_hour, @consecutive_hour + 1;

	//Check for 3 hours consecutive
	if(@consecutive_hour == 3) {
		set @consecutive_hour,0;
		set #CASHPOINTS, #CASHPOINTS + .cpoint_amt;
		dispbottom "You receive "+.cpoint_amt+" Kafrapoints in playing for 12 consecutive hours";
		dispbottom "Current Balance = "+#CASHPOINTS+" Kafrapoints";
	}
	
OnPCLoginEvent:
	addtimer .timer,"hourlypoints::OnPointGet";
	set @hourly_points_timer, gettimetick(2) + ( .timer / 1000 );
	end;
	
OnCmdHour:
	message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" remaining before you get your Hourly Reward(s).":"Something went wrong or you're considered idle at the moment try relogging!";
	end;

OnInit:
	bindatcmd "ctr","hourlypoints::OnCmdHour";
	set .timer, 1000*15*15; //Timer in milliseconds.
	set .cpoint_amt, 15; //Points gained for consecutive time online.
	set .point_amt, 5; //Normal points gained.
	set .delay, 1000; //Delay for idle re-check check.
	set .idle, 60; //Player is idle after not moving for this many seconds.
}
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...