mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I can't figure out how to ...

what i wanna do is in a topic there will be alphanumeric like this


#digichat Topic:> Current game in session on server da43 password is AB913AB931FFAE910394190 UserName is digichat2005 let the good times roll #digichat End Topic!

see now I wanna know if theres a way to grab just the password out of topic and put it on file ready where they can click...

Copy in the dialog and it will copy just the key and not the whole topic the reason i cant use $1 or $2 etc... is due to im not the controller of the topic all the time and the placement of the password is always different HOWEVER here is the catch I need a script to detect

where the alphanumeric password is and the password has to be more then 12 ALPHANUMERIC characters else it dont copy, the problem

AGAIN im having is it captures the "Digichat2005" at the same time!! frown our password can be always like 12 characters up to 20

I was thinking of adding something like PASS:039024982429014 where I can then locate where PASS is and give me the following, HOWEVER again im not the controller of the topic all the time

my password always has a good mixtures of letters and numbers so im not sure if can some something like a IF cmd if password has more then X amount of numbers then... or X amount of letters then.

im totally stumped

im sure theres some good guru's that can appointment in the right direction


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Not sure how you'd pass the info to the dialog, without seeing the dialog, but the information, presuming that the topic format will stay the same, is to use something like
Code:
 set %pass $gettok($chan($chan).topic,$calc($findtok($chan($chan).topic,password,1,32) + 2),32)
 

That will search the channel topic for the word "password", then return the item that is 2 "words" (for lack of a better term) further on.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You can also use a regex like:

alias password return $regml($regex($chan(#digichat).topic,/password is (?-i)([A-Z\d]+) /Si))

//echo -a $password

It will only return something if the password was in upper case alphanumeric form.


Gone.
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I know about that $gettok command but the word password wouldnt be in topic thats what i meant, the regml might be usefull but again password is not included however FiberOptics is correct in saying my password is ALL uppercase so i think i need a sceript that detects the value of a alphanumeric thats all uppercased opposed to a combination of lowercase and uppercase and save it has a global var


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
/help isalnum
/help isupper


Gone.
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I starred countless hours over that;;

would work only if I could detect the password in the script though well what i mean is the location example

$1-32

if (??? $isupper) { did -ra $dname 293 $7 }

thats the part i dont get how to detect the password lcoation in topic when it can be any location... frown


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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)) { }


Gone.
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Sorry ive been learning ASM recently all my mIRC scripting went all rusty on me


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard