Müsst ihr reden.
Ihr spammt alles voll und dann meint ihr, EM ist ein Spamer?
Es gibt so komische Leute mit ihren Vorstellungen. ![]()
Beiträge von Nestos
-
-
Ersetz Zeile 21 mal so:
[autoit]$hWnd = GUICreate("Particles", $iGUIWidth, $iGUIHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit]Ansonsten ist sie nicht im Vordergrund, und füllt nicht die ganze Fläche aus.

-
Und was ist mit mir?
Ich bin auch nicht viel älter und hab die OwnStyle UDF geschrieben.*Werbung mach*
-
Ich schreib dir mal die Münzen in GDI+.

Edit: Gesagt, getahn:
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <Misc.au3>Global $hWnd, $hGraphic, $hBitmap, $backbuffer
[/autoit] [autoit][/autoit] [autoit]
Global $ScreenDc, $dc, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend, $tPoint, $pPoint, $gdibitmap
Global $hFormat, $hFamily, $hFont, $tLayout, $aInfo
Global $brush1, $brush2, $brush3
Global $title = "GDI+ Münze", _
$user32 = DllOpen("user32.dll"), _
$width = 25, _
$height = 25
Global $MousePos_Startup()
[/autoit] [autoit][/autoit] [autoit]
_Draw()
_Update()While 1
[/autoit] [autoit][/autoit] [autoit]
$MousePos = MouseGetPos()
WinMove($title, "", $MousePos[0], $MousePos[1])
If _IsPressed("1B", $user32) And _IsPressed("A2", $user32) Then _Close()
Sleep(10)
WEndFunc _Draw()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsFillEllipse($backbuffer, 0, 0, 24, 24, $brush2)
_GDIPlus_GraphicsFillEllipse($backbuffer, 1, 1, 21, 21, $brush1)
_GDIPlus_GraphicsDrawStringEx($backbuffer, "$", $hFont, $aInfo[0], $hFormat, $brush3)
_GDIPlus_BrushDispose($brush1)
_GDIPlus_BrushDispose($brush2)
_GDIPlus_BrushDispose($brush3)
EndFuncFunc _Update()
[/autoit] [autoit][/autoit] [autoit]
$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_WinAPI_SelectObject($dc, $gdibitmap)
_WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
_WinAPI_DeleteObject($gdibitmap)
EndFuncFunc _StartUp()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Startup()
$hWnd = GUICreate($title, $width, $height, -1, -1, 0x80000000, BitOR(0x00000080, 0x00080000, 0x00000008))
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)$hFormat = _GDIPlus_StringFormatCreate(0x1000)
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_StringFormatSetAlign($hFormat, 1)
$hFamily = _GDIPlus_FontFamilyCreate("Book Antiqua")
$hFont = _GDIPlus_FontCreate($hFamily, 22, 1, 2)
$tLayout = _GDIPlus_RectFCreate(1, -1, 25, 25)
$aInfo = _GDIPlus_GraphicsMeasureString($backbuffer, "$", $hFont, $tLayout, $hFormat)$brush1 = _GDIPlus_BrushCreateLinear(0, 0, 24, 24, 0xFFCE9900, 0xFFF8D114)
[/autoit] [autoit][/autoit] [autoit]
$brush2 = _GDIPlus_BrushCreateLinear(0, 0, 24, 24, 0xFFF8D114, 0xFFCE9900)
$brush3 = _GDIPlus_BrushCreateLinear(0, 0, 24, 24, 0xAFFFFFFF, 0x40FFFFFF)$ScreenDc = _WinAPI_GetDC($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)$tSize = DllStructCreate($tagSIZE)
[/autoit] [autoit][/autoit] [autoit]
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $width)
DllStructSetData($tSize, "Y", $height)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
$tPoint = DllStructCreate($tagPOINT)
$pPoint = DllStructGetPtr($tPoint)
DllStructSetData($tPoint, "X", 0)
DllStructSetData($tPoint, "Y", 0)_GDIPlus_GraphicsClear($backbuffer, 0x00000000)
[/autoit] [autoit][/autoit] [autoit]
GUISetState()
EndFuncFunc _GDIClose()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDispose($backbuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFuncFunc _Close()
[/autoit] [autoit][/autoit] [autoit]
DllClose($user32)
GUISetState(@SW_MINIMIZE, $hWnd)
Exit
EndFuncFunc _GDIPlus_BrushCreateLinear($iX1, $iY1, $iX2, $iY2, $iARGB1 = 0xFF000000, $iARGB2 = 0xFFFFFFFF)
[/autoit] [autoit][/autoit] [autoit]
Local $aResult, $start, $end, $sPoint, $ePoint$start = DllStructCreate("int X;int Y")
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($start, "X", $iX1)
DllStructSetData($start, "Y", $iY1)
$sPoint = DllStructGetPtr($start)$end = DllStructCreate("int X;int Y")
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($end, "X", $iX2)
DllStructSetData($end, "Y", $iY2)
$ePoint = DllStructGetPtr($end)$aResult = DllCall($ghGDIPDll, "int", "GdipCreateLineBrushI", "ptr", $sPoint, "ptr", $ePoint, "int", $iARGB1, "int", $iARGB2, "int", 0, "int*", 0)
[/autoit] [autoit][/autoit] [autoit]
If @error Then Return SetError(@error, @extended, 0)Return SetError(0, $aResult[0], $aResult[6])
[/autoit]
EndFunc ;==>_GDIPlus_BrushCreateLinear -
Ich versteh nicht, warum du so viele Bilder machst.

Man könnte das locker mit GDI+ machen.

-
Ich hätte dich in Skype schon geaddet, bekomm aber keine Antwort.

Hast ne PN.
-
Brauchst du meine Hilfe überhaupt noch?

-
Ich bin gerade dabei, dei HELP Funktion so umzuschreiben, damit man die Befehle so: FILE MOVE, FILE CREATE strukturieren kann.

-
Ich habe ein File Move schon eingebaut.

Und wie ich bereits gesagt habe, solltest du die File Befehle so anordnen:
File Move "test.txt" "test\"So ist es viel übersichtlicher, und du hast nicht soviele Befehle.

Edit: Und natürlich darfst du die Funktionen übernehmen, für was hab ich sie denn sonst gemacht?

-
Dann hättest du ein anderes Beispiel nehmen sollen.
Nun ich bin mal nicht so:
[autoit]GUICtrlCreateCheckbox()
[/autoit]Ich glaube, dass ist was du suchst.

-
Hacks für Spiele werden hier nicht unterstüzt.
-
Das würde dann aber ausschauen, als ob man da raus gehen könnte.

Einfacher wärs abe gewesen, wenn du nur ein kleines Bild vom Baum genommen hättest, und damit dann einfach den Rand gezeichnet hättest. -
Gute Idee, gute Umsetzung.

Mir sind ein paar Sachen aufgefallen:
Man kann Diagonal gehen, hat aber keine Sprites dafür.
[autoit]
Wenn man über die Münzen geht, blinken die bereits eingesammelten wieder auf.
Du hast die Münzenanzahl mit Bilder gemacht, warum nicht einfach mit_GDIPlus_GraphicsDrawString()
[/autoit]
;oder
_GDIPlus_GraphicsDrawStringEx()?
-
[autoit]
WinClose( "title")
[/autoit]
Sleep(100)
Send("{LEFT}{ENTER}"Müsste seinen Zweck erfüllen.

-
Du musst den gesamten Pfad angeben
[autoit]
zB:Run("C:\Programme\sea_nulled_1.0.3.exe")
[/autoit]Für das andere beschäftig dich mal mit
[autoit]MouseClick()
[/autoit]Forenregeln - Nur mal vorsichtshalber
-
Ich würd die Befehle wie CREATE_FILE eher nur mit dem Befehl FILE machen und den ersten Parameter für CREATE oder MOVE verwenden.
Außerdem ist beim FileCreate keine richtige Error Abfrage.
Aber ansonsten zwei nette Funktionen.
Edit:
$WS_EX_Composited sorgt dafür, dass die GUI nicht flackert.
Edit2:
So hab die Konsole nochmal überarbeitet und eine neue Funktion CD hinzugefügt.Spoiler anzeigen
[autoit]#include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <File.au3>Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $Console, $CurCommand, $Read, $Commands[8], $CommandsDis[8], $Right, $CurCommandParameters, $CurCommandString, $CurPath = @ScriptDir
[/autoit] [autoit][/autoit] [autoit]
Global $dll = DllOpen("user32.dll")
Global $title = "Console"$Commands[0] = "HELP"
[/autoit] [autoit][/autoit] [autoit]
$Commands[1] = "EXIT"
$Commands[2] = "MSGBOX"
$Commands[3] = "CLEAR"
$Commands[4] = "COLOUR"
$Commands[5] = "HIDE"
$Commands[6] = "FILE"
$Commands[7] = "CD"$CommandsDis[0] = "Shows a List of all commands/E/tParameter 1 = Command (optional)"
[/autoit] [autoit][/autoit] [autoit]
$CommandsDis[1] = "Exit the console"
$CommandsDis[2] = "Shows a massage/E/tParameter 1 = Flag/E/tParameter 2 = Title (string)/E/tParameter 3 = Text (string)"
$CommandsDis[3] = "Clears the Console"
$CommandsDis[4] = "Changes the font and background colour/E/tParameter 1 = font colour (HEX)/E/tParameter 2 = background colour (HEX) (optional)"
$CommandsDis[5] = "Hides the Console until its activated again/E/tParameter 1 = Sleeptime in ms"
$CommandsDis[6] = "CREATE/tCreates a file or overwrites a existing File/E/t/tParameter 1 = Filepath (string)/E/tMOVE/tMoves a File/E/t/tParameter 1 = Filepath (string)/E/t/tParameter 2 = Movepath (string)"
$CommandsDis[7] = "Changes the directory/E/tParameter 1 = New directory"$Console = _ConsoleCreate($title)
[/autoit] [autoit][/autoit] [autoit]
_ConsoleWrite($Console, "Welcome/EThis is a Console example from http://www.AutoIt.de/E")While 1
[/autoit] [autoit][/autoit] [autoit]
If _IsPressed("0D", $dll) And WinActive($title) Then
$array = StringSplit(GUICtrlRead($Console[1]), @CRLF)
$CurCommand = $array[Ubound($array) - 1]
$CurCommandParameters = StringSplit($CurCommand, " ")
$CurCommandString = StringSplit($CurCommand, '"')
For $i = 1 To $array[0] - 1 Step 2
$Read &= $array[$i] & @CRLF
Next
GUICtrlSetData($Console[1], $Read & $CurPath & "> " & $CurCommand & @CRLF)
For $i = 0 To UBound($Commands) - 1
If $CurCommandParameters[1] = $Commands[$i] Then
Call("_ConsoleCommand_" & $Commands[$i])
$Right = True
ExitLoop
Else
$Right = False
EndIf
Next
If Not $Right Then
_ConsoleWrite($Console, "unknown Command/EType HELP to list all commands")
EndIf
While _IsPressed("0D", $dll) And WinActive($title)
Sleep(100)
WEnd
$Read = ""
EndIf
Sleep(30)
WEndFunc _ConsoleCommand_CD()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandString) > 3 Then
$CurPath = $CurCommandString[2]
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_FILE()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandParameters) < 2 Then _ConsoleWrite($Console, "Parameter Error")
If $CurCommandParameters[2] = "CREATE" Then
If UBound($CurCommandString) > 3 Then
If Not _FileCreate($CurPath & "\" & $CurCommandString[2]) Then _ConsoleWrite($Console, "Error")
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
ElseIf $CurCommandParameters[2] = "MOVE" Then
If UBound($CurCommandString) > 5 Then
FileMove($CurPath & "\" & $CurCommandString[2], $CurPath & "\" & $CurCommandString[4],
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_HIDE()
[/autoit] [autoit][/autoit] [autoit]
Local $timer
_WinSetSize($Console[0],660, 0, 10, 4)
GUISetState(@SW_MINIMIZE)
If UBound($CurCommandParameters) > 3 Then
$timer = TimerInit()
While 1
If TimerDiff($timer) > Number($CurCommandParameters[2]) Or WinActive($Title) Then ExitLoop
Sleep(20)
WEnd
ElseIf UBound($CurCommandParameters) = 2 Then
While 1
If WinActive($Title) Then ExitLoop
Sleep(20)
WEnd
EndIf
GUISetState(@SW_RESTORE)
_WinSetSize($Console[0], 660, 329, 10, 5)
EndFuncFunc _ConsoleCommand_COLOUR()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandParameters) = 3 Then
GUICtrlSetColor($Console[1], "0x" & $CurCommandParameters[2])
ElseIf UBound($CurCommandParameters) = 4 Then
GUICtrlSetColor($Console[1], "0x" & $CurCommandParameters[2])
GUICtrlSetBkColor($Console[1], "0x" & $CurCommandParameters[3])
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_CLEAR()
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetData($Console[1], "")
EndFuncFunc _ConsoleCommand_MSGBOX()
[/autoit] [autoit][/autoit] [autoit]
If Not UBound($CurCommandParameters) < 5 And UBound($CurCommandString) = 6 Then
MsgBox(Number($CurCommandParameters[2]), $CurCommandString[2], $CurCommandString[4])
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_EXIT()
[/autoit] [autoit][/autoit] [autoit]
_WinSetSize($Console[0], 660, 0, 10, 5)
Sleep(100)
Exit
EndFuncFunc _ConsoleCommand_HELP()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandParameters) = 2 Then
For $i = 0 To UBound($Commands) - 1
_ConsoleWrite($Console, $Commands[$i])
Next
_ConsoleWrite($Console, 'Type "help command" for more inforamtion')
ElseIf UBound($CurCommandParameters) = 3 Then
For $i = 0 To UBound($Commands) - 1
If $CurCommandParameters[2] = $Commands[$i] Then
_ConsoleWrite($Console, $Commands[$i] & "/t" & $CommandsDis[$i])
ExitLoop
EndIf
Next
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _SM_SetVisualStyle($b_Enable)
[/autoit] [autoit][/autoit] [autoit]
Return DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $b_Enable)
EndFuncFunc _ConsoleCreate($Title)
[/autoit] [autoit][/autoit] [autoit]
Local $Console[2]
_SM_SetVisualStyle(False)
$Console[0] = GUICreate($Title, 654, 0, -1, @DesktopHeight/2 - 164, Default, $WS_EX_Composited)
GUISetOnEvent(-3, "_ConsoleCommand_EXIT")
GUISetBkColor(0x000000)
$Console[1] = GUICtrlCreateEdit("", 0, 0, 657, 297, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL))
GUICtrlSetBkColor($Console[1], 0x000000)
GUICtrlSetColor($Console[1], 0xC0C0C0)
GUICtrlSetFont($Console[1], 10, Default, Default, "Lucida Console")
GUISetState(@SW_SHOW)
_WinSetSize($Console[0], 660, 329, 10, 5)
Return $Console
EndfuncFunc _ConsoleWrite($Console, $String)
[/autoit] [autoit][/autoit] [autoit]
Local $timer, $split
$String = StringReplace($String, "/E", @CRLF)
$String = StringReplace($String, "/t", @TAB)
$split = StringSplit($String, "")
$timer = TimerInit()
For $i = 1 To $split[0]
Sleep(20)
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & $split[$i])
Next
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & @CRLF)
EndFuncFunc _WinSetSize($hWnd, $iWidth, $iHeigth, $iSleep = -1,$iStep = 4);by Gta Spider
[/autoit]
If $iSleep < 0 Then Return WinMove($hWnd,"",Default,Default,$iWidth,$iHeigth)
Local $i, $iStepW = $iStep, $iStepH = $iStep,$iSin,$i2,$iLastI
Local $aWinPos = WinGetPos($hWnd)
If $iWidth < $aWinPos[2] Then $iStepW *= -1
If $iHeigth < $aWinPos[3] Then $iStepH *= -1
Local $iDegToRad = 3.14159265358979/180
Local $iSinMulW = ($iWidth - $aWinPos[2]) / 2.5
Local $iSinMulH = ($iHeigth - $aWinPos[3]) / 2.5
If $iSinMulW < 0 Then $iSinMulW *= -1
If $iSinMulH < 0 Then $iSinMulH *= -1
If $iWidth <> $aWinPos[2] Then
For $i = $aWinPos[2] To $iWidth Step $iStepW
$iLastI = $i
$iSin = $i - $aWinPos[2]
$iSin = Sin($iDegToRad * (180*$iSin/($iWidth - $aWinPos[2])))
WinMove($hWnd,"",Default,Default,$i + ($iSin * $iSinMulW),Default)
Sleep($iSleep)
Next
If Mod($iWidth - $aWinPos[2],$iStep) Then
If $iStepW < 0 Then
$iStepW = -1
Else
$iStepW = 1
EndIf
For $i = $iLastI -1 To $iWidth Step $iStepW
WinMove($hWnd,"",Default,Default,$i,Default)
Next
EndIf
EndIf
If $iHeigth <> $aWinPos[3] Then
For $i = $aWinPos[3] To $iHeigth Step $iStepH
$iLastI = $i
$iSin = $i - $aWinPos[3]
$iSin = Sin($iDegToRad*(180*$iSin/($iHeigth - $aWinPos[3])))
WinMove($hWnd,"",Default,Default,Default,$i + ($iSin * $iSinMulH))
Sleep($iSleep)
Next
If Mod($iHeigth - $aWinPos[3],$iStep) Then
If $iStepH < 0 Then
$iStepH = -1
Else
$iStepH = 1
EndIf
For $i = $iLastI -1 To $iHeigth Step $iStepH
WinMove($hWnd,"",Default,Default,Default,$i)
Next
EndIf
EndIf
EndFuncUnd ja, das Teil macht mich süchtig.

