Hi Andy,
geile Idee
. Aber wir müssen dann immer für nützlichen Rechennachschub sorgen.
Beiträge von Sprenger120
-
-
-
Hi,
ja dein Post ist irrrelevant ^^. Javascript hat einen eigenen RegEx Dialekt. -
Hi AutoBot,
herzlich willkommen im Forum
PS: mach dir nichts draus was die alle Sagen
Solange du keinen mist baust sind das nur spekulationen 
-
Hi,
meins würde auch in diesem schnellen Bereich liegen wenn ich nicht die 2 divisionen drinne hätte. Die fressen insgesamt 140 Takte und das ist zu viel !
Ich könnte zwar den Code so weit umschreiben das er nur noch ein div bräuchte aber dazu hab ich keine lust ^^, und mal unter uns: wen interressierts ob das rendern nu 100ms oder 500 braucht. Schneller als AutoIt ist es allemal
-
-
Hi UEZ,
ich hab mich mal etwas damit beschäftigt, hab auch schon was funktionierendes geschrieben nur die Engine ist ziemlich verbuggt und ich habe moritz erstmal eine PM geschrieben. -
Hi,
ich habe mal als Grundlage für ein Spiel mal eine kleine Physik Demo gebaut. Nur leider spinnt die Kollisionserkennung manchmal rum (Ball fliegt durch Körper durch).viel Spaß damit
Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist. Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
HotKeySet("{Esc}", "_Exit")_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$hGUI = GUICreate("Ball Physik Demo by Sprenger120", 500, 500, 50, 50)
$hGUIDC = _WinAPI_GetDC($hGUI)
$hBitmapBackpuffer = _WinAPI_CreateCompatibleBitmap($hGUIDC, 500, 500)
$hDCBackpuffer = _WinAPI_CreateCompatibleDC($hGUIDC)
_WinAPI_SelectObject($hDCBackpuffer, $hBitmapBackpuffer)
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDCBackpuffer)
GUISetState(@SW_SHOW)Global Const $iBall = 5;Größe des Balles
[/autoit] [autoit][/autoit] [autoit]
Global Const $iPunkteAnz = 7 ;Anzahl der Punkte
Global Const $iRectAnz = 5;Anzahl der QuadrateGlobal Const $ARRAY_X = 0
[/autoit] [autoit][/autoit] [autoit]
Global Const $ARRAY_Y = 1
Global Const $ARRAY_StepX = 2
Global Const $ARRAY_StepY = 3
Global Const $ARRAY_NextStepColl = 4
Global Const $ARRAY_Width = 2
Global Const $ARRAY_Height = 3Dim $aPunkte[$iPunkteAnz][5] ;X|Y|StepX|StepY|NextStepCollision
[/autoit] [autoit][/autoit] [autoit]
Dim $aRect[$iRectAnz][4] ;X|Y|W|H;Punkte Array befüllen
[/autoit] [autoit][/autoit] [autoit]For $x = 0 To $iPunkteAnz - 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPunkte[$x][$ARRAY_X] = Random(0,500,1)
$aPunkte[$x][$ARRAY_Y] = Random(0,500,1)
$aPunkte[$x][$ARRAY_StepX] = 8;Random(5, 10, 1)
$aPunkte[$x][$ARRAY_StepY] = 8;Random(5, 10, 1)
If Mod($aPunkte[$x][$ARRAY_StepX], 2) Then $aPunkte[$x][$ARRAY_StepX] += 1
;~ If Mod($aPunkte[$x][$ARRAY_StepY], 2) Then $aPunkte[$x][$ARRAY_StepY] += 1
$aPunkte[$x][$ARRAY_NextStepColl] = 0
Next;Rect Array befüllen
[/autoit] [autoit][/autoit] [autoit]
For $x = 0 To $iRectAnz - 1
$aRect[$x][0] = Random(100, 400, 1)
$aRect[$x][1] = Random(100, 400, 1)
$aRect[$x][2] = Random(20, 90, 1)
$aRect[$x][3] = Random(20, 90, 1)While 1
[/autoit] [autoit][/autoit] [autoit];Prüfen ob sich Rechtecke nicht berühren
[/autoit] [autoit][/autoit] [autoit]
For $i = 0 To $iRectAnz - 1
If $i = $x Then ContinueLoopIf _RectCollision($aRect[$x][$ARRAY_X], $aRect[$x][$ARRAY_Y], $aRect[$x][$ARRAY_Width], $aRect[$x][$ARRAY_Width], $aRect[$i][0], $aRect[$i][1], $aRect[$i][2], $aRect[$i][3]) Then
[/autoit] [autoit][/autoit] [autoit]
$aRect[$x][0] = Random(100, 400, 1)
$aRect[$x][1] = Random(100, 400, 1)
$aRect[$x][2] = Random(20, 90, 1)
$aRect[$x][3] = Random(20, 90, 1)
ContinueLoop 2
EndIf
Next
ExitLoop
WEnd
Next#cs
[/autoit] [autoit][/autoit] [autoit]
$aPunkte[0][$ARRAY_X] = 0
$aPunkte[0][$ARRAY_Y] = 125
$aPunkte[0][$ARRAY_StepX] = 10;Random(5, 15, 1)
$aPunkte[0][$ARRAY_StepY] = 0;Random(5, 15, 1)
$aPunkte[0][$ARRAY_NextStepColl] = 0$aPunkte[1][$ARRAY_X] = 125
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPunkte[1][$ARRAY_Y] = 0
$aPunkte[1][$ARRAY_StepX] = 0;Random(5, 15, 1)
$aPunkte[1][$ARRAY_StepY] = 10;Random(5, 15, 1)
$aPunkte[1][$ARRAY_NextStepColl] = 0$aPunkte[2][$ARRAY_X] = 300
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPunkte[2][$ARRAY_Y] = 101
$aPunkte[2][$ARRAY_StepX] = 10;Random(5, 15, 1)
$aPunkte[2][$ARRAY_StepY] = 0;Random(5, 15, 1)
$aPunkte[2][$ARRAY_NextStepColl] = 0$aPunkte[3][$ARRAY_X] = 101
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPunkte[3][$ARRAY_Y] = 300
$aPunkte[3][$ARRAY_StepX] = 0;Random(5, 15, 1)
$aPunkte[3][$ARRAY_StepY] = 10;Random(5, 15, 1)
$aPunkte[3][$ARRAY_NextStepColl] = 0$aRect[0][$ARRAY_X] = 100
[/autoit] [autoit][/autoit] [autoit]
$aRect[0][$ARRAY_Y] = 100
$aRect[0][$ARRAY_Width] = 50
$aRect[0][$ARRAY_Height] = 50$aRect[1][$ARRAY_X] = 150
[/autoit] [autoit][/autoit] [autoit]
$aRect[1][$ARRAY_Y] = 100
$aRect[1][$ARRAY_Width] = 50
$aRect[1][$ARRAY_Height] = 50
$aRect[2][$ARRAY_X] = 200
$aRect[2][$ARRAY_Y] = 100
$aRect[2][$ARRAY_Width] = 50
$aRect[2][$ARRAY_Height] = 50
$aRect[3][$ARRAY_X] = 125
$aRect[3][$ARRAY_Y] = 150
$aRect[3][$ARRAY_Width] = 50
$aRect[3][$ARRAY_Height] = 50
$aRect[4][$ARRAY_X] = 175
$aRect[4][$ARRAY_Y] = 150
$aRect[4][$ARRAY_Width] = 50
$aRect[4][$ARRAY_Height] = 50
#ce$hBrushPunkte = _GDIPlus_BrushCreateSolid(0xFF22b14c)
[/autoit] [autoit][/autoit] [autoit]
While Sleep(20)
_GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF);Punkte Zeichnen
[/autoit] [autoit][/autoit] [autoit]
For $x = 0 To $iPunkteAnz - 1
_GDIPlus_GraphicsFillRect($hGraphics, $aPunkte[$x][$ARRAY_X] + $iBall / 2, $aPunkte[$x][$ARRAY_Y] + $iBall / 2, $iBall, $iBall, $hBrushPunkte)
Next;Rect's zeichnen
[/autoit] [autoit][/autoit] [autoit]
For $x = 0 To $iRectAnz - 1
_GDIPlus_GraphicsDrawRect($hGraphics, $aRect[$x][0], $aRect[$x][1], $aRect[$x][2], $aRect[$x][3])
NextFor $x = 0 To $iPunkteAnz - 1
[/autoit] [autoit][/autoit] [autoit]
;Seitenwände
If $aPunkte[$x][$ARRAY_X] > 500 Then $aPunkte[$x][$ARRAY_StepX] *= -1 ;Rechts
If $aPunkte[$x][$ARRAY_Y] > 500 Then $aPunkte[$x][$ARRAY_StepY] *= -1 ;Unten
If $aPunkte[$x][$ARRAY_X] < 0 Then $aPunkte[$x][$ARRAY_StepX] *= -1 ;Links
If $aPunkte[$x][$ARRAY_Y] < 0 Then $aPunkte[$x][$ARRAY_StepY] *= -1 ;ObenSwitch $aPunkte[$x][$ARRAY_NextStepColl]
[/autoit] [autoit][/autoit] [autoit]
Case True
Switch $aPunkte[$x][$ARRAY_NextStepColl]
Case 1 ;oben, unten
$aPunkte[$x][$ARRAY_StepY] *= -1
Case 2 ;rechts, links
$aPunkte[$x][$ARRAY_StepX] *= -1
Case 3 ;beide Achsen umkehren
$aPunkte[$x][$ARRAY_StepX] *= -1
$aPunkte[$x][$ARRAY_StepY] *= -1
EndSwitch
$aPunkte[$x][$ARRAY_NextStepColl] = 0
$aPunkte[$x][$ARRAY_StepX] = Int($aPunkte[$x][$ARRAY_StepX])
$aPunkte[$x][$ARRAY_StepY] = Int($aPunkte[$x][$ARRAY_StepY])
Case False
If $aPunkte[$x][$ARRAY_StepX] = 0 Then $aPunkte[$x][$ARRAY_StepX] = 0.0000001
If $aPunkte[$x][$ARRAY_StepY] = 0 Then $aPunkte[$x][$ARRAY_StepY] = 0.0000001;ein schritt weitersetzen
[/autoit] [autoit][/autoit] [autoit]
$aPunkte[$x][$ARRAY_X] += $aPunkte[$x][$ARRAY_StepX]
$aPunkte[$x][$ARRAY_Y] += $aPunkte[$x][$ARRAY_StepY]$iTempX = $aPunkte[$x][$ARRAY_X] + $aPunkte[$x][$ARRAY_StepX]
[/autoit] [autoit][/autoit] [autoit]
$iTempY = $aPunkte[$x][$ARRAY_Y] + $aPunkte[$x][$ARRAY_StepY]$m = 0
[/autoit] [autoit][/autoit] [autoit]
;Steigung errechnen
If $iTempX - $aPunkte[$x][$ARRAY_X] <> 0 Then
$m = ($iTempY - $aPunkte[$x][$ARRAY_Y]) / ($iTempX - $aPunkte[$x][$ARRAY_X])
$b = $aPunkte[$x][$ARRAY_Y] - $m * $aPunkte[$x][$ARRAY_X]
Else
$m = 0
EndIf;~ ConsoleWrite("m=" & $m & @CRLF)
[/autoit] [autoit][/autoit] [autoit];Testen ob der Punkt ein Quadrat berühren wird im nächsten step
[/autoit] [autoit][/autoit] [autoit]
For $i = 0 To $iRectAnz - 1
If Not _RectCollision($iTempX, $iTempY, 1, 1, $aRect[$i][$ARRAY_X], $aRect[$i][$ARRAY_Y], $aRect[$i][$ARRAY_Width], $aRect[$i][$ARRAY_Height]) Then ContinueLoop
;Ermitteln woher der Ball kommt
#cs
.__2__
| |
1 3
|__4__|
#ce
$ForStep = 1
If $aPunkte[$x][$ARRAY_StepX] < 0 Then $ForStep = -1;Bestimmen woher die Kugel kommt
[/autoit] [autoit][/autoit] [autoit]
For $f = $aPunkte[$x][$ARRAY_X] To $aPunkte[$x][$ARRAY_X] + $aPunkte[$x][$ARRAY_StepX] Step $ForStep
$y = $m * $f + $b;Ecke
[/autoit] [autoit][/autoit] [autoit]
If $f = $aRect[$i][$ARRAY_X] And $y = $aRect[$i][$ARRAY_Y] Then ;oben links
ConsoleWrite("Ecke: oben links" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 3
ExitLoop 2
EndIfIf $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y = $aRect[$i][$ARRAY_Y] Then ;oben rechts
[/autoit] [autoit][/autoit] [autoit]
ConsoleWrite("Ecke: oben rechts" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 3
ExitLoop 2
EndIfIf $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ;unten rechts
[/autoit] [autoit][/autoit] [autoit]
ConsoleWrite("Ecke: unten rechts" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 3
ExitLoop 2
EndIfIf $f = $aRect[$i][$ARRAY_X] And $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ;unten links
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
ConsoleWrite("Ecke: untenlinks" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 3
ExitLoop 2
EndIf;Seiten
[/autoit] [autoit][/autoit] [autoit]
If $y = $aRect[$i][$ARRAY_Y] And $f >= $aRect[$i][$ARRAY_X] And $f <= $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] Then ; oben
ConsoleWrite("oben" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 1
ExitLoop 2
EndIf
If $y = $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] And $f >= $aRect[$i][$ARRAY_X] And $f <= $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] Then ;unten
ConsoleWrite("unten" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 1
ExitLoop 2
EndIf
If $f = $aRect[$i][$ARRAY_X] And $y >= $aRect[$i][$ARRAY_Y] And $y <= $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ; links
ConsoleWrite("links" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 2
ExitLoop 2
EndIf
If $f = $aRect[$i][$ARRAY_X] + $aRect[$i][$ARRAY_Width] And $y >= $aRect[$i][$ARRAY_Y] And $y <= $aRect[$i][$ARRAY_Y] + $aRect[$i][$ARRAY_Height] Then ; rechts
ConsoleWrite("rechts" & @CRLF)
$aPunkte[$x][$ARRAY_NextStepColl] = 2
ExitLoop 2
EndIf
Next
Next
EndSwitch
Next
_WinAPI_BitBlt($hGUIDC, 0, 0, 500, 500, $hDCBackpuffer, 0, 0, $SRCCOPY)
WEndWhile GUIGetMsg() <> -3
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _RectCollision($iX1, $iY1, $iWidth1, $iHeight1, $iX2, $iY2, $iWidth2, $iHeight2)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;Author: Faweyr
Return $iX1 + $iWidth1 > $iX2 And $iX1 < $iX2 + $iWidth2 And $iY1 + $iHeight1 > $iY2 And $iY1 < $iY2 + $iHeight2
EndFunc ;==>_RectCollisionFunc _Exit()
[/autoit]
_GDIPlus_GraphicsDispose($hGraphics)
_WinAPI_DeleteObject($hBitmapBackpuffer)
_WinAPI_DeleteDC($hDCBackpuffer)
_WinAPI_ReleaseDC($hGUI, $hGUIDC)
_GDIPlus_BrushDispose($hBrushPunkte)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit -
Hi,
ich hab hier was feines im Englischen Forum gefunden (Link) -
Hi,
ich hab hier noch eine schnelle Assembler Lösung. (Quick & Dirty ^^)Farbe Transparent machen
[autoit]#AutoIt3Wrapper_UseX64=n
[/autoit] [autoit][/autoit] [autoit]
#include <GDIPlus.au3>
#include <include/AssembleIt.au3>;~ $sFile = FileOpenDialog("", @ScriptDir, "Bild Dateien (*.*)")
[/autoit] [autoit][/autoit] [autoit]
If @error Then Exit
$sFile = @ScriptDir & "\TestBild.bmp"_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$hBitmap = _GDIPlus_BitmapCreateFromFile($sFile) ;Hier bitte pfad anpassen <<<<<<<<<<<<<
$iWidth = _GDIPlus_ImageGetWidth($hBitmap)
$iHeight = _GDIPlus_ImageGetHeight($hBitmap)ColorIgno($hBitmap,$iWidth,$iHeight,0xFFFF0000)
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("", $iWidth, $iHeight)
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW)$hGr = _GDIPlus_GraphicsCreateFromHWND($hGUI)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While GUIGetMsg() <> -3
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawImage($hGr, $hBitmap, 0, 0)
WEndFunc ColorIgno($hBitmap, $iWidth, $iHeight, $iSearchColor, $iReplaceColor = 0x00000000)
[/autoit] [autoit][/autoit] [autoit]
Local Static $tCodeBuffer = DllStructCreate("byte[30]") ;reserve Memory for opcodes
DllStructSetData($tCodeBuffer, 1, "0x8B7424048B4C24088B5C240C8B542410391E740683C604E2F7C38916EBF6") ;write opcodes into memory$tBitmap = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB)
[/autoit] [autoit][/autoit] [autoit]
If @error Then Return SetError(1, @error, -1)
$pBitmap = DllStructGetData($tBitmap, "Scan0")DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth * $iHeight, "int", $iSearchColor, "int", $iReplaceColor)
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_BitmapUnlockBits($hBitmap, $tBitmap)
If @error Then Return SetError(2, @error, -1)
Return True
EndFunc ;==>ColorIgno#cs
[/autoit] [autoit][/autoit] [autoit]
Func _ColorIgno()
_("use32")
_("mov esi,dword[esp+4]")
_("mov ecx,dword[esp+8]")
_("mov ebx,dword[esp+12]")
_("mov edx,dword[esp+16]")_("_mainloop:")
[/autoit] [autoit][/autoit] [autoit]_("cmp dword[esi],ebx")
[/autoit] [autoit][/autoit] [autoit]
_("je ignopx")_("weiter:")
[/autoit] [autoit][/autoit] [autoit]_("add esi,4")
[/autoit] [autoit][/autoit] [autoit]
_("loop _mainloop")_("ret")
[/autoit] [autoit][/autoit] [autoit]_("ignopx:")
[/autoit]
_("mov dword[esi],edx")
_("jmp weiter")
EndFunc ;==>_ColorIgno
_AssembleIt("int", "_ColorIgno", "ptr", $pBitmap, "int", $iWidth * $iHeight, 0xFF000000, 0x00000000)
#ceFarbkanal Ignorieren
[autoit]#AutoIt3Wrapper_UseX64=n
[/autoit] [autoit][/autoit] [autoit]
#include <GDIPlus.au3>
;~ #include <include/AssembleIt.au3>$sFile = FileOpenDialog("", @ScriptDir, "Bild Dateien (*.*)")
[/autoit] [autoit][/autoit] [autoit]
If @error Then Exit_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]
$hBitmap = _GDIPlus_BitmapCreateFromFile($sFile) ;Hier bitte pfad anpassen <<<<<<<<<<<<<
$iWidth = _GDIPlus_ImageGetWidth($hBitmap)
$iHeight = _GDIPlus_ImageGetHeight($hBitmap);Locken und Pointer hohlen
[/autoit] [autoit][/autoit] [autoit]
$tBitmap = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB)
$pBitmap = DllStructGetData($tBitmap, "Scan0");0xFF00FFFF = Rot wird gekillt
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;0xFFFF00FF = Grün wird gekillt
;0xFFFFFF00 = Blau wird gekillt
;Wo FF steht bleibt der Farbkanal bestehen 00 löscht ihn (setzt ihn auf 0)Global $tCodeBuffer = DllStructCreate("byte[20]") ;reserve Memory for opcodes
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tCodeBuffer, 1, "0x8B7424048B4C24088B5C240C211E83C604E2F9C3") ;write opcodes into memory
$ret = DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth * $iHeight, "int", 0xFF00FFFF, "int", 0)_GDIPlus_BitmapUnlockBits($hBitmap, $tBitmap)
[/autoit] [autoit][/autoit] [autoit]
$hGUI = GUICreate("", $iWidth, $iHeight)
GUISetState(@SW_SHOW)$hGr = _GDIPlus_GraphicsCreateFromHWND($hGUI)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While GUIGetMsg() <> -3
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawImage($hGr, $hBitmap, 0, 0)
WEnd#cs
[/autoit] [autoit][/autoit] [autoit]
Func _ColorIgno()
_("use32")
_("mov esi,dword[esp+4]")
_("mov ecx,dword[esp+8]")
_("mov ebx,dword[esp+12]")_("_mainloop:")
[/autoit]
_("and dword[esi],ebx")
_("add esi,4")
_("loop _mainloop")
_("ret")
EndFunc ;==>_ColorIgno
#ce -
Hi,
[autoit]
du kannst Objekte genau wie in JavaScript auch in AutoIt benutzen.
Ist in dieser Zeile HandleStateChange eine Constante oder ist damit die Funktion gemeint ?$xmldoc = ""
[/autoit][autoit][/autoit][autoit]$oxmlHTTP = ObjCreate("Msxml2.XMLHTTP.6.0")
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
$oxmlHTTP.Open("POST", "http://myserver/orders/processorder.asp", False)
$oxmlHTTP.onreadystatechange = HandleStateChange()
$oxmlHTTP.Send($xmldoc)Func HandleStateChange()
[/autoit]
If $oxmlHTTP.readyState = 4 Then MsgBox(0, "", $oxmlHTTP.responseXML.xml)
EndFunc ;==>HandleStateChange -
Hehehe B-Day³ Alles Guuuuuteee

