TCG Script. For this script, it is supposed to delete the card from their deck (decks\ $+ $nick $+ .txt. When they type !del <card> nothing happens. Everything from "Else { carddelete }" to the end of the loop doesn't work. Even if the $2- is in the .txt file, it doesn't delete it. It might have been an bad idea to use loop, im not sure. The reason why I used -dl and not write -ds $+ $2- decks\ $+ $nick $+ .txt is because the -ds only supports searching 1 word. Since $2- is more than 1, it won't work. Help me plz, ill appreciate it.
Code:
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)) &amp;&amp; (!$Read(decks\ $+ $nick $+ .Fusion.txt, %Counts)) &amp;&amp; (!$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
}
 

Last edited by Relinsquish; 29/03/04 10:29 PM.