-
Einfach drüberinstallieren müsste gehen.

-
Ich hab mich mal ein bisschen damit gespielt und dein Script stark umgeschrieben.

Jetzt hat die Console ein paar Funktionen mit Beschreibungen.Sei mir nicht böse, aber ich hatte gerade Langeweile.

Kannst den ganzen Code übernehmen wenn du willst.
Console
[autoit]#include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $Console, $CurCommand, $Read, $Commands[5], $CommandsDis[5], $Right, $CurCommandParameters, $CurCommandString
[/autoit] [autoit][/autoit] [autoit]
Global $dll = DllOpen("user32.dll")
Global $title = "Console"$Commands[0] = "HELP"
[/autoit] [autoit][/autoit] [autoit]
$Commands[1] = "EXIT"
$Commands[2] = "MSGBOX"
$Commands[3] = "CLEAR"
$Commands[4] = "COLOUR"$CommandsDis[0] = "Shows a List of all commands/E/tParameter 1 = Command (optional)"
[/autoit] [autoit][/autoit] [autoit]
$CommandsDis[1] = "Exit the console"
$CommandsDis[2] = "Shows a massage/E/tParameter 1 = Flag/E/tParameter 2 = Title (string)/E/tParameter 3 = Text (string)"
$CommandsDis[3] = "Clears the Console"
$CommandsDis[4] = "Changes the font and background colour/E/tParameter 1 = font colour (HEX)/E/tParameter 2 = background colour (HEX) (optional)"$Console = _ConsoleCreate($title)
[/autoit] [autoit][/autoit] [autoit]
_ConsoleWrite($Console, "Welcome/EThis is a Console example from http://www.AutoIt.de/E")While 1
[/autoit] [autoit][/autoit] [autoit]
If _IsPressed("0D", $dll) And WinActive($title) Then
$array = StringSplit(GUICtrlRead($Console[1]), @CRLF)
$CurCommand = $array[Ubound($array) - 1]
$CurCommandParameters = StringSplit($CurCommand, " ")
$CurCommandString = StringSplit($CurCommand, '"')
For $i = 1 To $array[0] - 1 Step 2
$Read &= $array[$i] & @CRLF
Next
GUICtrlSetData($Console[1], $Read & "> " & $CurCommand & @CRLF)
For $i = 0 To UBound($Commands) - 1
If $CurCommandParameters[1] = $Commands[$i] Then
Call("_ConsoleCommand_" & $Commands[$i])
$Right = True
ExitLoop
Else
$Right = False
EndIf
Next
If Not $Right Then
_ConsoleWrite($Console, "unknown Command/EType HELP to list all commands")
EndIf
While _IsPressed("0D", $dll) And WinActive($title)
Sleep(100)
WEnd
$Read = ""
EndIf
Sleep(30)
WEndFunc _ConsoleCommand_COLOUR()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandParameters) = 3 Then
GUICtrlSetColor($Console[1], "0x" & $CurCommandParameters[2])
ElseIf UBound($CurCommandParameters) = 4 Then
GUICtrlSetColor($Console[1], "0x" & $CurCommandParameters[2])
GUICtrlSetBkColor($Console[1], "0x" & $CurCommandParameters[3])
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_CLEAR()
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetData($Console[1], "")
EndFuncFunc _ConsoleCommand_MSGBOX()
[/autoit] [autoit][/autoit] [autoit]
If Not UBound($CurCommandParameters) < 5 And UBound($CurCommandString) = 6 Then
MsgBox(Number($CurCommandParameters[2]), $CurCommandString[2], $CurCommandString[4])
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _ConsoleCommand_Exit()
[/autoit] [autoit][/autoit] [autoit]
_WinSetSize($Console[0], 660, 0, 10, 5)
Exit
EndFuncFunc _ConsoleCommand_HELP()
[/autoit] [autoit][/autoit] [autoit]
If UBound($CurCommandParameters) = 2 Then
For $i = 0 To UBound($Commands) - 1
_ConsoleWrite($Console, $Commands[$i])
Next
ElseIf UBound($CurCommandParameters) = 3 Then
For $i = 0 To UBound($Commands) - 1
If $CurCommandParameters[2] = $Commands[$i] Then
_ConsoleWrite($Console, $Commands[$i] & "/t" & $CommandsDis[$i])
ExitLoop
EndIf
Next
Else
_ConsoleWrite($Console, "Parameter Error")
EndIf
EndFuncFunc _SM_SetVisualStyle($b_Enable)
[/autoit] [autoit][/autoit] [autoit]
Return DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $b_Enable)
EndFuncFunc _ConsoleCreate($Title)
[/autoit] [autoit][/autoit] [autoit]
Local $Console[2]
_SM_SetVisualStyle(False)
$Console[0] = GUICreate($Title, 654, 0, -1, @DesktopHeight/2 - 164, Default, $WS_EX_Composited)
GUISetOnEvent(-3, "_ConsoleCommand_Exit")
GUISetBkColor(0x000000)
$Console[1] = GUICtrlCreateEdit("", 0, 0, 657, 297, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL))
GUICtrlSetBkColor($Console[1], 0x000000)
GUICtrlSetColor($Console[1], 0xC0C0C0)
GUICtrlSetFont($Console[1], 10, Default, Default, "Lucida Console")
GUISetState(@SW_SHOW)
_WinSetSize($Console[0], 660, 329, 10, 5)
Return $Console
EndfuncFunc _ConsoleWrite($Console, $String)
[/autoit] [autoit][/autoit] [autoit]
Local $timer, $split
$String = StringReplace($String, "/E", @CRLF)
$String = StringReplace($String, "/t", @TAB)
$split = StringSplit($String, "")
$timer = TimerInit()
For $i = 1 To $split[0]
Sleep(20)
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & $split[$i])
Next
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & @CRLF)
EndFuncFunc _WinSetSize($hWnd, $iWidth, $iHeigth, $iSleep = -1,$iStep = 4);by Gta Spider
[/autoit]
If $iSleep < 0 Then Return WinMove($hWnd,"",Default,Default,$iWidth,$iHeigth)
Local $i, $iStepW = $iStep, $iStepH = $iStep,$iSin,$i2,$iLastI
Local $aWinPos = WinGetPos($hWnd)
If $iWidth < $aWinPos[2] Then $iStepW *= -1
If $iHeigth < $aWinPos[3] Then $iStepH *= -1
Local $iDegToRad = 3.14159265358979/180
Local $iSinMulW = ($iWidth - $aWinPos[2]) / 2.5
Local $iSinMulH = ($iHeigth - $aWinPos[3]) / 2.5
If $iSinMulW < 0 Then $iSinMulW *= -1
If $iSinMulH < 0 Then $iSinMulH *= -1
If $iWidth <> $aWinPos[2] Then
For $i = $aWinPos[2] To $iWidth Step $iStepW
$iLastI = $i
$iSin = $i - $aWinPos[2]
$iSin = Sin($iDegToRad * (180*$iSin/($iWidth - $aWinPos[2])))
WinMove($hWnd,"",Default,Default,$i + ($iSin * $iSinMulW),Default)
Sleep($iSleep)
Next
If Mod($iWidth - $aWinPos[2],$iStep) Then
If $iStepW < 0 Then
$iStepW = -1
Else
$iStepW = 1
EndIf
For $i = $iLastI -1 To $iWidth Step $iStepW
WinMove($hWnd,"",Default,Default,$i,Default)
Next
EndIf
EndIf
If $iHeigth <> $aWinPos[3] Then
For $i = $aWinPos[3] To $iHeigth Step $iStepH
$iLastI = $i
$iSin = $i - $aWinPos[3]
$iSin = Sin($iDegToRad*(180*$iSin/($iHeigth - $aWinPos[3])))
WinMove($hWnd,"",Default,Default,Default,$i + ($iSin * $iSinMulH))
Sleep($iSleep)
Next
If Mod($iHeigth - $aWinPos[3],$iStep) Then
If $iStepH < 0 Then
$iStepH = -1
Else
$iStepH = 1
EndIf
For $i = $iLastI -1 To $iHeigth Step $iStepH
WinMove($hWnd,"",Default,Default,Default,$i)
Next
EndIf
EndIf
EndFunc -
Wirklich sehr gut umgesetzt!

