Jump to content
  • 0

Help to add Idle Check or afk check, Vending Check?


Musika6988

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   6
  • Joined:  09/09/13
  • Last Seen:  

Hi rAthena Scripters!

Can anyone please help me on how to add 20 mins. Idle check, Vending Check, on this script please so that it won't give rewards? It will be very much appreciated! :)

Quote

-    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:
    dispbottom "Hourly Reward have been initiated.";
    dispbottom "You will receive a Reward if you stay active every hour.";
        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;            
}

Edited by Musika6988
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   6
  • Joined:  09/09/13
  • Last Seen:  

Nevermind, I got it figured out.

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...