Hi,
da kommt bei mir natürlich nichts. Kannst du mal zeigen wir der Output aussieht und was du davon brauchst.
Mega
Beiträge von Xenobiologist
-
-
Spoiler anzeigen
[autoit]#include <Array.au3>
[/autoit]
$str = "Hallo wie gehtss"
$re = StringRegExp($str, '.{4}', 3)
_ArrayDisplay($re) -
-
Ich schließe mich meinem Vorposter an!

-
Geh doch in deine audioeigenschaften und teste mal. Geht er gar nicht mehr? nur bei Autoit nicht?
-
Hi,
1) _FileListToArray mit *.log
2) Eine For Schleife über alle Dateien
Darin einleisen, StringReplace dein Wort durch dein Wort und in @extented steht die Anzahl
Dann wegschreiben in deine SQL DB oder einfach in eine Datei (z.B. Ini Datei)
3) Datei umbenennen mit FileMove
4) Fertig und freuenMega
-
Ist heute schon der 01.04?
-
-
Kannst ja mal sowas probieren
[autoit]AdlibRegister('_undoShutdown', 1000)
[/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]
Sleep(1000)
WEndFunc _undoShutdown()
[/autoit]
ShellExecute("shutdown", "-a", @ScriptDir, Default, @SW_HIDE)
EndFunc ;==>_undoShutdown -
Warum das bitte?
-
Hi,
bist du dir sicher, das Höhe und Breite auch zum Icon passen? Nicht das es gestreckt wird oder ähnliches.
Mega
-
-
Hi,
schon mal FileMon oder ProcessExplorer probiert?
Mega
-
Hi,
um es am Script ausrichten zu können, habe ich mir gedacht den Parameter auch im Script zu hinterlegen.
[autoit]
Sowas:#OrganizeIncludes_ScriptIncludePath= '\include'
[/autoit]Davon könnten dann auch mehrere genutzt werden.
Was hälst du davon?
Mega -
Hi bernd,
da hat du natürlich vollkommen recht. Ich frage mich nur, wie ich das am besten einbauen sollte.
Ich denke, ich müsste einen Extrapunkt einbauen für Projektpfad. Diesen könnte man dann relativ (oder absolut) zum Script angeben und OI müsste diesen auch mit ranziehen.Sprich ScripDirIncludesPath = \include
Dann würde OI alle au3 Dateien in @scriptDir &'\inlcude' auch untersuchen. und diese ggf. mit ' ...' oder "..." einbinden.Das würde helfen oder?
Mega
DANKE schon mal!
-
Alles anzeigen
geht er nicht aus dieser Schleife raus, da er nichts empfängt wird doch @error von TCPRecv() gesetzt:
[autoit]
[/autoit]
While 1
$Recv = TCPRecv($ConnectedSocket,4096)
if $Recv <> "" then TrayTip("SERVER","Received " & $Recv,1000)
if @error then
ExitLoop
EndIf
WEndEdit: Frage: wie bekommt man das Eingerückt dargestellt???
STRG+T in SciTE
Ja ja, die gute alte Reihenfolge

-
Hi bernd,
das Einbinden der Dinge aus UDF Ordner, oder ScriptDir mit " oder ' habe ich eingebaut. (Noch nicht gepostet)
Aber wie soll das mit den relativen\absoluten Pfaden gehen?
Macht es nicht mehr Sinn, diese Ordner auch in den UDF path mit aufzunehmen?Mega
-
Gute Einstellung.
Du must immer auf die Reihenfolge achten.
Also irgendwie sollte es umgefähr so aussehen: Listen --> Connect --> Send --> receive -
Hi,
es gibt doch schon so viele Chatprogramme. Hier ist ein altes von mir