Ich hab den Code mal ein bisschen abgeändert, und die originale CMD Schritart eingefügt.

Spoiler anzeigen
[autoit]#include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>
#include <EditConstants.au3>Global $edit, $Console, $BEF
[/autoit] [autoit][/autoit] [autoit]
Global $dll = DllOpen("user32.dll")HotKeySet("^m","MoveOut")
[/autoit] [autoit][/autoit] [autoit]$Console = _ConsoleCreate("Konsole")
[/autoit] [autoit][/autoit] [autoit]
_ConsoleWrite($Console, "Welcome")While 1
[/autoit] [autoit][/autoit] [autoit]
$msg = GUIGetMsg($Console[0])
Switch $msg
Case -3
Exit
EndSwitch
If _IsPressed("0D", $dll) And WinActive("Konsole") Then
$read = GUICtrlRead($Console[1])
$array = StringSplit($read, @CR)
$arrayNum = Ubound($array)
$BEF = $array[$arrayNum - 1]
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & @CRLF)
If $BEF = @LF & "lol" Then
_ConsoleWrite($Console, "roffl")
Else
_ConsoleWrite($Console, "unknown Command")
EndIf
While _IsPressed("0D", $dll) And WinActive("Konsole")
Sleep(100)
WEnd
EndIf
Sleep(30)
WEndFunc _SM_SetVisualStyle($b_Enable)
[/autoit] [autoit][/autoit] [autoit]
Return DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $b_Enable * 7)
EndFuncFunc _ConsoleCreate($Title)
[/autoit] [autoit][/autoit] [autoit]
Local $Console[2]
_SM_SetVisualStyle(0)
$Console[0] = GUICreate($Title, 654, 0, -1, -1, Default)
GUISetBkColor(0x000000)
$Console[1] = GUICtrlCreateEdit("", 0, 0, 657, 297, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL))
GUICtrlSetBkColor($Console[1], 0x000000)
GUICtrlSetColor ($Console[1], 0xC0C0C0)
GUICtrlSetFont($Console[1], 10, Default, Default, "Lucida Console")
GUISetState(@SW_SHOW)
Return $Console
EndfuncFunc _ConsoleWrite($Console, $String)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetData($Console[1], GUICtrlRead($Console[1]) & $String & @CRLF)
EndFuncFunc MoveOut()
[/autoit] [autoit][/autoit] [autoit]
WinActivate("Konsole")
_WinSetSize($Console[0],660, 329, 10,5)
EndFuncFunc _WinSetSize($hWnd, $iWidth, $iHeigth, $iSleep = -1,$iStep = 4);by Gta Spider
[/autoit]
If $iSleep < 0 Then Return WinMove($hWnd,"",Default,Default,$iWidth,$iHeigth)
Local $i, $iStepW = $iStep, $iStepH = $iStep,$iSin,$i2,$iLastI
Local $aWinPos = WinGetPos($hWnd)
If $iWidth < $aWinPos[2] Then $iStepW *= -1
If $iHeigth < $aWinPos[3] Then $iStepH *= -1
Local $iDegToRad = 3.14159265358979/180
Local $iSinMulW = ($iWidth - $aWinPos[2]) / 2.5
Local $iSinMulH = ($iHeigth - $aWinPos[3]) / 2.5
If $iSinMulW < 0 Then $iSinMulW *= -1
If $iSinMulH < 0 Then $iSinMulH *= -1
If $iWidth <> $aWinPos[2] Then
For $i = $aWinPos[2] To $iWidth Step $iStepW
$iLastI = $i
$iSin = $i - $aWinPos[2]
$iSin = Sin($iDegToRad * (180*$iSin/($iWidth - $aWinPos[2])))
WinMove($hWnd,"",Default,Default,$i + ($iSin * $iSinMulW),Default)
Sleep($iSleep)
Next
If Mod($iWidth - $aWinPos[2],$iStep) Then
If $iStepW < 0 Then
$iStepW = -1
Else
$iStepW = 1
EndIf
For $i = $iLastI -1 To $iWidth Step $iStepW
WinMove($hWnd,"",Default,Default,$i,Default)
Next
EndIf
EndIf
If $iHeigth <> $aWinPos[3] Then
For $i = $aWinPos[3] To $iHeigth Step $iStepH
$iLastI = $i
$iSin = $i - $aWinPos[3]
$iSin = Sin($iDegToRad*(180*$iSin/($iHeigth - $aWinPos[3])))
WinMove($hWnd,"",Default,Default,Default,$i + ($iSin * $iSinMulH))
Sleep($iSleep)
Next
If Mod($iHeigth - $aWinPos[3],$iStep) Then
If $iStepH < 0 Then
$iStepH = -1
Else
$iStepH = 1
EndIf
For $i = $iLastI -1 To $iHeigth Step $iStepH
WinMove($hWnd,"",Default,Default,Default,$i)
Next
EndIf
EndIf
EndFunc -
Du musst die Hälfe der Fensterbreite und Höhe subtrahieren.
Wenn das Fenster 500 hoch und breit ist, musst du 250 subtrahieren.
Ansonsten wird das Fenster nicht ganz in der Mitte angezeigt, weil ja von der linken oberen Ecke der GUI gesetzt wird.
[autoit]Global $Height = 500, $Width = 500, $hWnd
[/autoit][autoit][/autoit][autoit]$hWnd = GUICreate("Form1", $Width, $Height)
[/autoit][autoit][/autoit][autoit]WinMove("Form1","",(@desktopwidth - $Width/2)/2, (@desktopheight - $Height/2)/2)]
[/autoit]