Jump to content

Cont Do


Glyph
 Share

Recommended Posts

Like this...

$count = a

Do
          MsgBox(0, "AutoIt Example", "Count is: " & $count)

        $count = $count + 1 letter  

Until $count > zzz
        
MsgBox(0, "Done", "Finished!")

Is there anyway to have it go through a-z, aa-zz, aaa-zzz etc.?

tolle indicium

Link to comment
Share on other sites

Hi,

for what? You can try with ASC()

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

$count = 97

Do
          MsgBox(0, "AutoIt Example", "Count is: " & $count &@CRLF& "letter is: " & Chr($count))

        $count = $count + 1

Until $count > 122
        
MsgBox(0, "Done", "Finished!")

not tested

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

HI,

I guess brutfoeceing can be done better or also with permutation. code by Smoke_N

$permutarray = permute("abcdef")
$msg = ""
For $n = 1 To $permutarray[0]
    $msg = $msg & $permutarray[$n] & @CRLF
Next
ConsoleWrite($msg)

Func rotate($sString, $nRotateLevel)
    Local $aStringArray = StringSplit($sString,"")
    Local $nStartRotate = $aStringArray[0] - $nRotateLevel + 1
    Local $n, $tempchar, $tempstr = "", $retval = ""
    For $n = 1 To $nStartRotate - 1
        $tempstr= $tempstr & $aStringArray[$n]
    Next
    $tempchar = $aStringArray[$nStartRotate]
    For $n = $nStartRotate+1 To $aStringArray[0]
        $retval = $retval & $aStringArray[$n]
    Next
    $retval = $tempstr & $retval & $tempchar
    Return $retval
EndFunc   ;==>rotate

Func permute_internal($sString, $nRotateLevel, ByRef $permutations)
    Local $n, $str
    Dim $arr[$nRotateLevel]
    If $nRotateLevel = 2 Then
        $permutations = $permutations & ":" & rotate($sString,$nRotateLevel)
        Return
    EndIf
    $str = $sString
    For $n = 0 To $nRotateLevel -1
        $str = rotate($str,$nRotateLevel)
        $arr[$n] = $str
        ;--- special check, to stop a level beeing printed twice ---
        If not (($n = 0) AND (StringLen($sString) > $nRotateLevel)) Then
            $permutations = $permutations & ":" & $arr[$n]
        EndIf
        permute_internal($arr[$n],$nRotateLevel-1,$permutations)
    Next
EndFunc   ;==>permute_internal

Func permute($sString)
    Global $permutations = ""
    permute_internal($sString,StringLen($sString),$permutations)
    $permutations = StringTrimLeft($permutations,1)
    Return StringSplit($permutations,":")
EndFunc   ;==>permute

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...