-
Hi,
das selbe Problem habe ich auch nur mit FileZilla. Das dauert auch ewigkeiten bis das läd :wacko: -
Mysql5-Verschlüsselung
[autoit]
Das ist aber ein Hash generator. Sowas gibt es in der Crypt.au3#include <Crypt.au3>
[/autoit][autoit][/autoit][autoit]$sString = Random()
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
_Crypt_Startup()ConsoleWrite("MD2:" & _Crypt_HashData($sString,$CALG_MD2) & @CRLF)
[/autoit]
ConsoleWrite("MD4:" & _Crypt_HashData($sString,$CALG_MD4) & @CRLF)
ConsoleWrite("MD5:" & _Crypt_HashData($sString,$CALG_MD5) & @CRLF)
ConsoleWrite("SHA1:" & _Crypt_HashData($sString,$CALG_SHA1) & @CRLF)
_crypt_shutdown()Im Anhang sind noch weitere Hash Algorythmen. Quelle: (Link)
-
€: Kann man auch direkt ein Run in den Return Wert schreiben?
Ja klar. Das Run wird ausgeführt und der Rückgabewert von Run wird von Return wiederrum zurückgegeben. -
Hii,
erst mal großes Lob an Andy
der Debugger ist jetzt schon in diesem frühen Beta Stadium richtig Sahne
.
Ich persönlich finde das die GUI eigentlich ganz i.o. ist. Es soll ja ein Debugger sein und kein Kanidat für Germany's Next Topmodel
-
Hi,
ich hatte mal sowas gemacht: -
Hi,
hmm Ja bei mir auch. Keine Ahnung woran das liegt
-
Hi,
ich hab dir mal schnell was gebastelt.Spoiler anzeigen
[autoit]Func StringTrimAfter($sString, $iCount)
[/autoit]
Local $iSplit = 0, $aArray[1]
$iCount = Int($iCount)
If $iCount <= 0 Then Return -1
If $iCount >= StringLen($sString) Then
$aArray[0] = $sString
Return $aArray
EndIf
Do
$aArray[$iSplit] = StringLeft($sString, $iCount)
$sString = StringTrimLeft($sString, $iCount)
$iSplit += 1
ReDim $aArray[$iSplit + 1]
Until StringLen($sString) = 0
ReDim $aArray[$iSplit]
Return $aArray
EndFunc ;==>StringTrimAfter -
Hi,
so erstmal sry für den Doppelpost
, aber ich habs endlich hinbekommen das das Bild so aussieht wie das aus dem Startpost.
für 600x600 braucht mein Assembler Code, bei mir, rund 4ms.So ohne langes gerede. Hier ist der Code:
Spoiler anzeigen
[autoit]#AutoIt3Wrapper_UseX64=n
[/autoit] [autoit][/autoit] [autoit]
;~ #include "include/AssembleIt.au3"
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global $pBitmap, $hBitmap
Global $iWidth = 600
Global $iHeight = 600$hGUI = GUICreate("", $iWidth, $iHeight)
[/autoit] [autoit][/autoit] [autoit]
$hDC_Bitmap = _CreateNewBmp32($iWidth, $iHeight, $pBitmap, $hBitmap)$tCodeBuffer = DllStructCreate("byte[107]") ;reserve Memory for opcodes
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tCodeBuffer, 1, "0x8B7C24048B5C24088B54240C89D0F7E35053BB04000000F7E301C75B5989C831D2F7F35389D3F7E3BBFE080000F7E35B83C0245053C1E818BB02000000F7F383FA00751E5B5888C2B6FFC1E21088E6C1C80888E2891783EF0483E90183F90175BCC35B58BA000000FFEBE9") ;write opcodes into memory
$Timer = TimerInit()
$ret = DllCall("user32.dll", "int", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "ptr", $pBitmap, "int", $iWidth, "int", $iHeight, "int", 0)
$sTime = TimerDiff($Timer)
$hDC_GUI = _WinAPI_GetDC($hGUI)
WinSetTitle($hGUI, "", "Etwas fürs Auge | Benötigte Zeit: " & Round($sTime, 1) & "ms |by Blume (Assembler Tune by Sprenger120)")
GUISetState(@SW_SHOW)While GUIGetMsg() <> -3
[/autoit] [autoit][/autoit] [autoit]
_WinAPI_BitBlt($hDC_GUI, 0, 0, $iWidth, $iHeight, $hDC_Bitmap, 0, 0, $SRCCOPY)
WEnd_WinAPI_ReleaseDC($hGUI, $hDC_GUI)
[/autoit] [autoit][/autoit] [autoit]
_WinAPI_DeleteDC($hDC_Bitmap)
_WinAPI_DeleteObject($hBitmap)
$pBitmap = 0
$tCodeBuffer = 0Func _CreateNewBmp32($iWidth, $iHeight, ByRef $ptr, ByRef $hbmp) ;erstellt leere 32-bit-Bitmap; Rückgabe $HDC und $ptr und handle auf die Bitmapdaten
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$hcdc = _WinAPI_CreateCompatibleDC(0) ;Desktop-Kompatiblen DeviceContext erstellen lassen
$tBMI = DllStructCreate($tagBITMAPINFO) ;Struktur der Bitmapinfo erstellen und Daten eintragen
DllStructSetData($tBMI, "Size", DllStructGetSize($tBMI) - 4);Structgröße abzüglich der Daten für die Palette
DllStructSetData($tBMI, "Width", $iWidth)
DllStructSetData($tBMI, "Height", -$iHeight) ;minus =standard = bottomup
DllStructSetData($tBMI, "Planes", 1)
DllStructSetData($tBMI, "BitCount", 32) ;32 Bit = 4 Bytes => AABBGGRR
$adib = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBMI), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'uint', 0)
$hbmp = $adib[0] ;hbitmap handle auf die Bitmap, auch per GDI+ zu verwenden
$ptr = $adib[4] ;pointer auf den Anfang der Bitmapdaten, vom Assembler verwendet
;_arraydisplay($adib)
_WinAPI_SelectObject($hcdc, $hbmp) ;objekt hbitmap in DC
Return $hcdc ;DC der Bitmap zurückgeben
EndFunc ;==>_CreateNewBmp32#cs
[/autoit] [autoit][/autoit] [autoit]
Func Etwas_Fuers_Auge()
_("use32")
;~ _("org " & Fasmgetbaseptr($FASM))
_("mov edi,dword[esp+4]")
_("mov ebx,dword[esp+8]") ;Breite
_("mov edx,dword[esp+12]") ;Höhe_("mov eax,edx") ;Pixelanzahl berechnen
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_("mul ebx")_("push eax")
[/autoit] [autoit][/autoit] [autoit]
_("push ebx")_("mov ebx,4")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_("mul ebx")
_("add edi,eax")
_("pop ebx")
_("pop ecx")_("_mainLoop:")
[/autoit] [autoit][/autoit] [autoit]_("mov eax,ecx")
[/autoit] [autoit][/autoit] [autoit]
_("xor edx,edx")
_("div ebx");EDX = Mod(ecx,Breite)
[/autoit] [autoit][/autoit] [autoit]
;EAX = ecx / Breite_("push ebx");Breite sichern
[/autoit] [autoit][/autoit] [autoit]
_("mov ebx,edx");Breite in ebx schreiben
_("mul ebx") ; ecx/Breite * Mod (ecx,Breite)
_("mov ebx,2302")
_("mul ebx")
_("pop ebx") ;ebx wiederherstellen_("add eax,36") ; (36 = Pi²)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]_("push eax")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_("push ebx")_("shr eax,24") ; 16 Bit nach links schieben | AARRBBGG -> 0000AARR
[/autoit] [autoit][/autoit] [autoit]
_("mov ebx,2")
_("div ebx")_("cmp edx,0") ; Prüfen ob ungleich
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_("jne schwarz") ;wenn ja pixel schwärzen_("pop ebx")
[/autoit] [autoit][/autoit] [autoit]
_("pop eax");RGB zu BGR umrechnen
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_("mov dl,al"); Blau in das low von EDX
_("mov dh,0xFF");Alpha FF setzen
_("shl edx,16");16 bit nach links schieben 000000BB -> 00BB0000
_("mov dh,ah") ;Grün
_("ror eax,8")
_("mov dl,ah");Rot_("_schreibe:")
[/autoit] [autoit][/autoit] [autoit]_("mov dword[edi],edx")
[/autoit] [autoit][/autoit] [autoit]
_("sub edi,4")_("sub ecx,1")
[/autoit] [autoit][/autoit] [autoit]
_("cmp ecx,1")
_("jne _mainLoop")_("ret")
[/autoit] [autoit][/autoit] [autoit]_("schwarz:")
[/autoit] [autoit][/autoit] [autoit]
_("pop ebx")
_("pop eax")
_("mov edx,0xFF000000")
_("jmp _schreibe")
EndFunc ;==>Etwas_Fuers_Auge$_ASSEMBLEIT_FLAG = 0
[/autoit]
_AssembleIt("int", "Etwas_Fuers_Auge", "ptr", $pBitmap, "int", $iWidth, "int", $iHeight)
#ce