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

Beiträge von name22

  • Destroy The Web - Cooles Spiel für zwischendurch!

    • name22
    • 20. März 2011 um 17:47

    Das solltest du aber irgendwo im Script erwähnen. Ansonsten denken die meisten du hättest das selbst gemacht...

  • Destroy The Web - Cooles Spiel für zwischendurch!

    • name22
    • 20. März 2011 um 16:12

    Aaah. Gut jetzt funktioniert es. Wobei ich nicht verstehe wozu man da ein AutoIt Script braucht ^^.

  • Destroy The Web - Cooles Spiel für zwischendurch!

    • name22
    • 20. März 2011 um 15:40

    Schau du dir doch einfach mal dein Script an... Bei mir kommt die selbe Meldung und ich finde im Code auch nichts was auf ein Spiel hindeutet... Egal welche Map ich verwende.
    Edit: Da hab ich wohl voreilige Schlüsse gezogen... Wenn ich die Map "Web" auswähle erscheint nach ca. 10 Minuten ein Fenster, kurz darauf stürzt das Script ab...

  • ein paar IniFragen

    • name22
    • 18. März 2011 um 19:57

    Du darfst innerhalb dieses String dann auch keine Operatoren benutzen... Also nicht: '&"\"' sondern "\".
    Sonst wird auch genau das nachher als Pfad verwendet (z.B. C:\Bla"&\"Test.ini)

  • case befehl

    • name22
    • 18. März 2011 um 19:29

    Du kannst stattdessen auch einfach eine While-WEnd Endlosschleife verwenden. Dein Konzept macht nämlich nichts anderes...
    Was ist denn der Sinn dahinter?

  • [GDI] Eine Pixelfarbe (zB 0xFFFFFF) nicht mit zeichen/ transparent machen

    • name22
    • 14. März 2011 um 20:52

    Dazu brauchst du ein paar Funktionen aus der GDIP.au3 (findest du im englischen Forum). Hier mal ein Beispiel.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <GDIPlus.au3>

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

    $iARGB_From = 0xFFD0D0D0
    $iARGB_To = 0xFFFFFFFF

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

    $iARGB_BG = 0xFF505050

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

    $sFilePath = FileOpenDialog("Bild auswählen", "", "Bilder (*.jpg;*.png;*.bmp)")
    If @error Then Exit

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

    $hWnd = GUICreate("ColorKey", 400, 400)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    _GDIPlus_GraphicsClear($hGraphics, $iARGB_BG)

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

    $hImage = _GDIPlus_ImageLoadFromFile($sFilePath)
    $iWidth = _GDIPlus_ImageGetWidth($hImage)
    $iHeight = _GDIPlus_ImageGetHeight($hImage)

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

    $hIA = _GDIPlus_ImageAttributesCreate()

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

    _GDIPlus_ImageAttributesSetColorKeys($hIA, 0, True, $iARGB_From, $iARGB_To)

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

    _GDIPlus_GraphicsDrawImageRectRectIA($hGraphics, $hImage, 0, 0, $iWidth, $iHeight, 0, 0, 400, 400, $hIA)

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

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_ImageAttributesDispose($hIA)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

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

    While GUIGetMsg() <> -3
    WEnd

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

    ;GDIP.au3 Functions

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_ImageAttributesCreate
    ; Description ...: Creates an ImageAttributes object
    ; Syntax.........: _GDIPlus_ImageAttributesCreate()
    ; Parameters ....: None
    ; Return values .: Success - Pointer to a new ImageAttribute object
    ; Failure - 0 and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: After you are done with the object, call _GDIPlus_ImageAttributesDispose to release the object resources
    ; Related .......: _GDIPlus_ImageAttributesDispose
    ; Link ..........; @@MsdnLink@@ GdipCreateImageAttributes
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_ImageAttributesCreate()
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateImageAttributes", "int*", 0)

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

    If @error Then Return SetError(@error, @extended, 0)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[1]
    EndFunc ;==>_GDIPlus_ImageAttributesCreate

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_ImageAttributesSetColorKeys
    ; Description ...: Sets or clears the color key (transparency range) for a specified category
    ; Syntax.........: _GDIPlus_ImageAttributesSetColorKeys($hImageAttributes[, $iColorAdjustType = 0[, $fEnable = False[, $iARGBLow = 0[, $iARGBHigh = 0]]]])
    ; Parameters ....: $hImageAttributes - Pointer to an ImageAttribute object
    ; $iColorAdjustType - The category for which the color key is set or cleared:
    ; |0 - Color adjustment applies to all categories that do not have adjustment settings of their own
    ; |1 - Color adjustment applies to bitmapped images
    ; |2 - Color adjustment applies to brush operations in metafiles
    ; |3 - Color adjustment applies to pen operations in metafiles
    ; |4 - Color adjustment applies to text drawn in metafiles
    ; $fEnable - If True, transparency range for the specified category is applied; otherwise, transparency
    ; +range for the specified category is cleared, in which case $iARGBLow and $iARGBHigh are ignored
    ; $iARGBLow - Alpha, Red, Green and Blue components of a color that specifies the low color-key value
    ; $iARGBHigh - Alpha, Red, Green and Blue components of a color that specifies the high color-key value
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: Any color that has each of its three components (red, green, blue) between the corresponding components of the
    ; +high and low color keys is made transparent
    ; Related .......: None
    ; Link ..........; @@MsdnLink@@ GdipSetImageAttributesColorKeys
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_ImageAttributesSetColorKeys($hImageAttributes, $iColorAdjustType = 0, $fEnable = False, $iARGBLow = 0, $iARGBHigh = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetImageAttributesColorKeys", "hwnd", $hImageAttributes, "int", $iColorAdjustType, "int", $fEnable, "uint", $iARGBLow, "uint", $iARGBHigh)

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

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_ImageAttributesSetColorKeys

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsDrawImageRectRectIA
    ; Description ...: Draws an image
    ; Syntax.........: _GDIPlus_GraphicsDrawImageRectRectIA($hGraphics, $hImage, $nSrcX, $nSrcY, $nSrcWidth, $nSrcHeight, $nDstX, $nDstY, $nDstWidth, $nDstHeight[, $hImageAttributes = 0[, $iUnit = 2]])
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $hImage - Pointer to an Image object
    ; $iSrcX - The X coordinate of the upper left corner of the source image
    ; $iSrcY - The Y coordinate of the upper left corner of the source image
    ; $iSrcWidth - Width of the source image
    ; $iSrcHeight - Height of the source image
    ; $iDstX - The X coordinate of the upper left corner of the destination image
    ; $iDstY - The Y coordinate of the upper left corner of the destination image
    ; $iDstWidth - Width of the destination image
    ; $iDstHeight - Height of the destination image
    ; $hImageAttributes - Pointer to an ImageAttributes object that specifies the color and size attributes of the image to be drawn
    ; $iUnit - Unit of measurement:
    ; |0 - World coordinates, a nonphysical unit
    ; |1 - Display units
    ; |2 - A unit is 1 pixel
    ; |3 - A unit is 1 point or 1/72 inch
    ; |4 - A unit is 1 inch
    ; |5 - A unit is 1/300 inch
    ; |6 - A unit is 1 millimeter
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: None
    ; Link ..........; @@MsdnLink@@ GdipDrawImageRectRect
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsDrawImageRectRectIA($hGraphics, $hImage, $nSrcX, $nSrcY, $nSrcWidth, $nSrcHeight, $nDstX, $nDstY, $nDstWidth, $nDstHeight, $hImageAttributes = 0, $iUnit = 2)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectRect", "hwnd", $hGraphics, "hwnd", $hImage, "float", $nDstX, "float", _
    $nDstY, "float", $nDstWidth, "float", $nDstHeight, "float", $nSrcX, "float", $nSrcY, "float", $nSrcWidth, "float", _
    $nSrcHeight, "int", $iUnit, "hwnd", $hImageAttributes, "int", 0, "int", 0)

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

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsDrawImageRectRectIA

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_ImageAttributesDispose
    ; Description ...: Releases an ImageAttributes object
    ; Syntax.........: _GDIPlus_ImageAttributesDispose($hImageAttributes)
    ; Parameters ....: $hImageAttributes - Pointer to an ImageAttribute object
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: _GDIPlus_ImageAttributesCreate
    ; Link ..........; @@MsdnLink@@ GdipDisposeImageAttributes
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_ImageAttributesDispose($hImageAttributes)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDisposeImageAttributes", "hwnd", $hImageAttributes)

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

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_ImageAttributesDispose

    [/autoit]
  • GDI+ - Bild von Graphic speichern & vergrößern ohne Smoothing

    • name22
    • 12. März 2011 um 18:52

    *ähem* Keine Doppelposts... ^^
    Wenn du Den Befehl auf einer Graphic anwendest, dann wirkt sich das auf alle Bilder aus die in Zukunft in diese GUI gemalt werden.

  • GDI+ - Bild von Graphic speichern & vergrößern ohne Smoothing

    • name22
    • 12. März 2011 um 18:37

    Davor.

  • Flackern von Label beheben?

    • name22
    • 12. März 2011 um 01:01

    Abgesehen davon hast du TimerInit einwenig falsch verstanden... Der Befehl gibt nur eine Zeitmarke zurück, aber die Variable wird nicht immer mit der vergangenen Zeit upgedatet... Du musst TimerDiff verwenden ;).

  • WinHTTP Frage

    • name22
    • 11. März 2011 um 17:47

    Das liegt daran, das er dann den 404 Error den du normalerweise zu sehen bekommst in die Datei schreibt. Und das sind nun mal Daten, also arbeitet die Funktion korrekt. Eine mögliche Lösung fällt mir im Moment leider nicht ein... :S

  • WinHTTP Frage

    • name22
    • 11. März 2011 um 16:58

    @error wird in keinem Fall auf 2 gesetzt :huh: ...Daszu brauchst du einen anderen Befehl.

    Spoiler anzeigen
    [autoit]

    #include <WinHTTP.au3>

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

    ; -Author: name22(http://www.autoit.de)

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

    $sURL_Download = 'http://autoit.de/wcf/images/futurex/autoit_logo_gtaspider.png'
    $sPathDst = @DesktopDir

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

    $aURL_Split = _WinHttpCrackUrl($sURL_Download)

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

    $hOpen = _WinHttpOpen()
    $hConnect = _WinHttpConnect($hOpen, $aURL_Split[2])
    $hRequest = _WinHttpOpenRequest($hConnect, "GET", $aURL_Split[6])

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

    _WinHttpSendRequest($hRequest)
    _WinHttpReceiveResponse($hRequest)

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

    Switch _WinHttpQueryDataAvailable($hRequest)
    Case True
    $vData = Binary("")
    Do
    $vData &= _WinHttpReadData($hRequest, 2)
    Until @error

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

    _WinHttpCloseHandle($hRequest)
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)

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

    $hFile = FileOpen($sPathDst & "\" & StringTrimLeft($aURL_Split[6], StringInStr($aURL_Split[6], "/", 0, -1)), 18)
    FileWrite($hFile, $vData)
    FileClose($hFile)

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

    MsgBox(64, "Info", "Download completed.")
    Case False
    MsgBox(16, "Error", "No Data available.")
    EndSwitch

    [/autoit]
  • In Datei Werte suchen und ändern ( Hex Datei )

    • name22
    • 11. März 2011 um 15:22

    Mit FileOpen("Datei.txt", 16) kannst du eine Datei im Binärmodus einlesen. Das ganze befindet sich nach dem auslesen auch schon in Hexadezimalform. Danach müsstest du im Grunde nur noch mit StringInStr StringReplace etc. arbeiten ;). Dann schreibst du das ganze wieder in die Datei. Also so:

    [autoit]

    $hFile = FileOpen("Test.txt", 16)
    $vData = FileRead($hFile)
    ;Hier kannst du mit dem String machen was du willst...
    FileClose($hFile)

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

    $hFile = FileOpen("Test.txt", 18)
    FileWrite($vData)
    FileCLose($hFile)

    [/autoit]
  • WinHTTP Frage

    • name22
    • 11. März 2011 um 14:04

    Mal ein Beispiel.

    Spoiler anzeigen
    [autoit]

    #include <WinHTTP.au3>
    ; - Author: name22
    $sURL_Download = 'http://autoit.de/wcf/images/futurex/autoit_logo_gtaspider.png'
    $sPathDst = @DesktopDir

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

    $aURL_Split = _WinHttpCrackUrl($sURL_Download)

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

    $hOpen = _WinHttpOpen()
    $hConnect = _WinHttpConnect($hOpen, $aURL_Split[2])
    $hRequest = _WinHttpOpenRequest($hConnect, "GET", $aURL_Split[6])

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

    _WinHttpSendRequest($hRequest)
    _WinHttpReceiveResponse($hRequest)

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

    $vData = Binary("")
    Do
    $vData &= _WinHttpReadData($hRequest, 2)
    Until @error

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

    _WinHttpCloseHandle($hRequest)
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)

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

    $hFile = FileOpen($sPathDst & "\" & StringTrimLeft($aURL_Split[6], StringInStr($aURL_Split[6], "/", 0, -1)), 18)
    FileWrite($hFile, $vData)
    FileClose($hFile)

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

    MsgBox(64, "Info", "Download abgeschlossen")

    [/autoit]
  • Happy Birthday, Jautois

    • name22
    • 10. März 2011 um 22:26

    Alles Gute und viel Glück im neuen Lebensjahr! :party:

  • Happy Birthday, PenGuin

    • name22
    • 10. März 2011 um 20:00

    Happy Birthday PenGuin! :thumbup:

  • Happy Birthday, leviathan

    • name22
    • 10. März 2011 um 19:49

    Alles Gute zum Geburtstag! :party::party::party::party:
    ...Mist! Mehr fällt mir dazu nicht ein :pinch: ....

  • Hilfe beim Script Stoppen

    • name22
    • 10. März 2011 um 18:56

    @Fire Bitte keine Doppelposts. Es gibt nicht umsonst einen "Bearbeiten" Button unter deinen Beiträgen ;).
    Wie du _IsPressed verwendest steht auch in der Hilfe...

    [autoit]

    #include <Misc.au3>

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

    While True
    If _IsPressed("20") Then ExitLoop
    WEnd

    [/autoit]
  • Dos Pong

    • name22
    • 10. März 2011 um 14:25

    Für einen ersten Versuch nicht schlecht, aber da könnte man noch einiges verbessern. Mein erstes Spiel (auch Pong ^^) habe ich mit GDI+ gemacht. Daher sah meins etwas besser aus... Du kannst ja irgendwann mal Version 2.0 mit GDI+ machen. Das hebt auch das flackern auf. ;)
    Vielleicht kannst du dir ja auch bei meinem Pong was abgucken für die Kollisionserkennung.

  • Script mit 2 while Schleifen.

    • name22
    • 10. März 2011 um 13:04

    Ich glaube du solltest mal ein paar Anfänger Tutorials für AutoIt durchgehen, wenn du solche Probleme in Zukunft selbst lösen willst... Du findest sie links neben den Beiträgen bei "Wichtige Links".
    Das Prinzip der While Schleife scheinst du falsch verstanden zu haben. Eine While-WEnd Schleife wiederholt einen Vorgang so lange bis ihre Bedingung falsch (False) ist. Also müsstest du es so machen:

    [autoit]

    $iTime = $anz * 3600000 ;Zeit in Millisekunden
    $Timer = TimerInit()
    While TimerDiff($Timer) < $iTime
    ;Hier kommt dein Code hin...
    WEnd

    [/autoit]


    Bei deiner 2ten Inputbox ist ein Syntaxfehler und ihren Zweck verstehe ich nicht wirklich... Vielleicht solltest du das nochmal näher erläutern.

  • Neon Snake

    • name22
    • 8. März 2011 um 21:35

    Die neue Version gefällt mir (besonder die name22 Map ^^), aber wenn man zu schnell die Richtung ändert fährt man auch in sich rein (das sieht so aus als würde die Schlange ihren eigenen Kopf fressen :D). Ich weiß nicht ob das beabsichtigt ist, aber es sieht irgendwie komisch aus.

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™