Ne die 19 ist nur so bin 24 Jahre alt/jung und mich interessiert es nur und Kontakte sind immer gut
Beiträge von sedas19
-
-
Hi Suche Leute aus Lingen und Umgebung mit den man mal Projekte starten könnte, und wollte mal aus Interesse nachfragen wie sehr autoit hier in der Umgebung vertreten ist.
Gruß Sedas
-
Wen du dein eigenes Script "leeren" willst nutze
@AutoItPID Process identifier (PID) of the current script.
Ansonsten $pid=run("dein program was du Startes") -
hast du den die ProcessId von den process dort angegeben
-
[autoit]
Func _ReduceMemory($i_PID = -1)
[/autoit]
If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc;==> _ReduceMemory()
Die Funktion dürfte dir helfen lasse sie einfach über adliberegist aufrufen sagen wir in 5-10min tackt -
würde mich auch sehr freuen wen der Anhang reupload wird, da der link nicht funktioniert
-
Server:
Spoiler anzeigen
[autoit]#include-once
[/autoit]
while 1
_FileReceive();
If @error Then
MsgBox(48,"","Error: "&@error)
Exit
EndIf
Sleep(100)
WEnd
;===============================================================================
;
; Function Name: _FileReceive
; Description:: Receives a File from an Client (See _FileSend)
; Parameter(s):
;$sFileName [Optional] : The Filename to save (if default or "" then using the original File Name)
;$IP [Optional] : The IP where the Server run, Default = @IPAdress1
;$PORT [Optional] : The Port to use (must be the same as by _FileSend!!)
;$iSplash [Optional] : 1(defaul) = show SplashText
; Requirement(s): -
; Return Value(s): On Succes Return 1
; On faild Return -1 and @error code 1-3:
; @error = 1: Error creating Listening socket on IP
; @error = 2: Faild to open file
; @error = 3: Faild to write file
; Author(s): GtaSpider
; Modified by: Texos
;
;===============================================================================
Func _FileReceive($sFileName = '', $IP = @IPAddress1, $PORT = 4324,$iSplash=1)
Local $iMainSocket, $iAccSocket = -1, $sBuff, $sRecv = "", $i = 0
TCPStartup()
$iMainSocket = TCPListen($IP, $PORT)
If @error Then Return SetError(1,0,-1)
While $iAccSocket = -1
$iAccSocket = TCPAccept($iMainSocket)
Sleep(50)
WEnd
If $iSplash Then ProgressOn("Empfangsbereit","","Warte auf Dateien...",-1,-1,16)
Do
$Recv = TCPRecv($iAccSocket,1024)
Sleep(100)
Until $Recv <> ""
$Recv = StringSplit($Recv,Chr(3))
$iFileTrimcount = Round($Recv[3]/8)
$iFilesizeByte = $Recv[2]/8
$SFilename = $Recv[1]
$sBuff = ""
$len = 0
Do
$Recv = TCPRecv($iAccSocket,_Max(1024*16,$iFileTrimcount/4))
$sBuff &= $Recv
If $iSplash Then
$len += BinaryLen(Binary("0x"&$Recv))
ProgressSet(_Min(100,Round($len/$iFilesizeByte,2)*100),"Dateitransfer", _Min(100,Round($len/$iFilesizeByte,2)*100)&"% abgeschlossen.")
EndIf
Sleep(20)
Until StringRight($Recv,4) = "DONE" ; DONE = 444F4E45
$sBuff = StringTrimRight($sBuff,4)
$sBuff = Binary("0x"&$sBuff)
$sBuff = BinaryToString($sBuff)
If $iSplash Then ProgressSet(100,"Schreibe Datei...")
If FileExists("Incoming\"&$sFileName) Then
$sTmp = StringSplit($sFileName, ".")
If $sTmp[0] < 2 Then
While 1
$i += 1
If Not FileExists($sFileName & "(" & $i & ")") Then
$sFileName = $sFileName & "(" & $i & ")"
ExitLoop
EndIf
WEnd
Else
While 1
$i += 1
If Not FileExists($sTmp[1] & "(" & $i & ")" & $sTmp[2]) Then
$sFileName = $sTmp[1] & "(" & $i & ")." & $sTmp[2]
ExitLoop
EndIf
WEnd
EndIf
EndIf
$iFileOp = FileOpen("Incoming\"&$sFileName, 16 + 2)
If @error Then Return SetError(2,0,-1)
FileWrite($iFileOp, $sBuff)
If @error Then Return SetError(3,0,-1)
FileClose($iFileOp)
If $iSplash Then ProgressSet(100,"Datei erfolgreich empfangen!")
TCPSend($iAccSocket, "Finish")
If $iSplash Then Sleep(2000)
TCPCloseSocket($iAccSocket)
If $iSplash Then ProgressOff()
TCPShutdown()
Sleep(1000)
Return 1
EndFunc ;==>_FileReceive
Func _Min($nNum1, $nNum2)
; Check to see if the parameters are indeed numbers of some sort.
If (Not IsNumber($nNum1)) Then Return SetError(1, 0, 0)
If (Not IsNumber($nNum2)) Then Return SetError(2, 0, 0)
If $nNum1 > $nNum2 Then
Return $nNum2
Else
Return $nNum1
EndIf
EndFunc ;==>_Min
Func _Max($nNum1, $nNum2)
; Check to see if the parameters are indeed numbers of some sort.
If Not IsNumber($nNum1) Then Return SetError(1, 0, 0)
If Not IsNumber($nNum2) Then Return SetError(2, 0, 0)
If $nNum1 > $nNum2 Then
Return $nNum1
Else
Return $nNum2
EndIf
EndFunc ;==>_MaxClient:
Spoiler anzeigen
[autoit]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
[/autoit] [autoit][/autoit] [autoit]
#AutoIt3Wrapper_Outfile=Clien3t.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
IniWrite("Settings\Conf","Server","IP","")
;~ Global $server = IniRead("Settings\Conf","Server","IP","")
;~ If $server <> "" Then
$server = @IPAddress1
;~ EndIf
#include <ButtonConstants.au3>
#include <GuiListView.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <FileConstants.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <Crypt.au3>
#include <File.au3>
Global $akhandel
Global $handlela = 1,$coloum = 8
Dim $listviewhandle[1][$coloum]
Global Const $sMessage = "Hold down Ctrl or Shift to choose multiple files."
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 268, 461, 195, 123)
GUICtrlCreateLabel("Hash-Key:", 8, 8, 92, 17, $SS_CENTER)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$hash1 = GUICtrlCreateInput("", 112, 8, 145, 21)
$ListView1 = GUICtrlCreateListView("Filename|Status", 8, 64, 250, 358)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 75)
$sefile = GUICtrlCreateButton("Select File", 8, 32, 251, 25)
$upload = GUICtrlCreateButton("Upload", 8, 428, 251, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
DirCreate("Upload")
;~ _FileSend("1mb.txt", $server)
;~ _FileSend("10mb.txt", $server)
_FileSend("100mb.txt", $server)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $upload
_Crypt()
Case $sefile
Local $sFileOpenDialog = FileOpenDialog($sMessage, @ScriptDir & "\", "All (*.*)|", $FD_FILEMUSTEXIST + $FD_MULTISELECT)
_File($sFileOpenDialog)
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEndFunc _Crypt()
[/autoit] [autoit][/autoit] [autoit]
$key = GUICtrlRead($hash1)
If $key = "" Then
$key = ""
For $x = 1 to 256
$key &= Random(0,9,1)
Next
EndIf
For $x = 1 to $listviewhandle[0][0]
$file = StringReplace($listviewhandle[$x][2],".",",")
ConsoleWrite($file&@CRLF)
$akhandel = $listviewhandle[$x][2]
$a = _Crypt_EncryptFile2 ( $listviewhandle[$x][1]&$listviewhandle[$x][2], @ScriptDir&"\Upload\"&$file,$key, $CALG_AES_256 )
If @error <> 0 Then
GUICtrlSetBkColor($listviewhandle[$x][0],0xFF0000)
ConsoleWrite($a&" "&@error&@CRLF)
Else
GUICtrlSetBkColor($listviewhandle[$x][0],0x00FFFF)
_FileWriteToLine(@ScriptDir&"\Upload\"&$file,1,$key)
EndIf
Next
EndFuncFunc _File($filedialog)
[/autoit] [autoit][/autoit] [autoit]
_Crypt_Startup()
If $filedialog < "" Then
Return False
ElseIf StringInStr($filedialog,"|") Then
$splittfiledialog = StringSplit($filedialog,"|")
For $x = 2 to $splittfiledialog[0]
$hash = _Crypt_HashFile($splittfiledialog[1]&"\"&$splittfiledialog[$x], $CALG_MD5)
$checkli = _checkList($hash)
If $checkli <> "" Then
MsgBox(48,"File is already in the List",$splittfiledialog[1]&"\"&$splittfiledialog[$x]&@CRLF&"[MD5-Hash: "&$hash&"]"&@CRLF&@CRLF&@CRLF&$listviewhandle[$checkli][1]&$listviewhandle[$checkli][2]&@CRLF&"[MD5-Hash: &"&$listviewhandle[$checkli][3]&"]")
Else
$handle = GUICtrlCreateListViewItem($splittfiledialog[$x]&"|0%",$ListView1)
ReDim $listviewhandle[$handlela+1][$coloum]
$listviewhandle[0][0] = $handlela
$listviewhandle[$handlela][0] = $handle
$listviewhandle[$handlela][1] = $splittfiledialog[1]&"\"
$listviewhandle[$handlela][2] = $splittfiledialog[$x]
$listviewhandle[$handlela][3] = $hash
$handlela = $handlela+1
EndIf
Next
ElseIf StringInStr($filedialog,"\") Then
$hash = _Crypt_HashFile($filedialog, $CALG_MD5)
$checkli = _checkList($hash)
If $checkli <> "" Then
MsgBox(48,"File is already in the List",$filedialog&@CRLF&"[MD5-Hash: "&$hash&"]"&@CRLF&@CRLF&@CRLF&$listviewhandle[$checkli][1]&$listviewhandle[$checkli][2]&@CRLF&"[MD5-Hash: &"&$listviewhandle[$checkli][3]&"]")
Else
$splittfiledialog = StringSplit($filedialog,"\")
$max = $splittfiledialog[0]
$handle = GUICtrlCreateListViewItem($splittfiledialog[$max]&"|0%",$ListView1)
ReDim $listviewhandle[$handlela+1][$coloum]
$listviewhandle[0][0] = $handlela
$listviewhandle[$handlela][0] = $handle
$listviewhandle[$handlela][1] = StringTrimRight($filedialog,StringLen($splittfiledialog[$max]))
$listviewhandle[$handlela][2] = $splittfiledialog[$max]
$listviewhandle[$handlela][3] = $hash
$handlela = $handlela+1
EndIf
EndIf
_Crypt_Shutdown()
EndFuncFunc _checkList($hash)
[/autoit] [autoit][/autoit] [autoit]
For $x = 1 to $listviewhandle[0][0]
If $listviewhandle[$x][3] = $hash Then
Return $x
ExitLoop
EndIf
Next
EndFunc
;===============================================================================
;
; Function Name: _FileSend
; Description:: Sending a File to an Server (See _FileReceive)
; Parameter(s):
;$sFile : The File to send
;$IP : The target IP Adress
;$PORT [Optional] : The Port to use (must be the same as by _FileRecevie!!)
;$iSplash [Optional] : 1(defaul) = show SplashText
; 0 = dont show SplashText
;$iWaitWhileConnected [Optional] : 0 = If TCPConnect faild (@error) Return with error Code 2
; 1(Default) = If TCPConnect faild put it in a while until connected
;$iWaitForServer [Optional] : 1(defaul) = wait for server to write data on hd
; 0 = dont wait for server
; Requirement(s): -
; Return Value(s): On Succes Return 1
; On faild Return -1 and @error code 1-3:
; @error = 1: File not exist
; @error = 2: TCPConnect faild (only able if $iWaitWhileConnected <> 1)
; @error = 3: Faild to Open File
; @error = 4: A Connectionproblem while sending
; Author(s): GtaSpider
; Modified by: Texos
;
;===============================================================================Func _FileSend($sFile, $IP, $PORT = 4324,$iSplash=1, $iWaitWhileConnected=1, $iWaitForServer=1)
[/autoit] [autoit][/autoit] [autoit]
Local $iMainSocket = -1, $sBuff, $iFileOp,$sRecv, $sendfull = False
If Not FileExists($sFile) Then Return SetError(1,0,-1)
If $iSplash Then ProgressOn("Dateitransfer","","Warte auf Server...",-1,-1,16)
TCPStartup()
If Number($iWaitWhileConnected) = 1 Then
While $iMainSocket = -1
$iMainSocket = TCPConnect($IP, $PORT)
WEnd
Else
$iMainSocket = TCPConnect($IP, $PORT)
If @error Then Return SetError(2, 0, -1)
EndIf
If $iSplash Then ProgressSet(0,"Dateitransfer", "Lese Datei ein...")
$iFileOp = FileOpen($sFile, 16)
If @error Then Return SetError(3,0,-1)
$sFileread = FileRead($iFileOp)
$iFilesizeBIT = BinaryLen($sFileread)*8
$sFileread = StringTrimLeft($sFileread,2)
$trimcount = Floor($iFilesizeBIT/100)
If $trimcount < 100 OR $iFilesizeBIT <= 4350000 Then $sendfull = True
FileClose($iFileOp)
$sFile = StringTrimLeft($sFile,StringInStr($sFile,"\",-1,-1))
Do
$TCPSend = TCPSend($iMainSocket,$sFile&Chr(3)&$iFilesizeBIT&Chr(3)&$trimcount)
Sleep(100)
Until $TCPSend > 0
If $sendfull = False Then
For $i = 1 To 100
$check = StringLeft($sFileread,$trimcount/4)
$sFileread = StringTrimLeft($sFileread,$trimcount/4)
TCPSend($iMainSocket, $check)
If $iSplash Then ProgressSet($i,"Dateitransfer", $i&"% abgeschlossen.")
Next
TCPSend($iMainSocket, $sFileread)
Else
TCPSend($iMainSocket, $sFileread)
EndIf
TCPSend($iMainSocket, "DONE")
If $iSplash Then ProgressSet(100,"Dateitransfer", "Dateitransfer erfolgreich abgeschlossen.")
Sleep(1000)
If $iSplash Then ProgressSet(100,"Dateitransfer", "Warte auf Server...")
If $iWaitForServer Then
Do
$Recv = TCPRecv($iMainSocket,1024)
Sleep(100)
Until $Recv <> ""
EndIf
TCPCloseSocket($iMainSocket)
TCPShutdown()
ProgressOff()
Return 1
EndFuncFunc _Crypt_EncryptFile2($sSourceFile, $sDestinationFile, $vCryptKey, $iALG_ID)
[/autoit] [autoit][/autoit] [autoit]
Local $bTempData = 0, _
$hInFile = 0, $hOutFile = 0, _
$iError = 0, $iExtended = 0, $iFileSize = FileGetSize($sSourceFile), $iRead = 0, _
$bReturn = True_Crypt_Startup()
[/autoit] [autoit][/autoit] [autoit]
;~ $bTempData = FileRead($hInFile, 1024 * 1024)
;~ $iRead += BinaryLen($bTempData)
ConsoleWrite("Cal: "&Round($iFileSize/1024/1024,0)&@CRLF)
$rounds = Round($iFileSize/1024/1024,0)$c = 0
[/autoit] [autoit][/autoit] [autoit]
DoIf $iALG_ID <> $CALG_USERKEY Then
[/autoit] [autoit][/autoit] [autoit]
$vCryptKey = _Crypt_DeriveKey($vCryptKey, $iALG_ID)
If @error Then
$iError = @error
$iExtended = @extended
$bReturn = False
ExitLoop
EndIf
EndIf$hInFile = FileOpen($sSourceFile, $FO_BINARY)
[/autoit] [autoit][/autoit] [autoit]
If @error Then
$iError = 2
$bReturn = False
ExitLoop
EndIf
$hOutFile = FileOpen($sDestinationFile, $FO_OVERWRITE + $FO_CREATEPATH + $FO_BINARY)
If @error Then
$iError = 3
$bReturn = False
ExitLoop
EndIfDo
[/autoit] [autoit][/autoit] [autoit]$bTempData = FileRead($hInFile, 1024 * 1024)
[/autoit] [autoit][/autoit] [autoit]
$iRead += BinaryLen($bTempData)
If $iRead = $iFileSize Then
$bTempData = _Crypt_EncryptData2($bTempData, $vCryptKey, $CALG_USERKEY, True)
If @error Then
$iError = @error + 400
$iExtended = @extended
$bReturn = False
EndIf
FileWrite($hOutFile, $bTempData)
ExitLoop 2
Else
$bTempData = _Crypt_EncryptData2($bTempData, $vCryptKey, $CALG_USERKEY, False)
If @error Then
$iError = @error + 500
$iExtended = @extended
$bReturn = False
ExitLoop 2
EndIf
FileWrite($hOutFile, $bTempData)
EndIf$c = $c+1
[/autoit] [autoit][/autoit] [autoit]
$per = (100/$rounds)*$c
;~ _setper($per)
ConsoleWrite("PER &"&$per&"%"&@CRLF)
Until FalseUntil True
[/autoit] [autoit][/autoit] [autoit]If $iALG_ID <> $CALG_USERKEY Then _Crypt_DestroyKey($vCryptKey)
[/autoit] [autoit][/autoit] [autoit]
_Crypt_Shutdown()
If $hInFile <> -1 Then FileClose($hInFile)
If $hOutFile <> -1 Then FileClose($hOutFile)
;~ ConsoleWrite("PER &"&$per&"%"&@CRLF)
Return SetError($iError, $iExtended, $bReturn)
EndFunc ;==>_Crypt_EncryptFile;~ Func _setper($per)
[/autoit] [autoit][/autoit] [autoit]
;~ $handle = $akhandel
;~ $c = _GUICtrlListView_GetItemCount ( $ListView1 )
;~ For $x = 0 to $c
;~ $nam = _GUICtrlListView_GetItemText ( $ListView1, $x)
;~ $nam = _GUICtrlListView_GetItemText ( $ListView1, $x)
;~ If $name = $handle Then
;~ If
;~ _GUICtrlListView_SetItemText ( $ListView1, $handle, $per&"%", 1)
;~ EndFuncFunc _Crypt_EncryptData2($vData, $vCryptKey, $iALG_ID, $bFinal = True)
[/autoit] [autoit][/autoit] [autoit]
Local $iReqBuffSize = 0, _
$aRet = 0, _
$hBuff = 0, _
$iError = 0, $iExtended = 0, _
$vReturn = 0_Crypt_Startup()
[/autoit] [autoit][/autoit] [autoit]
$a = 1
Do
If $iALG_ID <> $CALG_USERKEY Then
$vCryptKey = _Crypt_DeriveKey($vCryptKey, $iALG_ID)
If @error Then
$iError = @error + 100
$iExtended = @extended
$vReturn = -1
ExitLoop
EndIf
EndIf$aRet = DllCall(__Crypt_DllHandle(), "bool", "CryptEncrypt", "handle", $vCryptKey, "handle", 0, "bool", $bFinal, "dword", 0, "ptr", 0, _
[/autoit] [autoit][/autoit] [autoit]
"dword*", BinaryLen($vData), "dword", 0)
If @error Or Not $aRet[0] Then
$iError = @error + 20
$iExtended = @extended
$vReturn = -1
ExitLoop
EndIf$iReqBuffSize = $aRet[6]
[/autoit] [autoit][/autoit] [autoit]
$hBuff = DllStructCreate("byte[" & $iReqBuffSize & "]")
DllStructSetData($hBuff, 1, $vData)
$aRet = DllCall(__Crypt_DllHandle(), "bool", "CryptEncrypt", "handle", $vCryptKey, "handle", 0, "bool", $bFinal, "dword", 0, "struct*", $hBuff, _
"dword*", BinaryLen($vData), "dword", DllStructGetSize($hBuff))
If @error Or Not $aRet[0] Then
$iError = @error + 30
$iExtended = @extended
$vReturn = -1
ExitLoop
EndIf
$vReturn = DllStructGetData($hBuff, 1)
$a = $a+1
Until TrueIf $iALG_ID <> $CALG_USERKEY Then _Crypt_DestroyKey($vCryptKey)
[/autoit]
_Crypt_Shutdown()
ConsoleWrite($a&@CRLF)
Return SetError($iError, $iExtended, $vReturn)
EndFunc ;==>_Crypt_EncryptData -
ja habe ich auch schon dran gedacht blos wen nacher 100 leute sich verbinden und jeder sein eigene "server" erhält muss ich ja auch 100 ports aktivieren. in der hinsicht ist es wieder unproduktiv^^
-
Hallo ich wollte nachfragen wie es möglich ist oder ob es möglich ist wen ich zb ein Client habe ihn mit den server verbinde und dan nachher an ein 2 server weiterverbinden möchte ob man dies mit den Sockets machen kann oder ob ich den client sagen muss das er sich auf ein neuen port einwählen muss.
-
Dein basiert ja auf tcp aber geht Dan in http meins soll rein über tcp laufen, sich über den Client zum Server verbinden
-
Genau so eine dll meine ich nur meine Frage ob es den schneller ist mit einer dll oder ob ich es genauso gut in autoit hinkriege
-
Alpines ich hätte da noch eine Frage ist es möglich eine dll zu schreiben die eine variable x erhält Dan diese in ein URL einfügt und den Rückgabe wert von https GET zurück gibt? Oder tut sich da nicht viel wen ich das mit autoit mache?
-
Das Multithreading in autoit instabil ist habe ich schon rausgefunden da mir schon oft mein Script abgestürzt ist da es ein Befehl angeblich nicht kannte aber alles korrekt war. Ich danke dir alpines, ich code schon länger in autoit doch so langsam möchte ich auch schwerere Sachen machen und nicht auf den Grundlagen verharren deswegen diese Frage
-
Hast du dafür eventuell mal ein Beispiel? Habe mal so ein multi threading Code gefunden aber griege das nie hin,
-
Ich habe so eine Funktion gefunden für den file Transfer die die Datei Dan aufteilt und sendet also soll ich Dan nur wen x nicht erfüllt ist 100kb senden und Dan sleep oder wie meinst du das bzw wen ich zB 4 pc habe die was gleichzeitig uploaden ist Dan nicht der Server überfordert ?
-
Hallo ich wollte mal fragen ob es möglich ist bei ein file Transfer von tcp download Speed Limit einzubauen? Sprich, dass er nicht mit maximaler Power lädt sondern nur mit 100kb/sec
und noch eine frohe weihnacht
-
Man merkt schon das es grade leicht vom Thema abkommt. Der MaxChri hat nur gefragt warum seine Funktion nicht funktioniert, Lösungen wurden in den 3 und 4 post gepostet und ab da an geht es nur noch um dllcall oder String. Es ist verständlich das auch Millisekunden auf Dauer was ausmachen aber ich bezweifle mal ganz stark das es bei sein Script so wichtig ist das er jede Millisekunde braucht.
-
#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
Sleep ( 250 )
If _IsPressed("0D", $dll) Then
MsgBox(0,"_IsPressed", "Enter-taste wurde gedrückt.")
ExitLoop
EndIf
WEnd
DllClose($dll) -
Vielen Danke genau das habe ich gebraucht muss ich mich doch wohl mal mehr mit den Cordinaten beschäftigen habe es einfach nicht hinbekommen es zu spiegeln
-
Hallo
ich arbeite momentan an ein programm was mithilfe von Kordinaten Also X und Y eine zeichnung erstellt mein problem ist nun das er sie auf den kopf zeichnet
[autoit]
hier ist mein Code:#include <GDIPlus.au3>
[/autoit][autoit][/autoit][autoit]
#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <File.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Global $g_hGUI, $g_hGraphics, $g_hBmp_Buffer, $g_hGfx_Buffer, $g_hImage
Global $g_iMouseX, $g_iMouseY
Local $hGUI, $hGraphic, $hPen,$aArray,$g_hBmp_Buffer,$g_hGraphics
Local $g_iMouseX,$g_iMouseY,$lParam$hGUI = GUICreate("GDI+", 1000, 300)
[/autoit][autoit][/autoit][autoit]
GUISetState(@SW_SHOW)_GDIPlus_Startup()
[/autoit][autoit][/autoit][autoit]
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
If Not _FileReadToArray("a2.din", $aArray, 0) Then
MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file.
EndIfFor $x = 1 To UBound($aArray)-1
[/autoit][autoit][/autoit][autoit]
If StringInStr($aArray[$x],"G00 X") Then
;~ _GDIPlus_GraphicsDrawLine($hGraphic, StringTrimLeft($spl[2],1), StringTrimLeft($spl[3],1), StringTrimLeft($spl2[2],1), StringTrimLeft($spl2[3],1), $hPen)
ElseIf StringInStr($aArray[$x],"G01 X") Then
$spl = StringSplit($aArray[$x]," ")
$spl2 = StringSplit($aArray[$x-1]," ")
If $spl[0] >= 3 and $spl2[0] >= 3 Then
IF StringTrimLeft($spl2[2],1) = "-0.1" Then
Else
_GDIPlus_GraphicsDrawLine($hGraphic, StringTrimLeft($spl[2],1), StringTrimLeft($spl[3],1), StringTrimLeft($spl2[2],1), StringTrimLeft($spl2[3],1), $hPen)
EndIf
EndIf
EndIf
NextDo
[/autoit][autoit][/autoit][autoit]
Until GUIGetMsg() = $GUI_EVENT_CLOSE; Clean up resources
[/autoit]
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()im anhang ist die cordinaten datei