Jump to content
  • 1

Customized Hourly Points


MusiLiciouS

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

Good Day..

I need some help in editing this script that I found... 

// https://rathena.org/board/topic/108246-hourly-points/ 
-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly",    .npc_name$ + "::OnCheck";
        end;
        
    OnClock0000:
        query_sql( "DELETE FROM acc_reg_num` WHERE `key` = '#reward' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " );
        addrid(0);
        #reward = -1;
        
    OnUpdate:
        deltimer .npc_name$+"::OnUpdate";
        #reward++;
        switch ( #reward ) {
            case 1:
                #reward += 1;
                break;
            case 2:
                #reward += 2;
                break;
            case 3:
                #reward += 3;
                break;
            case 4:
                #reward += 4;
                break;
            case 5:
                #reward += 5;
                break;
            default: break;
        }
        
    OnPCLoginEvent:
        if ( #reward < .max_hour ) {
            @timer = gettimetick(2) + .duration;
            addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
        }
        if ( #reward )    dispbottom "[ Hourly Rewards ] " + #reward + "/" + .max_hour + " hour" + ((#reward > 1)?"s":"") + " played!",0x9ae2d7;
        end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 -  Can someone remove the 12'o clock reset.. like it will automatically reset after the max hour..

 -  Show the total Reward Points you have as the player login in game..

 - For the hourly command, pls show how much more time to get the next reward.

 -  Can someone explain this part ... in every case how many points is added?

           case 1:
                #reward += 1;
                break;
            case 2:
                #reward += 2;
                break;
            case 3:
                #reward += 3;
                break;
            case 4:
                #reward += 4;
                break;
            case 5:
                #reward += 5;
                break;
            default: break;

Im planning to have it 10 points in the 1st hour.. 20 for 2hours 30 for 3hrs and so on

THANK YOU SO MUCH for those who will reply to this... 

Edited by MusiLiciouS
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

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

15 hours ago, MusiLiciouS said:

Good Day..

I need some help in editing this script that I found... 

 -  Can someone remove the 12'o clock reset.. like it will automatically reset after the max hour..

 -  Show the total Reward Points you have as the player login in game..

 - For the hourly command, pls show how much more time to get the next reward.

...

-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Edited by Skorm
Link to comment
Share on other sites

  • 0

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

On 3/5/2017 at 1:07 PM, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

hello @SkormSkorm can you add this suggestion im running my server official vip system

if the player has vip status the hourly points give more 50%

for normal players give 10,20,30,40 bla bla

vip player 15,30, bla bla

Edited by Bringer
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  212
  • Reputation:   5
  • Joined:  01/24/12
  • Last Seen:  

On 3/5/2017 at 1:07 PM, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10;
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Question Allows players who afk and pubbing to gain points except players who use @autotrade or Vending I see this script any one help me??

Link to comment
Share on other sites

  • 0

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

On 3/22/2017 at 4:37 PM, Dev Blaze said:

Question Allows players who afk and pubbing to gain points except players who use @autotrade or Vending I see this script any one help me??

There are other hourly points scripts that prevent that. Like this one that I modified awhile ago.

http://upaste.me/66e5267563e64fefe

Link to comment
Share on other sites

  • 0

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

2 hours ago, Skorm said:

There are other hourly points scripts that prevent that. Like this one that I modified awhile ago.

http://upaste.me/66e5267563e64fefe

what about if VIp user i want add 50% Points on this script ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   2
  • Joined:  03/21/17
  • Last Seen:  

Newbie here.How to activate this script?can some one explain it step by step(where to placeit etc . To activate it)

Link to comment
Share on other sites

  • 0

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

On 3/24/2017 at 10:07 AM, NakedWolf said:

Newbie here.How to activate this script?can some one explain it step by step(where to placeit etc . To activate it)

https://github.com/rathena/rathena/wiki/Adding-a-Script

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   2
  • Joined:  03/21/17
  • Last Seen:  

I had see this already (https://github.com/rathena/rathena/wiki/Adding-a-Script) but its for npc rite

How to add hourly points script or other scripts like that other than npc

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   15
  • Joined:  01/26/12
  • Last Seen:  

@NakedWolf an Npc is a script there are different types for example this hourly points npc or script doesn't show on the server it's an invisible npc or script that triggers every hour and gives the player points 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   2
  • Joined:  03/21/17
  • Last Seen:  

Thank you @sikiro

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

Will this script affect VIP Players? Like there's an additional 50% points for VIP Players.

Link to comment
Share on other sites

  • 0

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

On 4/5/2017 at 8:47 AM, MusiLiciouS said:

Will this script affect VIP Players? Like there's an additional 50% points for VIP Players.

...

-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        .vip_multi = 2;
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10 * ( vip_status(1) ? .vip_multi : 1 );
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Link to comment
Share on other sites

  • 0

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

8 hours ago, Skorm said:

...


-	script	hourly_point_main	-1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 3600;
        .npc_name$ = strnpcinfo(3);
        .vip_multi = 2;
        bindatcmd "hourly", .npc_name$ + "::OnCheck";
        end;
		
    OnClock0000:
        deletearray $@hourly_tick;
        
    OnUpdate:
		.@aid = getcharid(3) & 0xFFFF;
		deltimer .npc_name$+"::OnUpdate";
		$@hourly_ticks[.@aid]++;
		#reward += $@hourly_ticks[.@aid] * 10 * ( vip_status(1) ? .vip_multi : 1 );
        
    OnPCLoginEvent:
		.@aid = getcharid(3) & 0xFFFF;
		if ( $@hourly_ticks[.@aid] < .max_hour ) {
			@timer = gettimetick(2) + .duration;
			addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		} else {
			dispbottom "[ Hourly Rewards ] You've reached the daily maximum of "+.max_hour+" hours played, well done!",0x9ae2d7;
			end;
		}
		if ( #reward && $@hourly_ticks[.@aid] )
			dispbottom "[ Hourly Rewards ] " + $@hourly_ticks[.@aid] + "/" + .max_hour + " hours played, "+#reward+" point(s)!",0x9ae2d7;
		end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

 

Hello Sir i want to use your Hourly System
1.Please Remove the Max Hour
2.Vendor will stop the hourly system
4. additional 50% points for VIP Players. { DONE }

Edited by Bringer
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...