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. L3viathan

Beiträge von L3viathan

  • snake mit button weiter zusammenbinden

    • L3viathan
    • 25. Dezember 2008 um 15:23

    Schönes Spiel, hierdurch läufts:

    Spoiler anzeigen
    [autoit]

    ;Fenster:

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

    #include

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

    #Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\salvatore monachello\eigene dateien\snake.kxf
    $Form1_1 = GUICreate("Snake", 633, 447, 190, 119)
    $Button1 = GUICtrlCreateButton("Weiter", 488, 400, 113, 33, 0)
    $Button2 = GUICtrlCreateButton("Abbrechen", 343, 400, 113, 33, 0)
    $Label1 = GUICtrlCreateLabel("Spiele Snake auf Computer", 160, 32, 323, 33)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("Die Steuerung:", 256, 104, 111, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label3 = GUICtrlCreateLabel("Die Steuerung erfolgt durch das Drücken der Pfeiltaste ", 152, 160, 300, 17)
    $Label4 = GUICtrlCreateLabel("Vorsicht das Spiel startet sofort!!!", 152, 176, 158, 17)
    $Label5 = GUICtrlCreateLabel("Viel Glück!!!!!!!!!", 160, 312, 79, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $msg=GuiGetMsg()
    If $msg=-3 Then Exit
    If $msg=$Button1 Then ExitLoop
    If $msg=$Button2 Then button2()
    WEnd

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

    ;~ Func button1 () ;button=weiter
    ;~ sleep (100)

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

    ;~ Exit(1) ;WÜRDE HEIßEN, DASS DAS SCRIPT BEENDET WIRD!!!
    ;~ EndFunc

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

    Func button2 () ;button=abbrechen
    Sleep (100)
    Exit (1)
    EndFunc
    ;Fenster ende:
    ;snake:
    #include
    #include
    #include
    #include
    #include

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

    FileInstall("Snake2.png", @TempDir & "\Snake2.png", 1)
    FileInstall("Snake.wav", @TempDir & "\Snake.wav", 1)
    FileInstall("Snake1.wav", @TempDir & "\Snake1.wav", 1)
    FileInstall("Snake2.wav", @TempDir & "\Snake2.wav", 1)

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

    Global $sCatch = "123456789"
    Global $iCatch = StringLen($sCatch)

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

    Global $SND1 = _SoundOpen(@TempDir & "\Snake.wav")
    Global $SND2 = _SoundOpen(@TempDir & "\Snake1.wav")
    Global $SND3 = _SoundOpen(@TempDir & "\Snake2.wav")

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

    Global $hBitmap, $hScreen, $hGraphic, $hBrush, $hGUI, $hCursor, $hGraphic1
    Global $LeftID, $RightID, $DownID, $UpID
    Global $iDirection = 0, $iDirectionOld = 0, $iPosX, $iPosY, $iCount = 0, $iCPosX, $iCPosY
    Global $aPos[1000][3], $iSnakeLen = 0

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

    Global $DesktopWidth = @DesktopWidth, $DesktopHeight = @DesktopHeight
    $DesktopHeight -= Mod($DesktopHeight, 20)
    $DesktopWidth -= Mod($DesktopWidth, 20)
    Global $iRound = 1, $iCatchX = -50, $iCatchY = -50, $iLevel = 0, $iLevelMax = 6
    Global $aWall[2][2]
    $aWall[0][0] = 0

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

    _GDIPlus_Startup()

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

    $hBitmap = _ScreenCapture_Capture("", 0, 0, -1, -1, 0)
    $hScreen = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)

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

    $hBrushSnake = _GDIPlus_BrushCreateSolid(0xFF00FF00)
    $hPenSnake = _GDIPlus_PenCreate(0xFF003300, 2)
    $hBrushWall = _GDIPlus_BrushCreateSolid(0xBBFF0000)
    $hBrushOutLine = _GDIPlus_BrushCreateSolid(0xBBFF0000)
    $hPenWall = _GDIPlus_PenCreate(0xFF330000, 2)

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

    $hBrushBlack = _GDIPlus_BrushCreateSolid(0xFF000000)

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

    $hBrushBk = _GDIPlus_BrushCreateSolid(0x110000FF)
    $hBrushCurShad = _GDIPlus_BrushCreateSolid(0x55000000)
    $hBrushCursor = _GDIPlus_BrushCreateSolid(0x66FF7700)

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

    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hScreen)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, $DesktopWidth, $DesktopHeight, $hBrushBk)
    $hCursor = _GDIPlus_BitmapCreateFromFile(@TempDir & "\Snake2.png")
    $iCPosX = $DesktopWidth - 125
    $iCPosY = $DesktopHeight - 100
    _GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCurShad)
    _GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCurShad)
    _GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCurShad)
    _GDIPlus_GraphicsFillRect($hGraphic1, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCurShad)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, $DesktopWidth, 20, $hBrushOutLine)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, $DesktopHeight - 20, $DesktopWidth, 20, $hBrushOutLine)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, 20, 20, $DesktopHeight - 40, $hBrushOutLine)
    _GDIPlus_GraphicsFillRect($hGraphic1, $DesktopWidth - 20, 20, $DesktopWidth, $DesktopHeight - 40, $hBrushOutLine)
    _GDIPlus_GraphicsDrawRect($hGraphic1, 19, 19, $DesktopWidth - 39, $DesktopHeight - 39, $hPenWall)
    $iCPosX += 5
    $iCPosY -= 5

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

    Opt("GuiOnEventMode", 1)
    Opt("PixelCoordMode", 2)

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

    $hGUI = GUICreate("Eukalyptus Snake", $DesktopWidth, $DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    $LeftID = GUICtrlCreateButton("", 0, -90)
    GUICtrlSetOnEvent(-1, "_Left")
    GUICtrlSetState(-1, $GUI_HIDE)
    $RightID = GUICtrlCreateButton("", 0, -70)
    GUICtrlSetOnEvent(-1, "_Right")
    GUICtrlSetState(-1, $GUI_HIDE)
    $DownID = GUICtrlCreateButton("", 0, -50)
    GUICtrlSetOnEvent(-1, "_Down")
    GUICtrlSetState(-1, $GUI_HIDE)
    $UpID = GUICtrlCreateButton("", 0, -30)
    GUICtrlSetOnEvent(-1, "_Up")
    GUICtrlSetState(-1, $GUI_HIDE)
    Dim $AccelKeys[4][2] = [["{Left}", $LeftID],["{Right}", $RightID],["{Down}", $DownID],["{Up}", $UpID]]
    GUISetAccelerators($AccelKeys)
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetState(@SW_SHOW)

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

    GUIRegisterMsg($WM_PAINT, '_Redraw')
    _GDIPlus_GraphicsDrawImage($hGraphic, $hScreen, 0, 0)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)

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

    _Success()

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

    While 1
    If $iCount >= 4 Then
    _NewDir()
    $iCount = 0
    EndIf
    $iCount += 1
    _Move()
    Sleep(20)
    If PixelGetColor(10, 10, $hGUI) = 0 Then
    _ReDraw(0, 0, 0, 0)
    EndIf
    WEnd

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

    Func _Round1()
    Return
    EndFunc ;==>_Round1

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

    Func _Round2()
    Local $iCnt = 0, $iX = 100
    While $iX < $DesktopWidth - 100
    $iCnt += 1
    ReDim $aWall[$iCnt + 1][2]
    $aWall[$iCnt][0] = $iX
    $aWall[$iCnt][1] = $DesktopHeight / 2
    $aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
    $aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
    $iX += 20
    WEnd
    $aWall[0][0] = $iCnt
    _DrawWall()
    EndFunc ;==>_Round2

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

    Func _Round5()
    Local $iCnt = 0, $iX = 40
    While $iX < $DesktopWidth - 30
    $iCnt += 1
    ReDim $aWall[$iCnt + 1][2]
    $aWall[$iCnt][0] = $iX
    $aWall[$iCnt][1] = $DesktopHeight / 2
    $aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
    $aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
    $iX += 40
    WEnd
    $aWall[0][0] = $iCnt
    _DrawWall()
    EndFunc ;==>_Round5

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

    Func _Round4()
    Local $iCnt = 0, $iX = 100
    For $i = 100 To $DesktopHeight - 100 Step 160
    $iX = 100
    While $iX < $DesktopWidth - 100
    $iCnt += 1
    ReDim $aWall[$iCnt + 1][2]
    $aWall[$iCnt][0] = $iX
    $aWall[$iCnt][1] = $i
    $aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
    $aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
    $iX += 20
    WEnd
    Next
    $aWall[0][0] = $iCnt
    _DrawWall()
    EndFunc ;==>_Round4

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

    Func _Round3()
    Local $iCnt = 0, $iX = 100
    While $iX < $DesktopWidth - 100
    $iCnt += 1
    ReDim $aWall[$iCnt + 1][2]
    $aWall[$iCnt][0] = $iX
    $aWall[$iCnt][1] = $DesktopHeight / 2
    $aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
    $aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
    $iX += 20
    WEnd
    $iX = 100
    While $iX < $DesktopHeight - 100
    $iCnt += 1
    ReDim $aWall[$iCnt + 1][2]
    $aWall[$iCnt][0] = $DesktopWidth / 2
    $aWall[$iCnt][1] = $iX
    $aWall[$iCnt][0] -= Mod($aWall[$iCnt][0], 20)
    $aWall[$iCnt][1] -= Mod($aWall[$iCnt][1], 20)
    $iX += 20
    WEnd
    $aWall[0][0] = $iCnt
    _DrawWall()
    EndFunc ;==>_Round3

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

    Func _DrawWall()
    Local $iX = $aWall[1][0], $iY = $aWall[1][1], $iDir = 0
    For $i = 1 To $aWall[0][0]
    _GDIPlus_GraphicsFillRect($hGraphic, $aWall[$i][0], $aWall[$i][1], 20, 20, $hBrushWall)
    If $i = 1 Then ContinueLoop
    If (($aWall[$i][0] - 20 = $aWall[$i - 1][0]) And ($aWall[$i - 1][1] = $aWall[$i][1])) Then
    $iDir = 0
    If $i < $aWall[0][0] Then ContinueLoop
    ElseIf (($aWall[$i][0] = $aWall[$i - 1][0]) And ($aWall[$i - 1][1] = $aWall[$i][1] - 20)) Then
    $iDir = 1
    If $i < $aWall[0][0] Then ContinueLoop
    Else
    If $iDir = 0 Then _GDIPlus_GraphicsDrawRect($hGraphic, $iX + 1, $aWall[$i - 1][1] + 1, $aWall[$i - 1][0] - $iX + 18, 18, $hPenWall)
    If $iDir = 1 Then _GDIPlus_GraphicsDrawRect($hGraphic, $aWall[$i - 1][0] + 1, $iY + 1, 18, $aWall[$i - 1][1] + 18, $hPenWall)
    $iX = $aWall[$i][0]
    $iY = $aWall[$i][1]
    EndIf
    If $i = $aWall[0][0] Then
    If $iDir = 0 Then _GDIPlus_GraphicsDrawRect($hGraphic, $iX + 1, $aWall[$i - 1][1] + 1, $aWall[$i][0] - $iX + 18, 18, $hPenWall)
    If $iDir = 1 Then _GDIPlus_GraphicsDrawRect($hGraphic, $aWall[$i - 1][0] + 1, $iY + 1, 18, $aWall[$i][1] - $iY + 18, $hPenWall)
    EndIf
    Next
    EndFunc ;==>_DrawWall

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

    Func _NewDir()
    Local $bCursor = False
    If $iDirectionOld <> $iDirection Then $bCursor = True
    _CheckCrash()
    If $bCursor = True Then
    Switch $iDirectionOld
    Case 0
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 0, 38, 28, 34, $iCPosX, $iCPosY + 38, 28, 34)
    Case 1
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 64, 38, 28, 34, $iCPosX + 64, $iCPosY + 38, 28, 34)
    Case 2
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 32, 38, 28, 34, $iCPosX + 32, $iCPosY + 38, 28, 34)
    Case 3
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hCursor, 32, 0, 28, 34, $iCPosX + 32, $iCPosY, 28, 34)
    EndSwitch
    EndIf
    $iDirectionOld = $iDirection
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hScreen, $aPos[$iSnakeLen][0], $aPos[$iSnakeLen][1], 20, 20, $aPos[$iSnakeLen][0], $aPos[$iSnakeLen][1], 20, 20)
    If $aPos[$iSnakeLen][0] >= $iCPosX - 20 And $aPos[$iSnakeLen][1] >= $iCPosY - 20 Then _GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
    If $bCursor = True Or ($aPos[$iSnakeLen][0] >= $iCPosX - 20 And $aPos[$iSnakeLen][1] >= $iCPosY - 20) Then
    Switch $iDirectionOld
    Case 0
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 1
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 2
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 3
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCursor)
    EndSwitch
    EndIf
    For $i = $iSnakeLen To 1 Step -1
    $aPos[$i][0] = $aPos[$i - 1][0]
    $aPos[$i][1] = $aPos[$i - 1][1]
    $aPos[$i][2] = $aPos[$i - 1][2]
    Next
    $aPos[0][0] = $iPosX
    $aPos[0][1] = $iPosY
    $aPos[0][2] = $iDirectionOld
    EndFunc ;==>_NewDir

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

    Func _CheckCrash()
    If $iPosX <= 0 Or $iPosX >= $DesktopWidth - 20 Or $iPosY <= 0 Or $iPosY >= $DesktopHeight - 20 Then _Fail()
    For $i = 0 To $iSnakeLen
    If $iPosX = $aPos[$i][0] And $iPosY = $aPos[$i][1] Then _Fail()
    If $iPosX > $iCatchX - 10 And $iPosY > $iCatchY - 10 And $iPosX <= $iCatchX + 40 And $iPosY <= $iCatchY + 40 Then _NewRound()
    Next
    For $i = 0 To $aWall[0][0]
    If $iPosX = $aWall[$i][0] And $iPosY = $aWall[$i][1] Then _Fail()
    Next
    EndFunc ;==>_CheckCrash

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

    Func _NewRound()
    If StringMid($sCatch, $iRound, 1) = " " Then
    $iRound += 1
    Return
    EndIf
    Local $bSuc = False
    _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hScreen, $iCatchX, $iCatchY, 40, 40, $iCatchX, $iCatchY, 40, 40)
    Do
    $iCatchX = Random(50, $DesktopWidth - 90, 1)
    $iCatchY = Random(50, $DesktopHeight - 150, 1)
    $iCatchX -= Mod($iCatchX, 20)
    $iCatchY -= Mod($iCatchY, 20)
    For $i = 0 To $iSnakeLen
    If $iCatchX >= $aPos[$i][0] - 50 And $iCatchY >= $aPos[$i][1] - 50 And $iCatchX <= $aPos[$i][0] + 10 And $iCatchY <= $aPos[$i][1] + 10 Then
    $bSuc = False
    ExitLoop
    Else
    $bSuc = True
    EndIf
    Next
    If $bSuc = False Then ContinueLoop
    For $i = 0 To $aWall[0][0]
    If $iCatchX >= $aWall[$i][0] - 50 And $iCatchY >= $aWall[$i][1] - 50 And $iCatchX <= $aWall[$i][0] + 10 And $iCatchY <= $aWall[$i][1] + 10 Then
    $bSuc = False
    ExitLoop
    Else
    $bSuc = True
    EndIf
    Next
    Until $bSuc = True
    _SoundPlay($SND1, 0)
    _Write(StringMid($sCatch, $iRound, 1))
    _DrawPosRefresh(1, 0)
    $iRound += 1
    $iSnakeLen += 15
    If $iSnakeLen > 999 Then $iSnakeLen = 999
    If $iRound > $iCatch + 1 Then _Success()
    $iBlinkTimer = TimerInit()
    $bBlinkColor = True
    EndFunc ;==>_NewRound

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

    Func _Write($sString, $iX = $iCatchX, $iY = $iCatchY, $iC = 0)
    Local $iXL = StringLen($sString) * 40
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    Local $hFont = _GDIPlus_FontCreate($hFamily, 30, 1)
    Local $hBrush1 = $hBrushBlack
    Local $tLayout
    Local $aInfo
    For $i = -1 To 1
    For $j = -1 To 1
    $tLayout = _GDIPlus_RectFCreate($iX + $i * 2, $iY + $j * 2, $iXL, 40)
    $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush1)
    Next
    Next
    $tLayout = _GDIPlus_RectFCreate($iX, $iY, $iXL, 40)
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 30, 1)
    $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
    $hBrush1 = $hBrushSnake
    _GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush1)
    EndFunc ;==>_Write

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

    Func _DrawPosRefresh($iS, $iE)
    For $i = $iS To $iE Step -1
    For $j = 1 To 4
    Switch $aPos[$i][2]
    Case 0
    _DrawPos($aPos[$i][0] - 5 * $j, $aPos[$i][1], $aPos[$i][2])
    Case 1
    _DrawPos($aPos[$i][0] + 5 * $j, $aPos[$i][1], $aPos[$i][2])
    Case 2
    _DrawPos($aPos[$i][0], $aPos[$i][1] + 5 * $j, $aPos[$i][2])
    Case 3
    _DrawPos($aPos[$i][0], $aPos[$i][1] - 5 * $j, $aPos[$i][2])
    EndSwitch
    Next
    Next
    EndFunc ;==>_DrawPosRefresh

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

    Func _DrawPos($iX, $iY, $iD)
    _GDIPlus_GraphicsFillRect($hGraphic, $iX + 2, $iY + 2, 16, 16, $hBrushSnake)
    Switch $iD
    Case 0
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 6, $iY + 1, $iX + 1, $iY + 1, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 1, $iX + 1, $iY + 19, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 19, $iX + 6, $iY + 19, $hPenSnake)
    Case 1
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 13, $iY + 1, $iX + 19, $iY + 1, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 1, $iX + 19, $iY + 19, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 19, $iX + 13, $iY + 19, $hPenSnake)
    Case 2
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 13, $iX + 1, $iY + 19, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 19, $iX + 19, $iY + 19, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 19, $iX + 19, $iY + 13, $hPenSnake)
    Case 3
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 6, $iX + 1, $iY + 1, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 1, $iY + 1, $iX + 19, $iY + 1, $hPenSnake)
    _GDIPlus_GraphicsDrawLine($hGraphic, $iX + 19, $iY + 1, $iX + 19, $iY + 6, $hPenSnake)
    EndSwitch
    If $iX >= $iCPosX - 20 And $iY >= $iCPosY - 20 Then
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
    Switch $iDirectionOld
    Case 0
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 1
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 64, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 2
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY + 38, 28, 34, $hBrushCursor)
    Case 3
    _GDIPlus_GraphicsFillRect($hGraphic, $iCPosX + 32, $iCPosY, 28, 34, $hBrushCursor)
    EndSwitch
    EndIf
    EndFunc ;==>_DrawPos

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

    Func _Move()
    Switch $iDirectionOld
    Case 0
    $iPosX -= 5
    Case 1
    $iPosX += 5
    Case 2
    $iPosY += 5
    Case 3
    $iPosY -= 5
    EndSwitch
    _DrawPos($iPosX, $iPosY, $iDirectionOld)
    EndFunc ;==>_Move

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

    Func _Left()
    If $iDirectionOld <> 1 Then $iDirection = 0
    EndFunc ;==>_Left

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

    Func _Right()
    If $iDirectionOld <> 0 Then $iDirection = 1
    EndFunc ;==>_Right

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

    Func _Down()
    If $iDirectionOld <> 3 Then $iDirection = 2
    EndFunc ;==>_Down

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

    Func _Up()
    If $iDirectionOld <> 2 Then $iDirection = 3
    EndFunc ;==>_Up

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

    Func _ReDraw($hwnd, $msg, $wparam, $lparam)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hScreen, 0, 0)
    _DrawPosRefresh($iSnakeLen, 1)
    _Write(StringMid($sCatch, $iRound - 1, 1))
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hCursor, $iCPosX, $iCPosY, 93, 73)
    _DrawWall()
    Return $GUI_RUNDEFMSG
    EndFunc ;==>_ReDraw

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

    Func _Success()
    If $iLevel > 0 Then _SoundPlay($SND2, 1)
    For $i = 0 To 999
    $aPos[$i][0] = -50
    $aPos[$i][1] = -50
    $aPos[$i][2] = 5
    Next
    $iLevel += 1
    If $iLevel >= $iLevelMax Then _Exit()
    Call("_Round" & $iLevel)
    $iPosX = 20
    $iPosY = 20
    $aPos[0][0] = $iPosX
    $aPos[0][1] = $iPosY
    $iDirection = 1
    $iDirectionOld = 1
    $iSnakeLen = 0
    $iRound = 1
    $iCount = 0
    _NewRound()
    _ReDraw(0, 0, 0, 0)
    EndFunc ;==>_Success

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

    Func _Fail()
    _SoundPlay($SND3, 1)
    _Exit()
    EndFunc ;==>_Fail

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

    Func _Exit()
    _GDIPlus_Shutdown()
    FileDelete(@TempDir & "\Snake2.png")
    FileDelete(@TempDir & "\Snake.wav")
    FileDelete(@TempDir & "\Snake1.wav")
    FileDelete(@TempDir & "\Snake2.wav")
    Exit
    sleep(100)
    run("setup start.exe")

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

    EndFunc ;==>_Exit

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

    ;snake ende:

    [/autoit]


    An deiner Stelle würd ich noch eine Meldung machen, wenn man verliert, nicht einfach beenden.P.S.: Ach, und Forschlag schreibt man mit "V".

  • Anweisung nur einmal pro Minute ausführen

    • L3viathan
    • 24. Dezember 2008 um 23:58

    Mach mal halblang, Padmak!
    Allein die Kenntnis über Keylogger besagt noch lange nicht deren Einsatz!
    Security-Admins interessieren sich doch auch für Exploits und 0dayz.

  • nOOb Projekt second try

    • L3viathan
    • 24. Dezember 2008 um 22:40

    Ich habe auch grade viel Zeit.
    Aber Winamp musst du rausnehmen! :P

  • AutoIt Datei generieren

    • L3viathan
    • 24. Dezember 2008 um 15:59

    Oder so:

    [autoit]

    msgbox(0,"","Dieses Zeichen:"" heißt Gänsefüßchen!")

    [/autoit]


    Mit doppelten "

  • Hilfe zu Pic gebraucht

    • L3viathan
    • 23. Dezember 2008 um 21:54

    Das Script ist doch von Jam00, Raupi!
    Trotzdem, Jam00: Forumrules

  • Hilfe zu Pic gebraucht

    • L3viathan
    • 23. Dezember 2008 um 17:10

    da gabs mal so ne dll dazu...

  • Boss-Key: alles verstecken

    • L3viathan
    • 23. Dezember 2008 um 17:06

    Richtig! :D
    Das war für die alte Variante, in der man das Programm gestartet hat, und es sofort was gemacht hat..

  • _Ispressedtime

    • L3viathan
    • 23. Dezember 2008 um 14:50

    Problem: Wenn man die Taste garnicht drückt, kommt trotzdem 1 ms oder so raus.

  • Ftp.au3

    • L3viathan
    • 23. Dezember 2008 um 14:39

    Wenn du die ftp.au3 im Includes-Ordner gespeichert hast, dann kannst dus includen.

  • Boss-Key: alles verstecken

    • L3viathan
    • 23. Dezember 2008 um 14:35

    Bugfixed.

  • Frohe Weihnachten

    • L3viathan
    • 23. Dezember 2008 um 13:20

    Frohe Weihnachten...
    ())()(())(()())(())(()()()()()))()()

  • Frage zum GUI Fenster...

    • L3viathan
    • 23. Dezember 2008 um 12:58
    Zitat von vism

    Mhhh....Also wenn ich das mach dann öffnet sich zwar das GUI net sofort, aber mit welchen Tasten rufe ich es ingame auf?

    Überleg mal...

    Zitat
    [autoit]

    HotkeySet("+{TAB}")

    [/autoit]

    Richtig!!! Mit shift-Tab

    edit: helpfile!!! GUICreate()

  • Snipe: Kill für Dummies

    • L3viathan
    • 23. Dezember 2008 um 12:45

    Snipe ist eine Variante von GLi Kill , einem Tool von mir, was Prozesse terminiert.
    Snipe ist deutlich simpler, da es nicht auf Kommandozeilenbasis funktioniert.
    Und so gehts:
    1. Tool starten
    2. Mit Strg+Klick auf die Fenster die Prozess töten
    3. Mit Alt+Klick beenden

    Snipe
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=snipe.ico
    #AutoIt3Wrapper_outfile=Snipe.exe
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <misc.au3>
    Global Const $OCR_STD = 32512
    Global Const $OCR_CROSS = 32515
    ;~

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

    If FileExists(@ScriptDir & "\crosshair.cur") Then
    $hCrossCurs = _LoadCursorFromFile("crosshair.cur")
    Else
    $hCrossCurs = DllCall("user32.dll", "int", "LoadCursorA", "hwnd", 0, "int", $OCR_CROSS)
    endif
    DllCall("user32.dll", "int" ,"SetSystemCursor","int",$hCrossCurs[0],"int",$OCR_STD)
    ;~ DllCall("user32.dll", "int" ,"SetSystemCursor","int",$hCrossCurs[0],"int",32513)
    TrayTip("GLi Snipe","Press Strg+left mouse button to snipe, Alt+left mouse button to exit...",10)
    Soundplay("load.mp3",1)
    while True
    sleep(10)
    If _IsPressed("01") And _IsPressed("11") Then _shoot()
    If _IsPressed("01") And _IsPressed("12") Then _exit()
    WEnd
    func _shoot()
    sleep(100)
    soundplay("shot.mp3",0)
    ProcessClose(WinGetProcess("[ACTIVE]"))
    sleep(300)
    Soundplay("load.mp3",1)
    EndFunc
    func _exit()
    If FileExists(@ScriptDir & "\crosshair.cur") Then

    Else
    DllCall("user32.dll", "int" ,"SetSystemCursor","int",$hCrossCurs[0],"int",$OCR_STD)
    Endif
    Soundplay("exit.mp3",1)
    Exit
    EndFunc
    ;~ If _SetSystemCursor($hWaitCurs, $OCR_IBEAM) Then MsgBox(0, '', 'Cursor gesetzt')

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

    Func _SetSystemCursor($hCur, $id)
    Local $ret = DllCall("user32.dll", "int" ,"SetSystemCursor","int",$hCur,"int",$id)
    Return $ret[0]
    EndFunc

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

    Func _LoadCursorFromFile($lpFileName)
    Local $ret = DllCall("user32", 'long', "LoadCursorFromFileA", 'str', $lpFileName)
    Return $ret
    EndFunc

    [/autoit]


    Dieses Tool nutzt, wenn vorhanden die MP3s load.mp3, shot.mp3, sowie exit.mp3.
    Um euch in den vollen Genuss dieses Tools zu bringen, hier das Ganze als zip.
    Das mit den Cursors funzt noch nicht 100%ig...

  • Boss-Key: alles verstecken

    • L3viathan
    • 23. Dezember 2008 um 12:38

    Dieses Tool schützt die Privatspäre, indem es auf Tastenkombination alle Fenster versteckt/wieder anzeigt.
    Vorsicht: Nicht mit Nero o.ä. verwenden, Tool basiert auf Titeln!
    Hier:

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=C:\system.space\Icons\Attention2.ico
    #AutoIt3Wrapper_outfile=boss.exe
    #AutoIt3Wrapper_Res_Comment=http://glilabors.de
    #AutoIt3Wrapper_Res_Description=GLi Boss
    #AutoIt3Wrapper_Res_Fileversion=0.1.0.1
    #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
    #AutoIt3Wrapper_Res_LegalCopyright=http://glilabors.de
    #AutoIt3Wrapper_Res_Field=Made by|L3viathan
    #AutoIt3Wrapper_Res_Field=Company|GLi Labors inrternational
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <Array.au3>
    HotkeySet("#q","_hide")
    global $array[1]
    func _hide()
    $var = WinList()
    For $i = 1 to $var[0][0]
    If $var[$i][0] <> "" AND IsVisible($var[$i][1]) AND $var[$i][0] <> "Program manager" Then
    WinSetState($var[$i][0],"",@SW_HIDE)
    _Arrayadd($array,$var[$i][0])
    EndIf
    Next
    HotKeySet("#q","_q")
    EndFunc
    Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
    Else
    Return 0
    EndIf
    EndFunc
    func _q()
    for $b in $array
    WinSetState($b,"",@SW_SHOW)
    next
    Exit
    EndFunc
    while True
    sleep(100)
    WEnd

    [/autoit]
  • Maus Curser ändern und Scroolen

    • L3viathan
    • 23. Dezember 2008 um 12:21

    Nein, das beschäftigt sich mit "globalen" Cursorn.

  • Probleme mit dem Obfusator

    • L3viathan
    • 23. Dezember 2008 um 11:35

    Weil das nur 'ne Pseudo-Verschlüsselung war.
    Spätestens beim Ausführen kann man bei JEDER Scriptsprache den Quelltext auslesen.

  • _DialogMacLike UDF

    • L3viathan
    • 23. Dezember 2008 um 11:25

    Danke!
    Neue Version! (siehe Post #1)

  • Frage zum GUI Fenster...

    • L3viathan
    • 22. Dezember 2008 um 17:37

    Zu 2.)

    [autoit]


    Hotkeyset("+{TAB}","_ingamegui")
    while true
    sleep(100)
    wend
    func _ingamegui()
    If WinGetHandle("[ACTIVE]") = WinGetHandle("Titel des Spiels in Taskleiste") Then
    ;Hauptteil
    Endif
    endfunc

    [/autoit]


    Nicht in der Taskleiste?: Weiß ich nicht auswendig, aber: GUICreate()-Hilfe: Styles angucken...

  • Brauche Unteschützung: Informationen aus einem Spiel bekommen

    • L3viathan
    • 22. Dezember 2008 um 16:14

    1. Sniffer ?
    2. Du weißt, welchen Wert deine Lebenspunkte haben. Alle Speicherplätze auflisten, die den Wert haben.
    Verliere 1 Lebenspunkt. Der Eintrag von den vorigen, welcher eins kleiner wurde, zeigt deine Lebenspunkte.

  • Kleines Spiel - Kanonenschießen

    • L3viathan
    • 21. Dezember 2008 um 16:38

    Naja...
    ...ganz gut.. :sleeping:
    .
    .
    .
    .
    Spaß beiseite: Unglaublich :thumbup: Ich verstehe allerhöchstens die Hälfte 8| ?(
    Weiter so!

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™