1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Fresapore

Beiträge von Fresapore

  • Richtige Anordnung

    • Fresapore
    • 4. März 2011 um 19:15

    Hm, dann sollte das ungefähr so aussehen:

    Spoiler anzeigen
    [autoit]

    Case $button3
    $args = ""
    If guictrlread($checkbox1) = $GUI_checked then
    $args &= " Befehl1"
    Endif
    If guictrlread($checkbox2) = $GUI_checked then
    $args &= " Befehl2"
    Endif
    $args &= " +i_mouse_accel 0"
    FileCreateShortcut($explorerpfad, @DesktopDir & "\Crysis2Demo-MOD.lnk", $ausfuehren, $args)

    [/autoit]

    Wenn ich das richtig verstanden habe, aber ich habe den Befehl filecreateshortcut noch nie benutzt, und habe keine Liste der Args gefunden...

    MfG,
    Frespaore

  • Richtige Anordnung

    • Fresapore
    • 4. März 2011 um 16:00

    Ich weiß jetzt ehrlich gesagt nicht, womit du eine solche Verknüpfung erstellst, in welcher steht, dass z.B. das Intro übersprungen werden soll ?
    Oder hab ich was verpasst ?(

  • Richtige Anordnung

    • Fresapore
    • 4. März 2011 um 10:50

    Du erstellst einen Case in der Switch für $Button1

    [autoit]

    Case $button1
    $filpath = FileOpenDialog("Bitte *.exe auswählen", @scriptdir, "exe (*.exe)")

    [/autoit]


    dann prüft du dann mit

    [autoit]

    if guictrlread($checkbox1) = $GUI_CHECKED then
    ...
    endif

    [/autoit]


    die einzelnen Checkboxen ab..


    MfG,
    Fresapore

  • Smartphone -Synapse one?

    • Fresapore
    • 1. März 2011 um 21:20

    Joa, hm das gefällt mir nicht so gut, des ist teuer und den Bildschirm finde ich nicht so gut wie den des Desires.
    Da der Preis gerade auf ~350€ bei Amazon gefallen ist, sollte das meine Entscheidung sein :D

    Danke euch!

    /Closed

    MfG,
    Fresapore

  • Menünamen ändern durch klicken auf ein MenuItem

    • Fresapore
    • 1. März 2011 um 20:34

    Wenn ich dich richtig verstanden hab, dann war das schon ganz knapp ;)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <GuiMenu.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Main", 633, 454, 192, 114)
    $MenuItem1 = GUICtrlCreateMenu("Datei")
    $MenuItem2 = GUICtrlCreateMenu("-speichern unter-")
    $MenuItem4 = GUICtrlCreateMenuItem("Geschäfte", $MenuItem2)
    $MenuItem5 = GUICtrlCreateMenuItem("Häuser", $MenuItem2)
    $MenuItem6 = GUICtrlCreateMenuItem("User", $MenuItem2)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ende()
    Case $msg = $MenuItem4
    GUICtrlSetData($menuitem2, "Geschäftsdaten")
    Case $msg = $MenuItem5
    GUICtrlSetData($MenuItem2, 'Häuserdaten')
    Case $msg = $MenuItem6
    GUICtrlSetData($MenuItem2, 'Userdaten')
    EndSelect
    WEnd

    Func ende()
    Exit
    EndFunc

    [/autoit]


    MfG,
    Fresapore

  • Smartphone -Synapse one?

    • Fresapore
    • 28. Februar 2011 um 21:56

    Deswegen warte ich ja noch die ceBIT ab, die gaubb ich heute gestartet hat..
    Aber das Desire HD kommt ja leider sowieso nicht infrage..

  • Smartphone -Synapse one?

    • Fresapore
    • 28. Februar 2011 um 20:44

    Erst mal danke für die Auskunft!
    Das HTC desire HD übersteigt leider deutlich mein Budget, sonst wäre es meine erste Wahl ;)
    Aber das HTC Hero ist doch von der HW schlechter als das Desire, und das kostet weniger, wenn ich mich nicht irre... ?(

  • Smartphone -Synapse one?

    • Fresapore
    • 28. Februar 2011 um 18:14

    Hi @all,
    ich habe nich in letzter Zeit ein bisschen nach Handys (Smartphones) umgeschaut,
    weil ich mir demnächst (nach der ceBIT) ein neues kaufen wollte.
    meine Obergrenze liegt bei ca. 340€, gedacht hatte ich an HTC desire o.ä.
    Vor kurzem bin ich auf das sogenannte "Synapse one" gestoßen Link
    Dies ist ein Smartphone, welches man selbst konfigurieren kann. Allerdings wird die Existens dieses Produktes angezweifelt, da es eigentlich Q1/11 erscheinen sollte, aber man seit September '10 nichts mehr von ihnen gehört hat.
    Hat einer von euch schonmal davon gehört? Oder gibt es ein anderes empfohlendes Gerät (mit Androit) :?:

    Danke im Vorraus

    MfG,
    Fresapore

  • CSV bearbeit

    • Fresapore
    • 28. Februar 2011 um 18:08

    Natürlich geht das.
    Dazu nimmst diu einfach Index 1.
    misterspeed hat ja mit zeile 2 angefangen, und ab dort alle Zeilen bearbeitet.
    Wenn du vor

    [autoit]

    _FileWriteFromArray("pfadzurdatei", $meinedatei , 1 )

    [/autoit]


    noch

    [autoit]

    $meinedatei[1] = "Neuer Kopf"

    [/autoit]


    schreibst, wird dieser auch entsprechend geändert..

    MfG,
    Fresapore

  • Stundenplan mit Extras

    • Fresapore
    • 27. Februar 2011 um 18:57

    Sieht schön übersichtlich aus. :)

    Du kannst das Scipt mit der Verwendung von Arrays noch stark verkürzen , wenn sie dir vertraut sind ;)

    MfG,
    Fresapore

  • Xonix - Ein kleines Spielchen

    • Fresapore
    • 25. Februar 2011 um 17:33

    monkey
    Danke

    Jetzt auch die "Control"-Variante zum Vergleich, siehe Post #1 :)

  • Xonix - Ein kleines Spielchen

    • Fresapore
    • 25. Februar 2011 um 17:02

    Hi Forum
    RapIt, ein Freund und ich haben zusammen das Minispiel Xonix entwickelt.
    Vielleicht kennen ein paar von euch das Spiel von alten Nokia-Handys :D

    Naja, eigentlich wollten wir das Spiel komplett mit Standard GUI controls machen (wird demnächst veröffentlicht), ich habe das auch mal mit meinen geringen GDI+ Kenntnissen aus der Tutorial
    umgeschrieben, um einen direkten (Performance-)Vergleich zu haben.

    Im Spiel geht es darum, mit den Pfeiltasten den Bereich für den Ball einzugrenzen. Erst wenn man den Rand erreicht hat, wird er gefüllt. Der Ball darf die rote Linie nicht berühren, sonst verliert man eins von drei Leben.
    Ein Level hat man geschafft, wenn mehr als 70% des Spielfelds ausgefüllt sind.
    Viel Spaß!


    Bekannte Bugs:

    Spoiler anzeigen

    -Wenn es mehr als einen Bereich mit Bällen gibt, wird dieser manchmal nicht korrekt gefüllt.
    -Bei neuem Level stürzt es manchmal ab

    Code:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    #include <gdiplus.au3>
    HotKeySet("{LEFT}", "_left")
    HotKeySet("{UP}", "_up")
    HotKeySet("{RIGHT}", "_right")
    HotKeySet("{DOWN}", "_down")

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

    Global $game_scale = 40
    Global $ballpos[2][8]
    Global $direction[8]
    Global $array[$game_scale][$game_scale]
    Global $background_control[$game_scale][$game_scale]
    Global $level = 1

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

    Global $player_direction = -1
    Global $player_pos[2] = [0, 0]
    Global $grenze = 0.7
    Global $lives = 3
    Global $rpcounter = 0
    Global $newdirdirection[4][8][4] = [[[0, 1, 2, 2], [0, 1, 2, 1], [0, 1, 2, 2], [0, 1, 2, 0], [0, 1, 2, 3], [0, 1, 2, 2], [0, 1, 2, 0], [0, 1, 2, 0]], [[2, 3, 4, 3], [2, 3, 4, 2], [2, 3, 4, 3], [2, 3, 4, 1], [2, 3, 4, 0], [2, 3, 4, 3], [2, 3, 4, 1], [2, 3, 4, 1]], [[4, 5, 6, 0], [4, 5, 6, 3], [4, 5, 6, 0], [4, 5, 6, 2], [4, 5, 6, 1], [4, 5, 6, 0], [4, 5, 6, 2], [4, 5, 6, 2]], [[6, 7, 0, 1], [6, 7, 0, 0], [6, 7, 0, 1], [6, 7, 0, 3], [6, 7, 0, 2], [6, 7, 0, 1], [6, 7, 0, 3], [6, 7, 0, 3]]]
    Global $pen[3]
    _GDIPlus_Startup()

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

    $MainGui = GUICreate("Xonix -by Alex & RapIt & Fresapore", $game_scale*10+1, $game_scale*10+30, 192, 124)
    $percentlabel = guictrlcreatelabel("Prozent: 0", 0, $game_scale*10, $game_scale*10/3, 30)
    guictrlsetfont(-1, 20)
    $lifelabel = guictrlcreatelabel("Leben: 3", $game_scale*10/3*2, $game_scale*10, $game_scale*10/3, 30)
    guictrlsetfont(-1, 20)
    $levellabel = guictrlcreatelabel("Level: ", $game_scale*10/3, $game_scale*10, $game_scale*10/3, 30)
    guictrlsetfont(-1, 20)
    GUISetState(@SW_SHOW)
    $graphic = _GDIPlus_GraphicsCreateFromHWND($MainGui)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($game_scale*10, $game_scale*10, $graphic)
    $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    $pen[1] = _GDIPlus_BrushCreateSolid(0xFF000000)
    $pen[0] = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    $pen[2] = _GDIPlus_BrushCreateSolid(0xFFFF0000)
    For $x = 0 To ($game_scale-1)
    For $y = 0 To ($game_scale-1)
    $array[$x][$y] = 0
    Next
    Next

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

    For $x = 0 To ($game_scale-1)
    $array[0][$x] = 1
    $array[($game_scale-1)][$x] = 1
    $array[$x][0] = 1
    $array[$x][($game_scale-1)] = 1
    Next

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

    ;------------Main----------------

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

    _newlevel()
    AdlibRegister("_ballmove", 100)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_GraphicsDispose($graphic);Grafik Objekt freigeben
    _GDIPlus_GraphicsDispose($buffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_Shutdown();Ressourcen freigeben
    Exit
    EndSwitch
    Sleep(10)
    WEnd

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

    ;---------------------------------

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

    Func _left()
    If $player_direction <> 2 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 0
    EndFunc ;==>_left

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

    Func _up()
    If $player_direction <> 3 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 1
    EndFunc ;==>_up

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

    Func _right()
    If $player_direction <> 0 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 2
    EndFunc ;==>_right

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

    Func _down()
    If $player_direction <> 1 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 3
    EndFunc ;==>_down

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

    Func _newlevel()
    guictrlsetdata($percentlabel, "Prozent: 0")
    For $x = 1 to ($game_scale-2)
    For $y = 1 to ($game_scale-2)
    $array[$x][$y] = 0
    Next
    Next
    GUICtrlSetData($levellabel, "Level: "&$level)
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    For $i = 0 To $level - 1
    $direction[$i] = Random(0, 3, 1)
    $ballpos[0][$i] = Random(2, $game_scale-3, 1)
    $ballpos[1][$i] = Random(2, $game_scale-3, 1)
    Next
    $level += 1
    EndFunc ;==>_newlevel

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

    Func _ballmove()
    Local $newdir
    Local $collision[7]
    Local $number_red = 0
    Switch $player_direction
    Case 0
    If $player_pos[0] > 0 Then
    If $array[$player_pos[0] - 1][$player_pos[1]] = 0 Then
    $array[$player_pos[0] - 1][$player_pos[1]] = 2
    ElseIf $array[$player_pos[0] - 1][$player_pos[1]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to $game_scale-2
    For $y = 1 to $game_scale-2
    If $array[$x][$y] = 2 then $array[$x][$y] = 0
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[0] > 0 Then $player_pos[0] -= 1
    Else
    $player_direction = -1
    EndIf
    Case 1
    If $player_pos[1] > 0 Then
    If $array[$player_pos[0]][$player_pos[1] - 1] = 0 Then
    $array[$player_pos[0]][$player_pos[1] - 1] = 2
    ElseIf $array[$player_pos[0]][$player_pos[1] - 1] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to $game_scale-2
    For $y = 1 to $game_scale-2
    If $array[$x][$y] = 2 then $array[$x][$y] = 0
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[1] > 0 Then $player_pos[1] -= 1
    Else
    $player_direction = -1
    EndIf
    Case 2
    If $player_pos[0] < ($game_scale-1) Then
    If $array[$player_pos[0] + 1][$player_pos[1]] = 0 Then
    $array[$player_pos[0] + 1][$player_pos[1]] = 2
    ElseIf $array[$player_pos[0] + 1][$player_pos[1]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to $game_scale-2
    For $y = 1 to $game_scale-2
    If $array[$x][$y] = 2 then $array[$x][$y] = 0
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[0] < $game_scale Then $player_pos[0] += 1
    Else
    $player_direction = -1
    EndIf
    Case 3
    If $player_pos[1] < ($game_scale-1) Then
    If $array[$player_pos[0]][$player_pos[1] + 1] = 0 Then
    $array[$player_pos[0]][$player_pos[1] + 1] = 2
    ElseIf $array[$player_pos[0]][$player_pos[1] + 1] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to $game_scale-2
    For $y = 1 to $game_scale-2
    If $array[$x][$y] = 2 then $array[$x][$y] = 0
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[1] < $game_scale Then $player_pos[1] += 1
    Else
    $player_direction = -1
    EndIf
    EndSwitch
    For $i = 0 To $level - 2
    $collision = _Check($i)
    If $collision[$newdirdirection[$direction[$i]][0][0]] = 1 And $collision[$newdirdirection[$direction[$i]][0][1]] = 1 And $collision[$newdirdirection[$direction[$i]][0][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][0][3]
    If $collision[$newdirdirection[$direction[$i]][1][0]] = 1 And $collision[$newdirdirection[$direction[$i]][1][1]] = 1 And $collision[$newdirdirection[$direction[$i]][1][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][1][3]
    If $collision[$newdirdirection[$direction[$i]][2][0]] = 1 And $collision[$newdirdirection[$direction[$i]][2][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][2][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][2][3]
    If $collision[$newdirdirection[$direction[$i]][3][0]] = 1 And $collision[$newdirdirection[$direction[$i]][3][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][3][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][3][3]
    If $collision[$newdirdirection[$direction[$i]][4][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][4][1]] = 1 And $collision[$newdirdirection[$direction[$i]][4][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][4][3]
    If $collision[$newdirdirection[$direction[$i]][5][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][5][1]] = 1 And $collision[$newdirdirection[$direction[$i]][5][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][5][3]
    If $collision[$newdirdirection[$direction[$i]][6][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][6][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][6][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][6][3]
    If $collision[$newdirdirection[$direction[$i]][7][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][7][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][7][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][7][3]
    $direction[$i] = $newdir
    Switch $direction[$i]
    Case 0
    $ballpos[0][$i] -= 1
    $ballpos[1][$i] -= 1
    Case 1
    $ballpos[0][$i] += 1
    $ballpos[1][$i] -= 1
    Case 2
    $ballpos[0][$i] += 1
    $ballpos[1][$i] += 1
    Case 3
    $ballpos[0][$i] -= 1
    $ballpos[1][$i] += 1
    EndSwitch

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

    If $array[$ballpos[0][$i]][$ballpos[1][$i]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to $game_scale-2
    For $y = 1 to $game_scale-2
    If $array[$x][$y] = 2 then $array[$x][$y] = 0
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    EndIf
    Next
    For $x = 0 to ($game_scale-1)
    For $y = 0 to ($game_scale-1)
    _GDIPlus_GraphicsfillRect($buffer, $x*10, $y*10, 10, 10, $pen[$array[$x][$y]])
    Next
    Next
    _GDIPlus_GraphicsfillRect($buffer, $player_pos[0]*10, $player_pos[1]*10, 10, 10, $pen[2])
    For $i = 0 to $level -2
    _GDIPlus_GraphicsfillRect($buffer, $ballpos[0][$i]*10, $ballpos[1][$i]*10, 10, 10, $pen[1])
    Next
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    _GDIPlus_GraphicsClear($buffer)
    EndFunc ;==>_ballmove

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

    Func _check($num)
    Local $allcol[8]
    $allcol[0] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num]]
    $allcol[1] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num] - 1]
    $allcol[2] = $array[$ballpos[0][$num]][$ballpos[1][$num] - 1]
    $allcol[3] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num] - 1]
    $allcol[4] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num]]
    $allcol[5] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num] + 1]
    $allcol[6] = $array[$ballpos[0][$num]][$ballpos[1][$num] + 1]
    $allcol[7] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num] + 1]
    Return $allcol
    EndFunc ;==>_check

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

    Func _fill($start, $end)
    Local $redpoints, $fnumber = 0
    $redpoints = _getRedPoints()
    For $i = 0 To $rpcounter - 1
    If $array[$redpoints[$i][0] + 1][$redpoints[$i][1]] = 0 Then
    _a($redpoints[$i][0] + 1, $redpoints[$i][1], $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0] - 1][$redpoints[$i][1]] = 0 Then
    _a($redpoints[$i][0] - 1, $redpoints[$i][1], $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0]][$redpoints[$i][1] + 1] = 0 Then
    _a($redpoints[$i][0], $redpoints[$i][1] + 1, $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0]][$redpoints[$i][1] - 1] = 0 Then
    _a($redpoints[$i][0], $redpoints[$i][1] - 1, $fnumber)
    $fnumber = 1
    EndIf
    Next
    _compare()
    $rpcounter = 0
    For $x = 1 To ($game_scale-2)
    For $y = 1 To ($game_scale-2)
    If $array[$x][$y] = 2 Then
    $array[$x][$y] = 1
    EndIf
    Next
    Next
    _issolved()
    EndFunc ;==>_fill

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

    Func _getRedPoints()
    Local $redpoints[($game_scale-2)*100+20][2]
    For $i = 1 To ($game_scale-2)
    For $j = 1 To ($game_scale-2)
    If $array[$i][$j] = 2 Then
    $redpoints[$rpcounter][0] = $i
    $redpoints[$rpcounter][1] = $j
    $rpcounter = $rpcounter + 1
    EndIf
    Next
    Next
    Return $redpoints
    EndFunc ;==>_getRedPoints

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

    Func _a($xpos, $ypos, $fnumber)
    If $array[$xpos + 1][$ypos] = 0 Then
    $array[$xpos + 1][$ypos] = 3 + $fnumber
    _a($xpos + 1, $ypos, $fnumber)
    EndIf
    If $array[$xpos - 1][$ypos] = 0 Then
    $array[$xpos - 1][$ypos] = 3 + $fnumber
    _a($xpos - 1, $ypos, $fnumber)
    EndIf
    If $array[$xpos][$ypos + 1] = 0 Then
    $array[$xpos][$ypos + 1] = 3 + $fnumber
    _a($xpos, $ypos + 1, $fnumber)
    EndIf
    If $array[$xpos][$ypos - 1] = 0 Then
    $array[$xpos][$ypos - 1] = 3 + $fnumber
    _a($xpos, $ypos - 1, $fnumber)
    EndIf

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

    EndFunc ;==>_a

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

    Func _compare()
    Local $amount = 0
    For $i = 0 to $level-1
    If $array[$ballpos[0][$i]][$ballpos[1][$i]] = 3 Then $amount += 1
    Next
    If $amount = $level -1 Then
    For $i = 1 To ($game_scale-2)
    For $j = 1 To ($game_scale-2)
    If $array[$i][$j] = 3 Then
    $array[$i][$j] = 0
    EndIf
    If $array[$i][$j] = 4 Then
    $array[$i][$j] = 2
    EndIf
    Next
    Next
    Elseif $amount = 0 Then
    For $i = 1 To ($game_scale-2)
    For $j = 1 To ($game_scale-2)
    If $array[$i][$j] = 4 Then
    $array[$i][$j] = 0
    EndIf
    If $array[$i][$j] = 3 Then
    $array[$i][$j] = 2
    EndIf
    Next
    Next
    Else
    For $i = 1 To ($game_scale-2)
    For $j = 1 To ($game_scale-2)
    If $array[$i][$j] = 3 or $array[$i][$j] = 4 Then
    $array[$i][$j] = 0
    EndIf
    Next
    Next
    EndIf
    EndFunc ;==>_compare

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

    Func _Issolved()
    Local $black = 0
    For $i = 1 To ($game_scale-2)
    For $j = 1 To ($game_scale-2)
    If $array[$i][$j] = 1 Then
    $black += 1
    EndIf
    Next
    Next
    If $black / $game_scale^2 <= $grenze Then
    guictrlsetdata($percentlabel, "Prozent: "&round(($black / $game_scale^2)*100))
    Else
    _newlevel()
    EndIf
    EndFunc ;==>_Issolved

    [/autoit]

    Hier die "Control"-Variante:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    #include <gdiplus.au3>
    HotKeySet("{LEFT}", "_up")
    HotKeySet("{UP}", "_left")
    HotKeySet("{RIGHT}", "_down")
    HotKeySet("{DOWN}", "_right")

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

    Global $ballpos[2][8]
    Global $direction[8]
    Global $array[52][52]
    Global $background_control[52][52]
    Global $level = 1
    Global $player_direction = -1
    Global $player_pos[2] = [0, 0]
    Global $grenze = 0.7
    Global $lives = 3
    Global $rpcounter = 0
    Global $newdirdirection[4][8][4] = [[[0, 1, 2, 2], [0, 1, 2, 1], [0, 1, 2, 2], [0, 1, 2, 0], [0, 1, 2, 3], [0, 1, 2, 2], [0, 1, 2, 0], [0, 1, 2, 0]], [[2, 3, 4, 3], [2, 3, 4, 2], [2, 3, 4, 3], [2, 3, 4, 1], [2, 3, 4, 0], [2, 3, 4, 3], [2, 3, 4, 1], [2, 3, 4, 1]], [[4, 5, 6, 0], [4, 5, 6, 3], [4, 5, 6, 0], [4, 5, 6, 2], [4, 5, 6, 1], [4, 5, 6, 0], [4, 5, 6, 2], [4, 5, 6, 2]], [[6, 7, 0, 1], [6, 7, 0, 0], [6, 7, 0, 1], [6, 7, 0, 3], [6, 7, 0, 2], [6, 7, 0, 1], [6, 7, 0, 3], [6, 7, 0, 3]]]

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

    $MainGui = GUICreate("Xonix -by Alex & RapIt & Fresapore", 521, 551, 192, 124)
    $percentlabel = guictrlcreatelabel("Prozent: 0", 0, 520, 520/3, 30)
    guictrlsetfont(-1, 20)
    $lifelabel = guictrlcreatelabel("Leben: 3", 520/3*2, 520, 520/3, 30)
    guictrlsetfont(-1, 20)
    $levellabel = guictrlcreatelabel("Level: ", 520/3, 520, 520/3, 30)
    guictrlsetfont(-1, 20)
    GUISetState(@SW_SHOW)

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

    GUISetState(@SW_LOCK)
    For $x = 0 To 51
    For $y = 0 To 51
    $background_control[$x][$y] = GUICtrlCreatebutton("", $y*10, $x*10, 10, 10)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $array[$x][$y] = 0
    Next
    Next

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

    For $x = 0 To 51
    $array[0][$x] = 1
    GUICtrlSetBkColor($background_control[0][$x], 0x000000)
    $array[51][$x] = 1
    GUICtrlSetBkColor($background_control[51][$x], 0x000000)
    $array[$x][0] = 1
    GUICtrlSetBkColor($background_control[$x][0], 0x000000)
    $array[$x][51] = 1
    GUICtrlSetBkColor($background_control[$x][51], 0x000000)
    Next
    GUISetState(@SW_UNLOCK)
    ;------------Main----------------

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

    _newlevel()
    AdlibRegister("_ballmove", 100)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    Sleep(50)
    WEnd

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

    ;---------------------------------

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

    Func _left()
    If $player_direction <> 2 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 0
    EndFunc ;==>_left

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

    Func _up()
    If $player_direction <> 3 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 1
    EndFunc ;==>_up

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

    Func _right()
    If $player_direction <> 0 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 2
    EndFunc ;==>_right

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

    Func _down()
    If $player_direction <> 1 Or $array[$player_pos[0]][$player_pos[1]] = 1 Then $player_direction = 3
    EndFunc ;==>_down

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

    Func _newlevel()
    GUISetState(@SW_LOCK)
    guictrlsetdata($percentlabel, "Prozent: 0")
    For $x = 1 to 50
    For $y = 1 to 50
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$y][$x], 0xFFFFFF)
    Next
    Next
    GUICtrlSetData($levellabel, "Level: "&$level)
    GUISetState(@SW_UNLOCK)
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    For $i = 0 To $level - 1
    $direction[$i] = 0
    $ballpos[0][$i] = Random(2, 49, 1)
    $ballpos[1][$i] = Random(2, 49, 1)
    Next
    $level += 1
    EndFunc ;==>_newlevel

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

    Func _ballmove()
    Local $newdir
    Local $collision[7]
    Local $number_red = 0
    If $player_direction <> -1 Then
    If $array[$player_pos[0]][$player_pos[1]] = 0 Then
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFFFFFF)
    Elseif $array[$player_pos[0]][$player_pos[1]] = 1 Then
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0x000000)
    Endif
    Switch $player_direction
    Case 0
    If $player_pos[0] > 0 Then
    If $array[$player_pos[0] - 1][$player_pos[1]] = 0 Then
    $array[$player_pos[0] - 1][$player_pos[1]] = 2
    ElseIf $array[$player_pos[0] - 1][$player_pos[1]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to 52-2
    For $y = 1 to 52-2
    If $array[$x][$y] = 2 then
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$x][$y], 0xFFFFFF)
    EndIf
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[0] > 0 Then $player_pos[0] -= 1
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFF0000)
    Else
    $player_direction = -1
    EndIf
    Case 1
    If $player_pos[1] > 0 Then
    If $array[$player_pos[0]][$player_pos[1] - 1] = 0 Then
    $array[$player_pos[0]][$player_pos[1] - 1] = 2
    ElseIf $array[$player_pos[0]][$player_pos[1] - 1] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to 52-2
    For $y = 1 to 52-2
    If $array[$x][$y] = 2 then
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$x][$y], 0xFFFFFF)
    EndIf
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[1] > 0 Then $player_pos[1] -= 1
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFF0000)
    Else
    $player_direction = -1
    EndIf
    Case 2
    If $player_pos[0] < 51 Then
    If $array[$player_pos[0] + 1][$player_pos[1]] = 0 Then
    $array[$player_pos[0] + 1][$player_pos[1]] = 2
    ElseIf $array[$player_pos[0] + 1][$player_pos[1]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to 52-2
    For $y = 1 to 52-2
    If $array[$x][$y] = 2 then
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$x][$y], 0xFFFFFF)
    EndIf
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[0] < 52 Then $player_pos[0] += 1
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFF0000)
    Else
    $player_direction = -1
    EndIf
    Case 3
    If $player_pos[1] < 51 Then
    If $array[$player_pos[0]][$player_pos[1] + 1] = 0 Then
    $array[$player_pos[0]][$player_pos[1] + 1] = 2
    ElseIf $array[$player_pos[0]][$player_pos[1] + 1] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to 52-2
    For $y = 1 to 52-2
    If $array[$x][$y] = 2 then
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$x][$y], 0xFFFFFF)
    EndIf
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    Else
    If $array[$player_pos[0]][$player_pos[1]] <> 1 Then
    _fill(0, 0)
    EndIf
    EndIf
    If $player_pos[1] < 52 Then $player_pos[1] += 1
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFF0000)
    Else
    $player_direction = -1
    EndIf
    EndSwitch
    Else
    GUICtrlSetBkColor($background_control[$player_pos[0]][$player_pos[1]], 0xFF0000)
    EndIf
    For $i = 0 To $level - 2
    GUICtrlSetBkColor($background_control[$ballpos[0][$i]][$ballpos[1][$i]], 0xFFFFFF)
    $collision = _Check($i)
    If $collision[$newdirdirection[$direction[$i]][0][0]] = 1 And $collision[$newdirdirection[$direction[$i]][0][1]] = 1 And $collision[$newdirdirection[$direction[$i]][0][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][0][3]
    If $collision[$newdirdirection[$direction[$i]][1][0]] = 1 And $collision[$newdirdirection[$direction[$i]][1][1]] = 1 And $collision[$newdirdirection[$direction[$i]][1][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][1][3]
    If $collision[$newdirdirection[$direction[$i]][2][0]] = 1 And $collision[$newdirdirection[$direction[$i]][2][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][2][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][2][3]
    If $collision[$newdirdirection[$direction[$i]][3][0]] = 1 And $collision[$newdirdirection[$direction[$i]][3][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][3][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][3][3]
    If $collision[$newdirdirection[$direction[$i]][4][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][4][1]] = 1 And $collision[$newdirdirection[$direction[$i]][4][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][4][3]
    If $collision[$newdirdirection[$direction[$i]][5][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][5][1]] = 1 And $collision[$newdirdirection[$direction[$i]][5][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][5][3]
    If $collision[$newdirdirection[$direction[$i]][6][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][6][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][6][2]] = 1 Then $newdir = $newdirdirection[$direction[$i]][6][3]
    If $collision[$newdirdirection[$direction[$i]][7][0]] <> 1 And $collision[$newdirdirection[$direction[$i]][7][1]] <> 1 And $collision[$newdirdirection[$direction[$i]][7][2]] <> 1 Then $newdir = $newdirdirection[$direction[$i]][7][3]
    $direction[$i] = $newdir
    Switch $direction[$i]
    Case 0
    $ballpos[0][$i] -= 1
    $ballpos[1][$i] -= 1
    Case 1
    $ballpos[0][$i] += 1
    $ballpos[1][$i] -= 1
    Case 2
    $ballpos[0][$i] += 1
    $ballpos[1][$i] += 1
    Case 3
    $ballpos[0][$i] -= 1
    $ballpos[1][$i] += 1
    EndSwitch

    GUICtrlSetBkColor($background_control[$ballpos[0][$i]][$ballpos[1][$i]], 0x000000)

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

    If $array[$ballpos[0][$i]][$ballpos[1][$i]] = 2 Then
    If $lives > 0 Then
    $player_direction = -1
    $player_pos[0] = 0
    $player_pos[1] = 0
    $lives -= 1
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    For $x = 1 to 52-2
    For $y = 1 to 52-2
    If $array[$x][$y] = 2 then
    $array[$x][$y] = 0
    GUICtrlSetBkColor($background_control[$x][$y], 0xFFFFFF)
    EndIf
    Next
    Next
    Else
    MsgBox(0, "Game Over", "Du hast bei Level "&$level-1&" verloren.")
    $level = 1
    $lives = 3
    GUICtrlSetData($lifelabel, "Leben: "&$lives)
    _newlevel()
    EndIf
    EndIf
    Next
    EndFunc ;==>_ballmove

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

    Func _check($num)
    Local $allcol[8]
    $allcol[0] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num]]
    $allcol[1] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num] - 1]
    $allcol[2] = $array[$ballpos[0][$num]][$ballpos[1][$num] - 1]
    $allcol[3] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num] - 1]
    $allcol[4] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num]]
    $allcol[5] = $array[$ballpos[0][$num] + 1][$ballpos[1][$num] + 1]
    $allcol[6] = $array[$ballpos[0][$num]][$ballpos[1][$num] + 1]
    $allcol[7] = $array[$ballpos[0][$num] - 1][$ballpos[1][$num] + 1]
    Return $allcol
    EndFunc ;==>_check

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

    Func _fill($start, $end)
    Local $redpoints, $fnumber = 0
    $redpoints = _getRedPoints()
    For $i = 0 To $rpcounter - 1
    If $array[$redpoints[$i][0] + 1][$redpoints[$i][1]] = 0 Then
    _a($redpoints[$i][0] + 1, $redpoints[$i][1], $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0] - 1][$redpoints[$i][1]] = 0 Then
    _a($redpoints[$i][0] - 1, $redpoints[$i][1], $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0]][$redpoints[$i][1] + 1] = 0 Then
    _a($redpoints[$i][0], $redpoints[$i][1] + 1, $fnumber)
    $fnumber = 1
    EndIf
    If $array[$redpoints[$i][0]][$redpoints[$i][1] - 1] = 0 Then
    _a($redpoints[$i][0], $redpoints[$i][1] - 1, $fnumber)
    $fnumber = 1
    EndIf
    Next
    _compare()
    $rpcounter = 0
    For $x = 1 To 50
    For $y = 1 To 50
    If $array[$x][$y] = 2 Then
    $array[$x][$y] = 1
    GUICtrlSetBkColor($background_control[$x][$y], 0x000000)
    EndIf
    Next
    Next
    _issolved()
    EndFunc ;==>_fill

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

    Func _getRedPoints()
    Local $redpoints[2500][2]
    For $i = 1 To 50
    For $j = 1 To 50
    If $array[$i][$j] = 2 Then
    $redpoints[$rpcounter][0] = $i
    $redpoints[$rpcounter][1] = $j
    $rpcounter = $rpcounter + 1
    EndIf
    Next
    Next
    Return $redpoints
    EndFunc ;==>_getRedPoints

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

    Func _a($xpos, $ypos, $fnumber)
    If $array[$xpos + 1][$ypos] = 0 Then
    $array[$xpos + 1][$ypos] = 3 + $fnumber
    _a($xpos + 1, $ypos, $fnumber)
    EndIf
    If $array[$xpos - 1][$ypos] = 0 Then
    $array[$xpos - 1][$ypos] = 3 + $fnumber
    _a($xpos - 1, $ypos, $fnumber)
    EndIf
    If $array[$xpos][$ypos + 1] = 0 Then
    $array[$xpos][$ypos + 1] = 3 + $fnumber
    _a($xpos, $ypos + 1, $fnumber)
    EndIf
    If $array[$xpos][$ypos - 1] = 0 Then
    $array[$xpos][$ypos - 1] = 3 + $fnumber
    _a($xpos, $ypos - 1, $fnumber)
    EndIf

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

    EndFunc ;==>_a

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

    Func _compare()
    Local $amount = 0
    For $i = 0 to $level-1
    If $array[$ballpos[0][$i]][$ballpos[1][$i]] = 3 Then $amount += 1
    Next
    If $amount = $level -1 Then
    For $i = 1 To 50
    For $j = 1 To 50
    If $array[$i][$j] = 3 Then
    $array[$i][$j] = 0
    EndIf
    If $array[$i][$j] = 4 Then
    $array[$i][$j] = 2
    EndIf
    Next
    Next
    Elseif $amount = 0 Then
    For $i = 1 To 50
    For $j = 1 To 50
    If $array[$i][$j] = 4 Then
    $array[$i][$j] = 0
    EndIf
    If $array[$i][$j] = 3 Then
    $array[$i][$j] = 2
    EndIf
    Next
    Next
    Else
    For $i = 1 To 50
    For $j = 1 To 50
    If $array[$i][$j] = 3 or $array[$i][$j] = 4 Then
    $array[$i][$j] = 0
    EndIf
    Next
    Next
    EndIf
    EndFunc ;==>_compare

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

    Func _Issolved()
    Local $black = 0
    For $i = 1 To 50
    For $j = 1 To 50
    If $array[$i][$j] = 1 Then
    $black += 1
    EndIf
    Next
    Next

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

    If $black / 2500 <= $grenze Then
    GUICtrlSetData($percentlabel, "Prozent: "&round(($black / 52^2)*100))
    Else
    _newlevel()
    EndIf
    EndFunc ;==>_Issolved

    [/autoit]


    MfG,
    Rapit&Fresapore

  • GTR - (jetzt aber) Graphischer Taschenrechner

    • Fresapore
    • 18. Februar 2011 um 21:25

    Sieht schick aus!
    Mir ist aufgefallen:
    man kann ja sachen wie "guidelete()" in den Taschenrechner schreiben, und wenn man dann "=" drückt, ist die Gui gelöscht Ôo :D
    ausserdem ist das bei der GTR funktion mit den einzelnen Punkten ein bisschen merkwürdig, könnte man keine ganze Linie zwischen den Punkten zeichnen?

    Aber ansonsten schön gemacht..

    MfG,
    Fresapore

  • Programm durch Tastendruck starten?

    • Fresapore
    • 14. Februar 2011 um 14:54

    Irgendwie fällt mir da das passende nicht ein, aber so funktioniert das bei mir..

    Spoiler anzeigen
    [autoit]

    #include <Misc.au3>

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

    While 1
    $var = WinList()
    $allminimized = 1
    for $i = 0 to $var[0][0]
    if winactive($var[$i][0]) and $var[$i][0] <> "" then $allminimized = 0
    Next
    if $allminimized and _IsPressed ("48") and _IsPressed("49") Then
    $tes = run ("notepad.exe")
    WinWaitActive ("Unbenannt - Edi")
    send ("Hallo")

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

    Sleep (1500)

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

    WinClose ("Unbenannt - Edi")

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

    send ("{right}{ENTER}")
    EndIf
    sleep(40)
    WEnd

    [/autoit]
  • Programm durch Tastendruck starten?

    • Fresapore
    • 14. Februar 2011 um 14:27

    So sollte es gehen..

    Spoiler anzeigen
    [autoit]

    #include <Misc.au3>

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

    While 1

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

    if _IsPressed ("48") and _IsPressed("49") Then
    $tes = run ("notepad.exe")
    WinWaitActive ("Unbenannt - Edi")
    send ("Hallo")

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

    Sleep (1500)

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

    WinClose ("Unbenannt - Edi")

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

    send ("{right}{ENTER}")
    EndIf
    WEnd

    [/autoit]

    MfG,
    Fresapore

  • Fresapore sagt Hallihallo

    • Fresapore
    • 6. Februar 2011 um 22:39

    Hallo an Alle,
    ich heiße Marvin,
    bin ein geschätztes halbes Jahr im Forum, habe aber bereits davor schon Sachen mit AutoIt gemacht..
    Ich bin atm 15 Jahre alt und gehe in die 10 Kl., wohne auf der Grenze zur Niederlande in der riesigen Metropole Vaals Ôo :D
    Auf AutoIt gekommen bin ich, weil ich schon in meiner Grundschulzeit gerne mit Phython (for Kids ;)) gespielt habe und früh Computerbegeistert war, und das nicht im Sinne von Spielen...
    Dann hat mich ein Bekannter gefragt, ob ich nicht für seine Firma ein Lagerverwaltungsprogramm schreiben wolle, eben in Autoit.

    Hobbys sind neben am Computer vergammeln und zu coden Fussball, Klavier, Pfadfinder (und ich steh dazu!! :D), Skifahren und gelegentliches Windsurfen und die Technik an meiner Schule mitmachen.

    Im Moment bin ich noch eher Fragender als Antworter, versuche aber eine gute Mischung hinzukriegen...

    Also lasst mich, gewährt mir die Bitte in eurem Bunde der (wie viele gibts hier eigentlich Ôo? ich bin auf ~7633 gekommen)


    MfG,
    Fresapore

  • mathematik frage

    • Fresapore
    • 6. Februar 2011 um 11:49

    L3viathan
    Wenn ich die Aufgabe richtig verstanden habe,
    ist Wurzel 2 (+ den Anfangspunkt) nicht richtig, sondern nur das Verhältnis von 1:sqrt(2) = x:1 bzw. y:1

    MfG,
    Fresapore

  • mathematik frage

    • Fresapore
    • 6. Februar 2011 um 11:27

    Naja, du hast ein Dreieck, in dem gilt: 2a²=1².
    d.h: a= 1/sqrt(2)
    wenn du jetzt einfach 1+t*a machst, bekommst du x und y werte...

    Spoiler anzeigen
    [autoit]

    $aSchritt = 1 ;Die Anzahl Schritte in Einheiten
    Local $p1[2] = [1, 1] ;Koordinaten Punkt 1
    Local $p2[2] = [3, 3] ;Koordinaten Punkt 2
    Local $p3[2]

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

    $m = ($p2[1]-$p1[1])/($p2[0]-$p1[0]) ;Steigung ausrechnen (als Faktor für die Y-Strecke im Verhältnis zu X-Strecke
    $a = 1/(sqrt(1+$m)) ;Umformung aus a²+(a*m)² = c² (ist dann Faktor für die Strecke

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

    $p3[0] = $p1[0] + $aSchritt*$a
    $p3[1] = $p1[1] + $aSchritt*$a*$m

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

    MsgBox(0, "Ergebnis", $p3[0]&"/"&$p3[1])

    [/autoit]


    MfG,
    Fresapore

  • Sätze/Vokabel Trainer

    • Fresapore
    • 31. Januar 2011 um 14:07

    Hallihallo,
    scheint ganz gut zu klappen,
    aber wie Alina schon sagte, sollte es die Möglichkeit geben, eine falsche Vokabel als Richtig zu zaehlen, wenn sie auch richtig ist....

    MfG.,
    Fresapore

  • Speichern eines arrays in einer Text datei

    • Fresapore
    • 18. Januar 2011 um 22:37

    Ich erkenne jetzt nicht dirket eine feste reihenfolge wie die Zahlen in dem Array zugeordent sind, aber man könnte
    einen String mit einer (bzw 2)For-Schleifen immer um den nächsten Arrayeintrag+@CRLF erweitern, und diesen String dann in die Textdatei schreiben
    Z.B.:

    Spoiler anzeigen
    [autoit]

    Dim $array[10][10]
    $path = @Scriptdir
    For $x = 0 to 9
    For $y = 0 to 9
    $array[$x][$y] = $y+10*$x ;Belegen des Arrays mit aufsteigenden Werten von 0 bis 99
    Next
    Next

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

    ;In den String schreiben
    $String = ""
    For $x = 0 to 9
    For $y = 0 to 9
    $string &= "Array["&$x&"]["&$y&"] = "&$array[$x][$y]&@CRLF
    Next
    Next

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

    ;in Datei schreiben
    $file = fileopen($path&"\test.txt", 2)
    filewrite($file, $string)
    fileclose($file)

    [/autoit]

    //Edit: War wohl jemand schneller...

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™