This is really a no-brainer, I don't understand why you can't figure it out.
Let's see...
* You have a string $chan(#digichat).topic, and you want to find an occurance of an alphanumeric/uppercase word, that has a length between 12-20 characters.
* You know while loops, $gettok, $len, isalnum, isupper, and variables.
* How do you solve your issue? You loop through the string, checking each word for the laid out criteria, and in case of a match, you return your result.
* Ask yourself, can I think of more criteria to make pattern matching more successful, minimizing the amount of false positives?
- - Will there be certain key-words before/after the password?
- Can the password be anywhere in the string, or are there always x words in front of it, and y words behind it?
- Is there some sort of recurring pattern that can help me find the location of this password in the
string?
- Do the passwords have a minimum/maximum length? You mentioned from 12-20, so check for that with $len.
- Must there be a minimum of digits/letters in the password?
If you find that there simply aren't good enough criteria to match, then this is a lost cause. You can either abandon the script, or ask the people who set the topic to create a recognizable pattern so that you can always find the password. They could solve this easily by prefixing the password with something like "PASS:<thepasswordhere>".
I'm not going to give you the code (a simple regex could take care of it), as I think you're better off trying to solve this yourself. I've practically given you all the info you need to make this work, it's up to
you to put it together. If you can't figure it out, then maybe mIRC scripting isn't really your thing.
Btw, you are confusing the identifier $isupper with the operator isupper. It's either:
//if (A isupper) { }
or
//if ($isupper(A)) { }