Einfach 2x kompilieren und dann doppelt starten. Listen beim anderen connect und umgekehrt.
Das Script ist beides Server und Client.Spoiler anzeigen
[autoit]; MegaChat
[/autoit] [autoit][/autoit] [autoit]
#include <File.au3>
#include <GuiIPAddress.au3>
#include <Inet.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>Opt("OnExitFunc", "_endscript")
[/autoit] [autoit][/autoit] [autoit]
Opt("MustDeclareVars", 1)Global $title = "MegaChat", $l_port_startValue = 10000, $r_port_startValue = 20000, $left = 100, $logPath = 'MegaChat.log'
[/autoit] [autoit][/autoit] [autoit]If WinExists($title) Then
[/autoit] [autoit][/autoit] [autoit]
$title &= ' 2'
$l_port_startValue = 20000
$r_port_startValue = 10000
$left += 500
$logPath = 'MegaChat2.log'
EndIfGlobal $GUI
[/autoit] [autoit][/autoit] [autoit]
Global $l_hostname_I, $l_ip_IC, $l_port_I, $listen_B
Global $r_hostname_I, $r_ip_IC, $r_port_I, $connect_B
Global $comm_E, $send_E, $send_B#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\xf01145\eigene dateien\chat.kxf
[/autoit] [autoit][/autoit] [autoit]
$GUI = GUICreate($title, 445, 508, $left, 111)GUICtrlCreateGroup("Local settings", 10, 10, 420, 105)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("Hostname", 20, 30, 52, 17)
$l_hostname_I = GUICtrlCreateInput(@ComputerName, 105, 25, 131, 21)
GUICtrlCreateLabel("IP-address", 20, 55, 54, 17)
$l_ip_IC = _GUICtrlIpAddress_Create($GUI, 105, 50, 130, 21)
_GUICtrlIpAddress_Set($l_ip_IC, @IPAddress1)
GUICtrlCreateLabel("Listener-Port", 20, 80, 63, 17)
$l_port_I = GUICtrlCreateInput($l_port_startValue, 105, 75, 131, 21)
$listen_B = GUICtrlCreateButton("Listen", 275, 25, 120, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)GUICtrlCreateGroup("Remote settings", 10, 115, 420, 105)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("Hostname", 20, 135, 52, 17)
$r_hostname_I = GUICtrlCreateInput("not connected ...", 105, 130, 131, 21)
GUICtrlCreateLabel("IP-address", 20, 160, 54, 17)
$r_ip_IC = _GUICtrlIpAddress_Create($GUI, 105, 155, 130, 21)
_GUICtrlIpAddress_Set($r_ip_IC, @IPAddress1)
GUICtrlCreateLabel("Listener-Port", 20, 185, 63, 17)
$r_port_I = GUICtrlCreateInput($r_port_startValue, 105, 180, 131, 21)
$connect_B = GUICtrlCreateButton("Connect", 280, 130, 120, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)GUICtrlCreateGroup("Communication summary", 10, 220, 420, 155)
[/autoit] [autoit][/autoit] [autoit]
$comm_E = GUICtrlCreateEdit("", 15, 235, 410, 134)
GUICtrlCreateGroup("", -99, -99, 1, 1)GUICtrlCreateGroup("Communication send", 10, 375, 420, 95)
[/autoit] [autoit][/autoit] [autoit]
$send_E = GUICtrlCreateEdit("", 15, 390, 410, 74)
GUICtrlCreateGroup("", -99, -99, 1, 1)$send_B = GUICtrlCreateButton("Send", 10, 475, 90, 25, $WS_GROUP)
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###; Start The TCP Services
[/autoit] [autoit][/autoit] [autoit]
;==============================================
TCPStartup()
; Initialize a variable to represent a server-connection
;==============================================
Global $ConnectedSocket = -1
; Initialize a variable to represent a client-connection
;==============================================
Global $ConnectedToSocket = -1
Global $recv_main()
[/autoit] [autoit][/autoit] [autoit]Func _main()
[/autoit] [autoit][/autoit] [autoit]
Local $nMsgWhile 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $listen_B
_listen()
Case $connect_B
_connect()
Case $send_B
If $ConnectedToSocket <> -1 Then
_send()
Else
_FileWriteLog($logPath, 'You are not connected!')
MsgBox(16, 'Error', 'You are not connected!', 5)
EndIf
EndSwitch
If $ConnectedSocket <> -1 Then _receive()
WEnd
EndFunc ;==>_mainFunc _send()
[/autoit] [autoit][/autoit] [autoit]
Local $txt = GUICtrlRead($send_E)
If $txt <> '' Then TCPSend($ConnectedToSocket, $txt)
; If the send failed with @error then the socket has disconnected
;----------------------------------------------------------------
If @error Then
_FileWriteLog($logPath, 'TCPSend error')
Else
GUICtrlSetData($comm_E, _
@UserName & " : " & $txt & @CRLF & GUICtrlRead($comm_E))
GUICtrlSetData($send_E, '')
EndIf
EndFunc ;==>_sendFunc _connect()
[/autoit] [autoit][/autoit] [autoit]
;Attempt to connect to SERVER at its IP and PORT
;=======================================================
$ConnectedToSocket = TCPConnect(_GUICtrlIpAddress_Get($r_ip_IC), GUICtrlRead($r_port_I)); If there is an error... show it
[/autoit] [autoit][/autoit] [autoit]
If @error Then
MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error & @CRLF & 'Maybe nobody is listening ...')
_FileWriteLog($logPath, 'Connecting error')
EndIf
EndFunc ;==>_connectFunc _receive()
[/autoit] [autoit][/autoit] [autoit]
; Try to receive (up to) 2048 bytes
;----------------------------------------------------------------
$recv = TCPRecv($ConnectedSocket, 2048); If the receive failed with @error then the socket has disconnected
[/autoit] [autoit][/autoit] [autoit]
;----------------------------------------------------------------
If @error Then
_FileWriteLog($logPath, 'Disconnected')
$ConnectedSocket = -1
EndIf; Update the edit control with what we have received
[/autoit] [autoit][/autoit] [autoit]
;----------------------------------------------------------------
If $recv <> "" Then GUICtrlSetData($comm_E, _
GUICtrlRead($r_hostname_I) & " -> " & $recv & @CRLF & GUICtrlRead($comm_E))
EndFunc ;==>_receiveFunc _listen()
[/autoit] [autoit][/autoit] [autoit]
; Create a Listening "SOCKET"
;==============================================
Local $MainSocket = TCPListen(@IPAddress1, GUICtrlRead($l_port_I), 100)
If $MainSocket = -1 Then
_FileWriteLog($logPath, 'TCPListen error')
Exit
EndIf;Wait for and Accept a connection
[/autoit] [autoit][/autoit] [autoit]
;==============================================
Local $start = TimerInit()
Do
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1 Or (TimerDiff($start) > 25000); Get IP of client connecting
[/autoit] [autoit][/autoit] [autoit]
Local $szIP_Accepted = SocketToIP($ConnectedSocket)
GUICtrlSetData($r_hostname_I, _TCPIpToName($szIP_Accepted))
EndFunc ;==>_listen; Function to return IP Address from a connected socket.
[/autoit] [autoit][/autoit] [autoit]
;----------------------------------------------------------------------
Func SocketToIP($SHOCKET)
Local $sockaddr, $aRet$sockaddr = DllStructCreate("short;ushort;uint;char[8]")
[/autoit] [autoit][/autoit] [autoit]$aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
[/autoit] [autoit][/autoit] [autoit]
"ptr", DllStructGetPtr($sockaddr), "int*", DllStructGetSize($sockaddr))
If Not @error And $aRet[0] = 0 Then
$aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
If Not @error Then $aRet = $aRet[0]
Else
$aRet = 0
EndIf$sockaddr = 0
[/autoit] [autoit][/autoit] [autoit]Return $aRet
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>SocketToIPFunc _endscript()
[/autoit]
TCPCloseSocket($ConnectedSocket)
TCPShutdown()
Exit (0)
EndFunc ;==>_endscriptMega
-
Hi,
gute Idee. Guck dir mal AntiTwin an, der findet auch inhaltlich gleiche Dateien auch wenn sie nicht gleich heißen.
Ist sehr gut für MP3s!Mega