Jump to content
  • 0

Character Deletion Script (workaround)


Yuka

Question


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

Hi,

since my client is bugging with the character deletion, I've just written a script to do it.

Could you please check if it is not exploitable/ doing something wrong?

It seems to work fine for me though, but would be glad to have someone checking it before releasing it.

lhz_in03,255,257,3    script    Chardel    93,{
    set .@accid, getcharid(3);
    mes .npcname$;
    mes "Hello ^6495ED"+strcharinfo(0)+"^000000.";
    mes "Would you like to delete a character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Please enter the Character's name.";
    mes "Note that you can only delete characters on your own account.";
    input(.@charname$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"+.@charname$+"'",.@accid2;
    if (.@accid != .@accid2){
        next;
        mes .npcname$;
        mes "^ff0000I could not find this character on your account!^000000";
        close;
    }
    if (strcharinfo(0) == .@charname$){
        next;
        mes .npcname$;
        mes "^ff0000Please log in with a different character to delete this one.^000000";
        close;
    }
    next;
    mes .npcname$;
    mes "Do you really want to delete this character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Okay, I have deleted this character from your account.";
    query_sql "DELETE FROM `char` WHERE `name`='"+.@charname$+"'";
    close;
    end;
    OnInit:
        set .npcname$, "[^6495EDCharacter Deletion^000000]";
        end;
}

Thanks! :)

Edited by Yuka
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Hello, i recommend you the Peopleperson49's Character Deletion script ;D!

http://rathena.org/board/topic/93776-utility-delete-character-command/

 

You are missing some tables that you also have to clear too D:!

  • Upvote 1
Link to comment
Share on other sites


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

if you want ..... then i can add some more ...

  1. data in other SQL tables that related to that character
  2. Items within the characters that you're going to delete
  3. Guild that current characters joined
  4. etc
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

 

Could you please check if it is not exploitable/ doing something wrong?

    input(.@charname$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"+.@charname$+"'",.@accid2;

just to point this line.. don't forget to use escape_sql to prevent sql injection

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