on *:TEXT:*:#:{ if ($1 == !start) && ($nick == Mew) { /start $1- | return }
if (%kaos.bot == yes) { search $strip($1-,c) }
}
alias search { var %x = 1
while (%x <= $lines(answers.txt)) { if ($1- isin $read(answers.txt,%x)) { notice $nick $talker(Too late, Someone else got that answer!) | return }
inc %x
}
search2 $strip($1-,c)
}
alias search2 { var %x = 1
while (%x <= $lines(%question)) { if ($1- isin $read(%question,%x)) { notice $nick $talker(Point Added!) | write answers.txt $1- | set %search.1 $read(correct.txt,s,$nick) | if (%search.1 == $null) { write correct.txt $nick 1 } | if (%search.1 != $null) { write -l $+ $readn correct.txt $nick $calc(%search.1 + 1) } | set %search.2 $read(rank.txt,s,$nick) | if (%search.2 == $null) { write rank.txt $nick 1 } | if (%search.2 != $null) { write -l $+ $readn rank.txt $nick $calc(%search.2 + 1) } | newrank }
inc %x
}
}
The code works. It's just that
Say "Bully" is one of the answers.
If someone types "Bul" it'll be right cause bul [[[IS]]] in bully...
Anyone know how to avoid this problem?
Maybe reading it backwards (From what I have it)
So instead of checking if $1- isin $read(%question,%x) I should if $read(%question,%x) isin $1-
That might work, but still has the problem of:
if someone typed:
BULLYYYYYYYYY it would count it.
~Anyone know any other way?