Jump to content
  • 0

Accounts that are no longer used


Scofield

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

I would like a system or script that deletes accounts and pensonagens who spend more than three months without accessing the account

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  

try this..

http://pastebin.com/raw.php?i=UEUbarEq

 

it will check the database everyday..and remove all account that not login for 90 days or longer...

 

please do a backup before use this..just in case anything happened.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

Thank you based on your able to create this, still not tested testo soon and post here.

 

- script RemoveAccs -1,{
OnWhisperGlobal:
if(getgmlevel() < 99) end;
query_sql "SELECT account_id,DATE(lastlogin) FROM login WHERE account_id >= '2000000' AND level < '99'",.@acc_id,.@data$;
for(set .@i,0; .@i < getarraysize(.@acc_id); set .@i,.@i+1){
deletearray .@dias;
query_sql "SELECT DATEDIFF(DATE(NOW()),'"+.@data$[.@i]+"')",.@dias;
if(.@dias > 60){
deletearray .@char_id;
query_sql "SELECT char_id FROM `char` WHERE account_id = '"+.@acc_id[.@i]+"'",.@char_id;
for(set .@w,0; .@w < getarraysize(.@char_id); set .@w,.@w+1){
query_sql "DELETE FROM inventory,friends,hotkey,pet,sc_data,skill,cart_inventory,global_reg_value,guild_member WHERE char_id = '"+.@char_id[.@w]+"'";
}
query_sql "DELETE FROM storage WHERE account_id = '"+.@acc_id[.@i]+"'";
}
}
end;
}
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...