Lukasek Posted November 4, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 18 Reputation: 0 Joined: 11/23/12 Last Seen: March 6, 2024 Share Posted November 4, 2020 Hello, How can I change reward for only account. In this script - script Coin Reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; login_reward = login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" coin for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } } getitem 675, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" coin"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 1; .reward_week = 2; .reward_month = 3; end; } Thank You Quote Link to comment Share on other sites More sharing options...
0 Poring King Posted November 4, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share Posted November 4, 2020 I use your code and this is the simple way to do it .@todays = gettime(5); if ( #login_reward != .@todays ) { //Get item here getitem 501,1; set #login_reward,.@todays; } mes "You already have the reward"; end; Quote Link to comment Share on other sites More sharing options...
0 Lukasek Posted November 4, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 18 Reputation: 0 Joined: 11/23/12 Last Seen: March 6, 2024 Author Share Posted November 4, 2020 Its not function Quote Link to comment Share on other sites More sharing options...
0 Poring King Posted November 4, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share Posted November 4, 2020 (edited) 17 minutes ago, Lukasek said: Its not function You mean you want to change the item reward into account bound ?HERE *getitembound <item id>,<amount>,<bound type>{,<account ID>}; *getitembound "<item name>",<amount>,<bound type>{,<account ID>}; This command behaves identically to 'getitem', but the items created will be bound to the target character as specified by the bound type. All items created in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in some cases cannot be traded or stored. Valid bound types are: Bound_Account : Account Bound item Bound_Guild : Guild Bound item Bound_Party : Party Bound item Bound_Char : Character Bound item Change your getitem 675, .@count; Into getitembound 675, .@count, Bound_Account; Edited November 4, 2020 by Poring King Quote Link to comment Share on other sites More sharing options...
0 Lukasek Posted November 4, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 18 Reputation: 0 Joined: 11/23/12 Last Seen: March 6, 2024 Author Share Posted November 4, 2020 I need one reward for the whole account for day. //this script is for every char on account, I need One reward for whole account and not character. - script Coin Reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; login_reward = login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" coin for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } } getitem 675, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" coin"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 1; .reward_week = 2; .reward_month = 3; end; } Quote Link to comment Share on other sites More sharing options...
0 Poring King Posted November 4, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share Posted November 4, 2020 Just now, Lukasek said: I need one reward for the whole account for day. //this script is for every char on account, I need One reward for whole account and not character. - script Coin Reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; login_reward = login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" coin for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } } getitem 675, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" coin"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 1; .reward_week = 2; .reward_month = 3; end; } I give you what you need bro -.- Quote Link to comment Share on other sites More sharing options...
0 Lukasek Posted November 4, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 18 Reputation: 0 Joined: 11/23/12 Last Seen: March 6, 2024 Author Share Posted November 4, 2020 At the moment this script gives to each character coin, but I need to get only one character a coin everyday. Quote Link to comment Share on other sites More sharing options...
0 Poring King Posted November 4, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share Posted November 4, 2020 (edited) 21 minutes ago, Lukasek said: At the moment this script gives to each character coin, but I need to get only one character a coin everyday. Look my code i add "(#)" On #Login_reward then i also add "set #Login_reward, .@todays" Try this made on phone - script Coin Reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( #login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day #login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( #login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( #login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( #login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( #login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; #login_reward = #login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" coin for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; #login_reward = #login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } } getitem 675, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" coin"+ .@weekly_message$ + .@montly_message$ +"."; set #login_reward,.@todays; end; OnInit: .reward_day = 1; .reward_week = 2; .reward_month = 3; end; } Edited November 4, 2020 by Poring King Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted November 4, 2020 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 4, 2020 (edited) interesting script, but low readability if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } if I understood this correctly, this means... if I being online everyday for 2 months on 1st month, no problem but on 2nd month, login += pow(2,30) again and will cause integer overflow I think just use a simple daily login script like Poring King provided earlier ... if its bug, anyone can fix it easily, not like this one using confusing bitmask where it doesn't actually saving in bits ... Edited November 4, 2020 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Question
Lukasek
Hello,
How can I change reward for only account. In this script
- script Coin Reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; login_reward = login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" coin for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" coin for being online a month"; } } getitem 675, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" coin"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 1; .reward_week = 2; .reward_month = 3; end; }
Thank You
Link to comment
Share on other sites
8 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.