on *:text:!del*:?: {
closemsg $nick
If (!$readini(registered.txt, n, Password, $nick)) { msg $nick You are not registered! Please type !register password | halt }
If (!$readini(registered.txt, n, Login, $nick)) { msg $nick You have not logged into your account! Please type !login password | halt }
ElseIf (!$2-) { msg $nick You need to put the name of the card you want to delete from your deck! | halt }
ElseIf (%player1 == $nick) { msg $nick You cannot delete cards from your deck while you are dueling! | halt }
ElseIf (%player2 == $nick) { msg $nick You cannot delete cards from your deck while you are dueling! | halt }
ElseIf ($2 == all) {
msg $nick You have now deleted your Whole Deck!
remove decks\ $+ $nick $+ .txt
remove decks\ $+ $nick $+ .Fusion.txt
remove decks\ $+ $nick $+ .Sidedeck.txt
}
Elseif ($2 == deck) {
msg $nick You have now deleted your Normal Deck!
remove decks\ $+ $nick $+ .txt
}
Elseif ($2 == fusion) {
msg $nick You have now deleted your Fusion Deck!
remove decks\ $+ $nick $+ .Fusion.txt
}
Elseif ($2 == sidedeck) {
msg $nick You have now deleted your Side Deck!
remove ecks\ $+ $nick $+ .Sidedeck.txt
}
Else { carddelete }
}
Alias carddelete {
Set %Counts 0
:Start
Inc %Counts
if (!$Read(decks\ $+ $nick $+ .txt, %Counts)) && (!$Read(decks\ $+ $nick $+ .Fusion.txt, %Counts)) && (!$Read(decks\ $+ $nick $+ .Sidedeck.txt, %Counts)) { Goto Finish }
Elseif ($Read(decks\ $+ $nick $+ .txt, %Counts) == $2-) { write -dl $+ %Counts decks\ $+ $nick $+ .txt | unset %Counts | halt }
Elseif ($Read(decks\ $+ $nick $+ .Fusion.txt, %Counts) == $2-) { write -dl $+ %Counts decks\ $+ $nick $+ .Fusion.txt | unset %Counts | halt }
Elseif ($Read(decks\ $+ $nick $+ .Sidedeck.txt, %Counts) == $2-) { write -dl $+ %Counts decks\ $+ $nick $+ .Sidedeck.txt | unset %Counts | halt }
Goto Start
:Finish
msg $nick You do not have this card in your deck! Please check spelling!
unset %Counts
halt
}