Jump to content
  • 0

Question

Posted (edited)

Any idea?

Every Hour you get reward points
After 8 consecutive hours, rewarding will start all over again
Rewards without Voting Events Triggered
First Hour: 10 Rewards Points
Second Hour: 20 Reward Points
Third Hour: 30 Reward Points
Fourth Hour: 40 Reward Points
Fifth Hour: 50 Reward Points
Sixth Hour: 60 Reward Points
7th Hour: 70 Reward Points
8th Hour: 80 Reward Points

I thought this is script not working any posible script please help me.. thanks B)B)

//===== 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 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
//====================================================================
-    script    hourlypoints    -1,{
//--Start of the Script
OnPCLoginEvent:
    addtimer .timer,"hourlypoints::OnPointGet";
    end;
    
OnPointGet:
    //while(checkvending() >= 1 || checkchatting() == 1 || checkidle()>=.dlimit) {
        //sleep2 .delay;
        //if(.@mes$=="")
            //dispbottom set(.@mes$,"The hourly points event haulted because you were vending, chatting, or idle.");
    //}
    set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt;
    dispbottom "You received "+.point_amt+" Reward Cash Points by staying ingame for 1 hour";
    dispbottom "Current Balance = "+#KAFRAPOINTS+" Reward Cash Points";
    set @consecutive_hour, @consecutive_hour + 1;

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

OnInit:
    set .timer, 1000*60*60; //Timer in milliseconds.
    set .2cpoint_amt, 20; //Points gained for consecutive time online.
    set .3cpoint_amt, 30; //Points gained for consecutive time online.
    set .4cpoint_amt, 40; //Points gained for consecutive time online.
    set .5cpoint_amt, 50; //Points gained for consecutive time online.
    set .6cpoint_amt, 60; //Points gained for consecutive time online.
    set .7cpoint_amt, 70; //Points gained for consecutive time online.
    set .8cpoint_amt, 80; //Points gained for consecutive time online.    
    set .point_amt, 10; //Normal points gained.
    //set .delay, 1000; //Delay for idle re-check check.
    //set .dlimit, 60*5; //Stop points if afk greater then in seconds.
}

 

Edited by Akkarin
Put code into codebox instead of quotes.

8 answers to this question

Recommended Posts

  • 0
Posted
On 4/21/2017 at 1:38 AM, Sour- said:

How/where to insert checkvending?

that script do not check vending, try this 

-	script	hourlypoints	-1,{
 
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
   
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1) {
    dispbottom "The hourly badge rewards has stopped because you were vending . Please relog if you wish to start again.";
    stopnpctimer;
    end;
}
 
OnTimer60000:
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
    set @minute,0;
    getitem 7859,1;
    dispbottom "You received 1 "+getitemname( 7859 )+" by staying ingame for 1 hour.";
    set @consecutive_hour, @consecutive_hour + 1;
    }
//Check for 12 hours consecutive
    if(@consecutive_hour == 5) {
    set @consecutive_hour,0;
    getitem 7859,5;
    dispbottom "You received 5 "+getitemname( 7859 )+" by staying ingame for consecutive of 5 hours.";
    }
stopnpctimer;
initnpctimer;
end;
 
}

 

On 4/23/2017 at 10:03 AM, pinyinhuo said:

Is it possible, you get an item instead points like tcgs or coins?

the script i have posted get you item only

change 7589 to whatever itemid you want to place 

  • Upvote 2
  • 0
Posted
// https://rathena.org/board/topic/108276-hourly-points/

-	script	hourly_point_main	-1,{
	
	OnInit:
		.npc_name$ = strnpcinfo(3);
		bindatcmd "check",.npc_name$+"::OnAtcommand";
		end;
		
	OnAtcommand:
		dispbottom "Accumulated "+#daily_minute_count;
		end;
		
	OnUpdate:
	if(checkvending() >= 1) {
	dispbottom "Vending is not allowed.";
	deltimer .npc_name$+"::OnUpdate";
	end;
}
		#daily_minute_count++;
		deltimer .npc_name$+"::OnUpdate";
		dispbottom "Accumulated "+#daily_minute_count+" minute(s)";
		switch ( #daily_minute_count ) {
			default:
				break;
			case 60: // 60 minutes
				#CASHPOINT += 10;
				getitem 7227,1;
				break;
			case 120: // 120 minutes
				#CASHPOINT += 20;
				getitem 7227,2;
				break;
			case 180: // 180 minutes
				#CASHPOINT += 30;
				getitem 7227,3;
				break;
			case 240: // 240 minutes
				#CASHPOINT += 40;
				getitem 7227,4;
				break;
			case 300: // 300 minutes
				#CASHPOINT += 50;
				getitem 7227,6;
				break;
			case 360: // 360 minutes
				#CASHPOINT += 60;
				getitem 7227,7;
				break;
			case 420: // 420 minutes
				#CASHPOINT += 70;
				getitem 7227,8;
				break;
			case 480: // 480 minutes
				#CASHPOINT += 80;
				getitem 7227,9;
				#daily_minute_count = 0; // reset.
				break;
		}
		
	OnPCLoginEvent:
		addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
		end;
}

Hi everyone ..

may i know why this script only rewarding the item " 7227 " but the #CASHPOINT reward is not working .. 

  • 0
Posted (edited)

Hi Guys,

 

Can anyone help me how to pause the timer when vending? Thanks!

// https://rathena.org/board/topic/108276-hourly-points/

-	script	hourly_point_main	-1,{
	
	OnInit:
		.npc_name$ = strnpcinfo(3);
		bindatcmd "check",.npc_name$+"::OnAtcommand";
		end;
		
	OnAtcommand:
		dispbottom "Accumulated "+#daily_minute_count;
		end;
		
	OnUpdate:
		#daily_minute_count++;
		deltimer .npc_name$+"::OnUpdate";
		//dispbottom "Accumulated "+#daily_minute_count+" minute(s)";
		switch ( #daily_minute_count ) {
			default:
				break;
			case 15: // 15 minutes
				#CASHPOINTS += 1;
				dispbottom "You received 1 CashPoint by staying ingame for 15 minutes.";
				dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
				//getitem 512,2;
				break;
			case 30: // 30 minutes
				#CASHPOINTS += 1;
				dispbottom "You received 1 CashPoint by staying ingame for 30 minutes.";
				dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
				//getitem 512,3;
				break;
			case 45: // 45 minutes
				#CASHPOINTS += 1;
				dispbottom "You received 1 CashPoint by staying ingame for 45 minutes.";
				dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
				//getitem 512,4;
				break;
			case 60: // 60 minutes
				#CASHPOINTS += 2;
				dispbottom "You received 2 CashPoint by staying ingame for 60 minutes.";
				dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
				//getitem 512,6;
				break;

}
		
	OnPCLoginEvent:
		addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
		end;
}

 

Edited by NumLock

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...