First of all, I'm a first timer here but I know quite a bit in scripting. I'm making a Trading Card Game (TCG) and this scripts don't work. It's supposed to add cards to the persons deck.
------
on *:text:!add*:?: {
closemsg $nick
If (!$readini(registered.txt, n, Password, $nick)) { msg $nick You are not registered! Please type !register password | halt }
Elseif (!$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 add the name of the card you want to add to your deck! | halt }
ElseIf (%player1 == $nick) { msg $nick You cannot add cards to your deck while you are dueling! | halt }
ElseIf (%player2 == $nick) { msg $nick You cannot add cards to your deck while you are dueling! | halt }
Elseif ($read(limited.txt, s, $2-)) && ($read(decks\ $+ $nick $+ .txt, s, $2-)) { msg $nick You already have 1 of this card in your deck! It is restricted to 1! | halt }
Elseif ($read(semilimited.txt, s, $2-)) && ($read(decks\ $+ $nick $+ .txt, s, $2-)) { semilimited }
(continues on, rest works)
------
Alias semilimited {
set %Counts 0
set %semilimited 0
:Start
Inc %Counts
If (!$Read(decks\ $+ $nick $+ .txt)) {
unset %semilimited
unset %Counts
halt
}
ElseIf (%semilimited == 2) {
msg $nick You already have 2 of this card in your deck! It is restricted to 2!
unset %semilimited
unset %Counts
halt
}
ElseIf ($Read(decks\ $+ $nick $+ .txt, %Counts != $2-)) { Goto Start }
ElseIf ($Read(decks\ $+ $nick $+ .txt, %Counts == $2-)) {
inc %semilimited
Goto Start
}
Else {
write decks\ $+ $nick $+ .txt $2-
msg $nick You have now added $2- to your deck!
unset %semilimited
unset %Counts
halt
}
}
------
The bolded text above are the ones that don't work. I have limited.txt and semilimited.txt in my main mIRC directory. I don't know what's wrong with it. It seems that its skipping that part of the script or something, because it doesn't halt the script when it finds that they match. Sorry for the long message :P