mIRC Home    About    Download    Register    News    Help

Print Thread
#4768 03/01/03 07:11 PM
Joined: Dec 2002
Posts: 32
J
Jaakko Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Dec 2002
Posts: 32
Hello

im trying to make a while loop which would do all the possibilities from AAA -> 000 and the depth (like AAAA -> 0000) would be changeable

i have listed chars from A to 0 into differents lines into a TXT. It would be kinda like all the hackers use except for the different purpose o)

I've tried to make one but it doesn't work...

alias listallposibilities {
set %x 0
set %x1 0
set %x2 0
unset %kakka
:alotus
while (%x2 < $calc(%pituus +1)) {
while (%x1 < %pituus) {
while (%x < %pituus) { inc %x | echo -at $read(kirjaimet.txt,%x2) $+ $read(kirjaimet.txt,%x1) $+ $read(kirjaimet.txt,%x) | inc %kakka
if (%x == %pituus) { set %x 0 | inc %x1 | goto alotus } }
}
if (%x1 == %pituus) { set %x1 0 | inc %x2 | goto alotus } }
}


am a big noob
#4769 03/01/03 08:49 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/me LOLs @ %kakka grin

why is it in there anyway?

You want that script to do something like:

AAA
AAB
AAC
...
AA0
ABA
...
ZZ0
1AA
...
009
000

brute force h4x0r stuff, but not for that purpose?
You just want to echo all that to active window cool

Your code in readable form:
Code:
alias listallposibilities {
  set %x 0
  set %x1 0
  set %x2 0
  unset %kakka
  :alotus
  while (%x2 &lt; $calc(%pituus + 1)) {
    while (%x1 &lt; %pituus) {
      while (%x &lt; %pituus) { 
        inc %x 
        echo -at $read(kirjaimet.txt,%x2) $+ $read(kirjaimet.txt,%x1) $+ $read(kirjaimet.txt,%x) 
        inc %kakka
        if (%x == %pituus) { 
          set %x 0 
          inc %x1 
          goto alotus 
        } 
      }
    }
    if (%x1 == %pituus) { 
      set %x1 0 
      inc %x2 
      goto alotus 
    } 
  }
}


Pipes suck!
You have funny way of doing stuff smirk
File operations are extremely slow.

you suck smile

just forget that you ever wanted a script like that or wait a sec and I'll make you working one. :tongue:

Last edited by theRat; 03/01/03 08:50 PM.

Code:
//if ( khaled isgod ) echo yes | else echo no
#4770 03/01/03 09:03 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
On the other hand, make that sec a day, or two days.

40 diffrent characters, lenght of the word 2 characters, would make 1600 diffrent possibilities. Usually mircs window buffer is 500 lines? So you wouldn't see a third of all possibilities.


Code:
//if ( khaled isgod ) echo yes | else echo no
#4771 03/01/03 10:27 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Now I've made it, but I'd still like to get a very good explanation what the hell are you going to do with it?? Because I can't think of any else than illegal use. cool


Code:
//if ( khaled isgod ) echo yes | else echo no
#4772 04/01/03 11:16 AM
Joined: Dec 2002
Posts: 32
J
Jaakko Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Dec 2002
Posts: 32
ookay o)

Ill use it for practising alphabets

(Its a semi-hacker thingy i gotta get my bros LAN ftp servers password somehow o) On a lan with friends and gotta get his stuffs out.)

Other hand if you don't wanna give the thingy it's ok was a bit drunk i think o)

But what i really would like to see what are pipes and how do you do quick thingies...cos i always use while loops and stuff would be funny to know how it is done fast o)

%kakka is for the amount of possibilities listed...for debugging.

EDIT : the mirc window buffer doesn't matter either. Echo was just for debugging also...

Tack


am a big noob
#4773 04/01/03 01:24 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well if you want it done fast I wouldn't recommend using $read 3 times in each iteration. That's quite possibly the slowest method to access information.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#4774 04/01/03 03:02 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Code:
alias listallposibilities {
  var %list = ABCabc123 ;just add your own characters to this
  var %list.len = $len( %list )
  var %len = $1
  var %a = 1
  while ( %a &lt;= %len ) {
    set $+(%,t.,%a) 1
    inc %a
  }
  var %c = 1
  var %cc = $calc( %list.len ^ %len ) 
  while ( %c &lt;= %cc ) {
    var %b = 1
    var %outvar = $null
    while ( %b &lt;= %len ) {
      var %outvar = %outvar $+ $mid( %list , $eval( $+(%,t.,%b) , 2 ) , 1 )
      inc %b
    }
    echo -at %outvar ;Echoes the "words"
    inc $+(%,t.,%len)
    var %a = %len
    while ( %a &gt;= 2 ) {
      var %eval = $eval( $+(%,t.,%a) , 2 ) 
      if ( %eval &gt; %list.len ) {
        set $+(%,t.,%a) 1
        inc $+(%,t.,$calc(%a - 1)) 
      }
      dec %a
    }
    inc %c
  }
}



Usage:
/listallpossibilities <length of the result "words">


"Pipes" are the " | "-characters used to put multiple commands on one line, and the code written with those is hardly ever readable. wink

File operations are slow, extremely slow, this script would be pretty easily changed to use your file, but it would be slow as turtle going across the Sahara. grin


Code:
//if ( khaled isgod ) echo yes | else echo no

Link Copied to Clipboard