Namen gen

  • Hallo
    Hab wieder mal ne frag :D

    Und zwar ich habe einen Namens generator Geschrieben und der soll den namen aus einer namens list nehmen und dann eine zahl hinter setzen,

    mein Prob ich möchte das es den Namen dann in eine notepad datei rein schrieben aber irgendwie macht er das nicht vlt könnt ihr ja helfen


    Spoiler anzeigen
    [autoit]

    run ("notepad.exe")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Sleep (1000)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GenName()
    Global $nrnd = Random(1,8310,1)
    Global $pers = FileReadLine("name.txt", $nrnd)
    Global $len = StringLen($pers)
    Global $neglen = 13 - $len

    [/autoit] [autoit][/autoit] [autoit]

    If $neglen = 5 Then
    Global $rnd = Random(0,99999999,1)
    EndIf
    If $neglen = 6 Then
    Global $rnd = Random(0,9999999,1)
    EndIf
    If $neglen = 7 Then
    Global $rnd = Random(0,999999,1)
    EndIf
    If $neglen = 8 Then
    Global $rnd = Random(0,99999,1)
    EndIf
    If $neglen = 9 Then
    Global $rnd = Random(0,9999,1)
    EndIf
    If $neglen = 10 Then
    Global $rnd = Random(0,999,1)
    EndIf
    If $neglen = 11 Then
    Global $rnd = Random(0,99,1)
    EndIf
    If $neglen = 12 Then
    Global $rnd = Random(0,9,1)
    EndIf
    return $pers & $rnd
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Send ("", _GenName())

    [/autoit]

    Hoffe einer kann helfen

    Einmal editiert, zuletzt von DarkAngel125 (2. Juli 2010 um 19:56)

  • GenName wäre vielleicht unpassend, da es vorgegebene Namen sind ...

    [autoit]


    FileWrite()

    [/autoit]


    Sollte dir helfen.
    Ausserdem würde er dir einen Error melden, mach statt

    [autoit]

    Global $rnd =

    [/autoit]

    ein

    [autoit]

    Local $rnd = ?
    Return $rnd

    [/autoit]

    Es gibt sehr viele Leute, die glauben. Aber aus Aberglauben.
    - Blaise Pascal

  • Ah okay also jetzt schreib er was :D


    Aber leider nur die zahlen


    Weißt du vlt warum er keinen namen aus der liste holt?

  • [autoit]

    run ("notepad.exe")

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Sleep (1000)

    [/autoit][autoit][/autoit][autoit]

    $pub = _GenName()

    [/autoit][autoit][/autoit][autoit]

    Func _GenName()
    Global $nrnd = Random(1,8310,1)
    Global $pers = FileReadLine("name.txt", $nrnd)
    Global $len = StringLen($pers)
    Global $neglen = 13 - $len

    [/autoit][autoit][/autoit][autoit]

    If $neglen = 5 Then
    Local $rnd = Random(0,99999999,1)
    EndIf
    If $neglen = 6 Then
    Local $rnd = Random(0,9999999,1)
    EndIf
    If $neglen = 7 Then
    Local $rnd = Random(0,999999,1)
    EndIf
    If $neglen = 8 Then
    Local $rnd = Random(0,99999,1)
    EndIf
    If $neglen = 9 Then
    Local $rnd = Random(0,9999,1)
    EndIf
    If $neglen = 10 Then
    Local $rnd = Random(0,999,1)
    EndIf
    If $neglen = 11 Then
    Local $rnd = Random(0,99,1)
    EndIf
    If $neglen = 12 Then
    Local $rnd = Random(0,9,1)
    EndIf
    Return $rnd
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Sleep (500)

    [/autoit][autoit][/autoit][autoit]

    send("" & $pub)

    [/autoit]


    So hab ich es jetzt geschrieben.
    Werden aber nur zahlen geschrieben und es wird kein name aus der liste geholt.

  • [autoit]

    run ("notepad.exe")
    WinWait("[CLASS:Notepad]")
    WinActivate("[CLASS:Notepad]")
    WinWaitActive("[CLASS:Notepad]")

    [/autoit][autoit][/autoit][autoit]

    Send (_GenName())

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Func _GenName()
    Local $pers = FileReadLine("name.txt", Random(1,8310,1))
    Local $len = StringLen($pers)
    Return $pers & StringFormat("%00" & 13 - $len & "i", Random(0, 10^(13 - $len) - 1, 1))
    EndFunc

    [/autoit]
  • Sieht mir irgendwie nach nem MyBrute-Bot aus, den ich mal gesehen habe...