Hilfe Chat

  • Ich bräuchte Hilfe bei meinem Chatprogramm.
    Das Problem ist: wenn ich auf meinen eigenen PC damit connecte funktioniert es einwandfrei, aber wenn ich das mit meinen Kumpel über Hamachi versuche klappt es nicht ?(
    link: http://tngpcfreak.tn.funpic.de/Chat.au3

    Weiss selber nicht was falsch sein soll.thx schonmal im vorraus :)

    Mfg. PCKing


    Mein PC

    CPU: AMD FX 8350 8x4.00GHz
    Ram: 8GB DDR3
    Grafikkarte: Nvidia Geforce GTX 960 (4GB)
    Festplatten: 500GB SSD 1TB HDD
    Laufwerk: Blueray RW+ Brenner

  • Hallo PCKing,

    stell dein Skript direkt in dem Beitrag (mit Spoiler- und AutoIt-TAGs) ein, dann bekommst du schneller Hilfe, da man das Skript auch online sichten kann. Der Link funktioniert übrigens nicht, aber auch dafür gibt es spezielle TAGs

    Edit: sehe gerade, dies ist dein 1. Beitrag, herzlich willkommen im Forum. Die TAGs befinden sich direkt über dem Eingabefeld. Manchmal musst du allerdings auch auf Vorschau (unterhlb des Beitrags) klicken, damit sie erscheinen

    mfg (Auto)Bert

    Einmal editiert, zuletzt von AutoBert (8. Oktober 2009 um 23:34)

  • naja, dann versuche ichs mal so:

    [autoit]

    #include <GUIConstants.au3>
    #Include <File.au3>
    $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
    $ip1 = @IPAddress1
    TCPStartup()
    $ip = InputBox("IP","Server-IP eingeben")
    If @error = 1 Then Exit
    start()
    Func start()
    $main = TCPListen($ip1,50,1)
    $socket = -1
    Do
    $socket = TCPAccept($main)
    $socket2 = TCPConnect($ip,50)
    Until $socket <> -1 Or $socket2 <> -1
    GUICreate("Chat",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
    Do
    $socket = TCPAccept($main)
    Until $socket <> -1
    Case $socket2 = -1
    Do
    $socket2 = TCPConnect($ip,50)
    Until $socket2 <> -1
    Case $recive <> ""
    FileClose($openlog)
    $openlog3 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",1)
    $writelog = FileWriteLine($openlog3, $recive)
    FileClose($openlog)
    $openlog2 = FileOpen(@WindowsDir & "/Chat/" & @MDAY & "." & @MON & "." & @YEAR & ".txt",0)
    $readlog = FileRead($openlog2)
    GUICtrlSetData($edit, $readlog)
    Case $msg = $button
    TCPSend($socket2, @ComputerName & " -> " & $send & " (" & @HOUR & ":" & @MIN & ":" & @SEC & ")")
    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func OnAutoItExit()
    TCPShutdown()
    FileClose($openlog)
    EndFunc

    [/autoit]

    hoffe mir kann jetzt jemand helfen^^

    Mfg. PCKing


    Mein PC

    CPU: AMD FX 8350 8x4.00GHz
    Ram: 8GB DDR3
    Grafikkarte: Nvidia Geforce GTX 960 (4GB)
    Festplatten: 500GB SSD 1TB HDD
    Laufwerk: Blueray RW+ Brenner

  • Hi,
    du musst bei der variablen ip2 und bei der inputbox (ip) die hamachiip eingeben.
    viele gruesse!
    Jakolo

    p.s. sry fuer ue anstadt dem umlaut bin grad in der usa und die ham da nicht so was.

  • Thx für die antwort, hab es jetzt zum funktionieren gebracht :thumbup:

    Mfg. PCKing


    Mein PC

    CPU: AMD FX 8350 8x4.00GHz
    Ram: 8GB DDR3
    Grafikkarte: Nvidia Geforce GTX 960 (4GB)
    Festplatten: 500GB SSD 1TB HDD
    Laufwerk: Blueray RW+ Brenner