hallo, ich habe ein problem mit einem meiner scripts. ich hab mir einen mini chat gebastelt und wollt mir mit der FileInstall funktion ein paar "makros" reinbauen.
so weit so gut, wenn ich das script ausführe funktioniert es auch einwandfrei...... nur wenn ich es versuche zu compilen kommt andauernd ein error.
hier das komplette script:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstants.au3>
#Include <File.au3>
#Include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <ScrollBarConstants.au3>
FileInstall(@ScriptDir & "/hallo.mp3",@WindowsDir & "/Chat/hallo.mp3",1)
[/autoit] [autoit][/autoit] [autoit]$openlog = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",0)
If $openlog = -1 Then
If DirGetSize(@WindowsDir & "/Chat") = -1 Then
DirCreate(@WindowsDir & "/Chat")
EndIf
$openlog = _FileCreate(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt")
EndIf
$socket = -1
$socket2 = -1
TCPStartup()
If @error = 1 Then Exit
$gui = GUICreate("ip",100,60)
GUISetState(@SW_SHOW)
$combo = GUICtrlCreateCombo(@IPAddress1,0,0,90,80)
If @IPAddress2 <> "0.0.0.0" Then
GUICtrlSetData(-1, @IPAddress2)
EndIf
If @IPAddress3 <> "0.0.0.0" Then
GUICtrlSetData(-1, @IPAddress3)
EndIf
If @IPAddress4 <> "0.0.0.0" Then
GUICtrlSetData(-1, @IPAddress4)
EndIf
$button = GUICtrlCreateButton("OK",0,20,100,40)
Global $ip1
While 1
$msg = GUIGetMsg()
If $msg = $button Then
$ip1 = GUICtrlRead($combo)
GUIDelete($gui)
ExitLoop
EndIf
If $msg = $GUI_EVENT_CLOSE Then
$ip1 = GUICtrlRead($combo)
GUIDelete($gui)
ExitLoop
EndIf
WEnd
$ip = InputBox("IP","Server-IP eingeben")
$main = TCPListen($ip1,50,1)
$socket = -1
Do
$socket = TCPAccept($main)
$socket2 = TCPConnect($ip,50)
Until $socket <> -1 Or $socket2 <> -1
GUICreate("Chat V0.5",500,500)
$edit = GUICtrlCreateEdit("",0,0,500,250)
$edit2 = GUICtrlCreateEdit("",0,250,500,200)
$button = GUICtrlCreateButton("Send",0,450,100,50)
GUISetState(@SW_SHOW)
$readlog = FileRead($openlog)
GUICtrlSetData($edit,$readlog)
While 1
$msg = GUIGetMsg()
$recive = TCPRecv($socket,1000)
$read = GUICtrlRead($edit)
$send = GUICtrlRead($edit2)
Select
Case $socket = -1
$socket = TCPAccept($main)
Case $socket2 = -1
$socket2 = TCPConnect($ip,50)
Case $recive <> ""
check($recive,2)
Case $msg = $button
check($send,1)
EndSelect
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Func check($chat,$check)
$split = StringSplit($chat,":")
If FileExists(@WindowsDir & "/Chat/" & $split[2] & ".mp3") Then
SoundPlay(@WindowsDir & "/Chat/" & $split[2] & ".mp3")
$chat2 = $split[1] & " " & $split[3]
Else
$chat2 = $split[1]
EndIf
If $check = 1 Then
senden($chat,$chat2)
ElseIf $check = 2 Then
empfangen($chat2)
Else
EndIf
EndFunc
Func senden($send,$log)
TCPSend($socket2, @ComputerName & " -> " & $send & " (" & @HOUR & ";" & @MIN & ";" & @SEC & ")")
FileClose($openlog)
$openlog3 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",1)
$writelog = FileWriteLine($openlog3, @ComputerName & " -> " & $log & " (" & @HOUR & ";" & @MIN & ";" & @SEC & ")")
FileClose($openlog)
$openlog2 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",0)
$readlog = FileRead($openlog2)
GUICtrlSetData($edit, $readlog)
$iLen = _GUICtrlEdit_GetTextLen($edit)
_GUICtrlEdit_SetSel($edit, $iLen, $iLen)
_GUICtrlEdit_Scroll($edit, $SB_SCROLLCARET)
EndFunc
Func empfangen($empfang)
FileClose($openlog)
$openlog3 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",1)
$writelog = FileWriteLine($openlog3, $empfang)
FileClose($openlog)
$openlog2 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",0)
$readlog = FileRead($openlog2)
GUICtrlSetData($edit, $readlog)
$iLen = _GUICtrlEdit_GetTextLen($edit)
_GUICtrlEdit_SetSel($edit, $iLen, $iLen)
_GUICtrlEdit_Scroll($edit, $SB_SCROLLCARET)
EndFunc
Func OnAutoItExit()
TCPShutdown()
FileClose($openlog)
FileDelete(@WindowsDir & "/Chat/hallo.mp3")
EndFunc
und hier im anhang, der error, der andauernd kommt
thx schonmal im voraus ![]()