Ich glaub das Problem liegt daran wie du deine zufallszahl für deine Farbe auswählst denn die "0xFFFFFFFF" sind nur hexadezimalzahlen Werte (0x => Hexadezimal). Im Dezimalen würden sie so aussehen 255x255x255x255.
hir mit Knast du jeden Farbwert zufällig erzeugen lassen.
[autoit]Random(0,255*255*255*255)
Random(0,0xFFFFFFFF)
da her kann man sich dass hier sparen:
Spoiler anzeigen
$5 = random(1,6,1)
$6 = random(1,6,1)
$7 = random(1,6,1)
$8 = random(1,255,1)
$9 = random(1,255,1)
$10 = random(1,255,1)
$string = ""
$counter = 0
do
$5 = ""
$5 = random(1,6,1)
$counter = $counter +1
if $5 = 1 then
$string1 = "AA"
EndIf
if $5 = 2 then
$string1 = "BB"
EndIf
if $5 = 3 then
$string1 = "CC"
EndIf
if $5 = 4 then
$string1 = "DD"
EndIf
if $5 = 5 then
$string1 = "EE"
EndIf
if $5 = 6 then
$string1 = "FF"
EndIf
_ArrayAdd($array1,$string1)
[/autoit] [autoit][/autoit] [autoit]$string2 = $string1 & $string1
;MsgBox(0,"",$5 & " string:" & $string2)
Until $counter = 3
;$key = $array1[$
;_ArrayDisplay($array1, "daks")
$key = "0x" & $array1[0] & $8 & $array1[1] & $9 & $array1[2] & $10
;$key = ClipGet()
;MsgBox(0,"",$key)
_ArrayDelete($array1, 0)
_ArrayDelete($array1, 1)
_ArrayDelete($array1, 2)
_ArrayDelete($array1, 3)
_ArrayDelete($array1, 4)
_ArrayDelete($array1, 5)
_ArrayDelete($array1, 6)
_ArrayDelete($array1, 7)
_ArrayDelete($array1,
Ach ja und bei GDI+ must du so ziemlich bei allem was du auf machst später wider schließen.
Dann würde dann würde das Skript etwas so aussehen:
Spoiler anzeigen
#include <GUIConstants.au3>
#include <GDIPlus.au3>
$gui = GUICreate("gdiplus", 300,300) ;Erstellt ein GUI
GUISetState(@SW_SHOW) ; Macht das GUI sichtbar
_GDIPlus_Startup() ; Startet GDI+
$grafik = _GDIPlus_GraphicsCreateFromHWND($gui) ;Öffnet eine Grafik
$Pen = _GDIPlus_PenCreate(0xFF000000,1) ;Öffnet einen Pen
While 1
$1 = Random(0,300,1)
$2 = Random(0,300,1)
$3 = Random(0,300,1)
$4 = Random(0,300,1)
$Pen_Color = Random(0,255*255*255*255) ;Zufalls Farbe
$Pen_Width = Random(1,10) ;Zufalls Größe
_GDIPlus_PenSetColor($Pen,$Pen_Color) ;Gibt dem Pen eine neue Farbe
_GDIPlus_PenSetWidth($Pen,$Pen_Width) ;Gibt dem Pen Eine neue Größe
_GDIPlus_GraphicsDrawLine($grafik,$1,$2,$3,$4,$Pen)
Sleep(50)
If Guigetmsg() = $GUI_EVENT_CLOSE Then ; Abfrage ob das GUI einen schließ Befehl kommt
_GDIPlus_GraphicsDispose($grafik) ; Schließt die Grafik
_GDIPlus_PenDispose($Pen) ; Schließt den Pen
_GDIPlus_Shutdown() ; Beendet GDI+
Exit ; Beendet das Skript
EndIf
Wend