Bringer Posted April 23, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: 16 hours ago Share Posted April 23, 2017 This Script is made by @Haziel can anyone modfi this ? 1.Remove 5 hours per day. the timer will reset at 12 midnight. 2. Hourly Stop When Vending or @autotrade Spoiler - 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` = '#daily_hour_count' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " ); addrid(0); #daily_hour_count = -1; OnUpdate: deltimer .npc_name$+"::OnUpdate"; #daily_hour_count++; switch ( #daily_hour_count ) { case 1: //#CASHPOINT += 1; getitem 512,1; break; case 2: //#CASHPOINT += 2; getitem 512,2; break; case 3: //#CASHPOINT += 3; getitem 512,3; break; case 4: //#CASHPOINT += 4; getitem 512,4; break; case 5: //#CASHPOINT += 5; getitem 512,6; break; default: break; } OnPCLoginEvent: if ( #daily_hour_count < .max_hour ) { @timer = gettimetick(2) + .duration; addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate"; } if ( #daily_hour_count ) dispbottom "[ Hourly Rewards ] " + #daily_hour_count + "/" + .max_hour + " hour" + ((#daily_hour_count > 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; } Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted April 23, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: 16 hours ago Author Share Posted April 23, 2017 bump anyone can help me? Quote Link to comment Share on other sites More sharing options...
0 Cyro Posted April 23, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 1138 Reputation: 290 Joined: 04/29/13 Last Seen: July 20, 2024 Share Posted April 23, 2017 - 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; } Quote Link to comment Share on other sites More sharing options...
Question
Bringer
This Script is made by @Haziel can anyone modfi this ?
1.Remove 5 hours per day. the timer will reset at 12 midnight.
2. Hourly Stop When Vending or @autotrade
- 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` = '#daily_hour_count' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " ); addrid(0); #daily_hour_count = -1; OnUpdate: deltimer .npc_name$+"::OnUpdate"; #daily_hour_count++; switch ( #daily_hour_count ) { case 1: //#CASHPOINT += 1; getitem 512,1; break; case 2: //#CASHPOINT += 2; getitem 512,2; break; case 3: //#CASHPOINT += 3; getitem 512,3; break; case 4: //#CASHPOINT += 4; getitem 512,4; break; case 5: //#CASHPOINT += 5; getitem 512,6; break; default: break; } OnPCLoginEvent: if ( #daily_hour_count < .max_hour ) { @timer = gettimetick(2) + .duration; addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate"; } if ( #daily_hour_count ) dispbottom "[ Hourly Rewards ] " + #daily_hour_count + "/" + .max_hour + " hour" + ((#daily_hour_count > 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; }
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.