HomeChatter

  • Bei diesem Script kommt immer :

    Spoiler anzeigen

    >C:\Spiele\AutoIt3\SciTE\..\au3check.exe "C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3"
    AutoIt3 Syntax Checker v1.54.8 Copyright (c) Tylo 2007

    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(143,31) : WARNING: $set1name: possibly used before declaration.
    $set1 = GUICtrlRead($set1name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(144,31) : WARNING: $set2name: possibly used before declaration.
    $set2 = GUICtrlRead($set2name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(145,30) : WARNING: $set1ip: possibly used before declaration.
    $set1i = GUICtrlRead($set1ip)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(146,30) : WARNING: $set2ip: possibly used before declaration.
    $set2i = GUICtrlRead($set2ip)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(147,28) : WARNING: $Radio1: possibly used before declaration.
    $Rad = GUICtrlRead($Radio1)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(156,51) : ERROR: syntax error
    IniWrite("Config.ini","Namen","2Name",""&$set2""
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(159,32) : WARNING: $Form1_1: possibly used before declaration.
    GUISetState(@SW_HIDE,$Form1_1)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3(143,31) : ERROR: $set1name: undeclared global variable.
    $set1 = GUICtrlRead($set1name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\TC\Desktop\Skripte\Nerver3000\HomerChatter.au3 - 2 error(s), 6 warning(s)
    >Exit code: 2 Time: 0.420


    Das Script is hier :

    Spoiler anzeigen
    [autoit]


    If Not FileExists("config.ini") Then
    IniWrite("Config.ini","Namen","1Name","z.B. Gerd")
    IniWrite("Config.ini","Namen","2Name","z.B. Hans")
    IniWrite("Config.ini","IP","1IP","192.")
    IniWrite("Config.ini","IP","2IP","192.")
    IniWrite("Config.ini","Sound","type","1")
    EndIf
    $sound = IniRead("Config.ini","Sound","type","")
    $ip1 = INIread("Config.ini", "IP", "1IP", "")
    $ip2 = INIread("Config.ini", "IP", "2IP", "")
    $name1 = INIread("Config.ini", "Namen", "1Name", "")
    $name2 = INIread("Config.ini", "Namen", "2Name", "")
    TCPStartup()
    $Socket = TCPListen(@IPAddress1,3000)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>
    Opt("GUIOnEventMode", 1)
    Opt("TrayOnEventMode",1)
    Opt("TrayMenuMode",1)
    Beep(3000,25)

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

    $Form1 = GUICreate("HomeChatter", 447, 210, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    $input2 = GUICtrlCreateInput("", 32, 64, 265, 21)
    $Label1 = GUICtrlCreateLabel("HomeChatter", 88, 0, 150, 30)
    GUICtrlSetFont($Label1, 18, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel(""&$name2&":", 32, 40, 36, 17)
    $Button2 = GUICtrlCreateButton("Senden", 96, 88, 137, 33, $WS_GROUP)
    GUICtrlSetOnEvent($Button2, "Button2Click")
    $input1 = GUICtrlCreateInput("", 32, 138, 265, 21)
    $Label3 = GUICtrlCreateLabel(""&$name1&":", 32, 114, 34, 17)
    $sendenbutton = GUICtrlCreateButton("Senden", 96, 162, 137, 33, $WS_GROUP)
    GUICtrlSetOnEvent($sendenbutton, "Button1Click")
    $Group1 = GUICtrlCreateGroup("Tools", 304, 8, 121, 201)
    $versteck = GUICtrlCreateButton("Fenster verstecken", 304, 90, 120, 25, $WS_GROUP)
    GUICtrlSetOnEvent($versteck, "Weg")
    $Label4 = GUICtrlCreateLabel("Einfach die Nachricht eintippen und senden, aber bitte mit Namen", 312, 24, 93, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW,$Form1)
    $Settings = GUICtrlCreateButton("Settings", 320, 176, 89, 25, $WS_GROUP)
    GUICtrlSetOnEvent($Settings, "SettingsClick")

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

    $exit = TrayCreateItem("Fenster wiederholen")
    TrayItemSetOnEvent(-1,"SpecialEvent")

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

    While 1

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

    $NewSocket = TCPAccept($Socket)
    If $NewSocket >= 0 then
    Do
    $Empfang = TCPRecv($NewSocket,2048)
    Until $Empfang <> ""
    SoundSetWaveVolume(100)
    If $sound = 1 Then
    SoundPlay(@WindowsDir & "\media\tada.wav",1)
    Else
    Beep(2000,50)
    Beep(1000,50)
    Beep(3000,25)
    EndIf
    MsgBox(0,"Neue Nachricht",$Empfang)

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

    EndIf

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

    Sleep(100)
    WEnd

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

    Func Form1Close()
    TCPCloseSocket ($Socket)
    TCPShutdown()
    Exit
    EndFunc
    Func SpecialEvent()

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

    GUISetState(@SW_SHOW,$Form1)

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

    EndFunc

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

    Func Weg()
    TrayTip("HomeChatter","Hier kannst du das Fenster wiederholen",10)
    GUISetState(@SW_HIDE,$Form1)
    EndFunc

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

    Func Button1Click()
    $text = GUICtrlRead($input1)
    TCPStartup()
    $Connect = TCPConnect($ip1,3000)
    TCPSend ($Connect,$Text)
    TCPCloseSocket($Connect)
    TCPShutdown()
    Beep(1000,100)
    EndFunc
    Func Button2Click()
    $text = GUICtrlRead($input2)
    TCPStartup()
    $Connect = TCPConnect($ip2,3000)
    TCPSend ($Connect,$Text)
    TCPCloseSocket($Connect)
    TCPShutdown()
    Beep(1000,100)
    EndFunc

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

    Func SettingsClick()

    $Form1_1 = GUICreate("Settings", 220, 209, 192, 124)
    GUICtrlCreateLabel("1Name", 8, 16, 38, 17)
    $set1name = GUICtrlCreateInput("z.B. Otto", 8, 32, 89, 21)
    GUICtrlCreateLabel("2Name", 112, 16, 38, 17)
    $set2name = GUICtrlCreateInput("z.B. Hans", 112, 32, 89, 21)
    GUICtrlCreateLabel("1IP", 8, 64, 20, 17)
    $set1ip = GUICtrlCreateInput("192.", 8, 80, 89, 21)
    GUICtrlCreateLabel("2IP", 112, 64, 20, 17)
    $set2ip = GUICtrlCreateInput("192", 112, 80, 89, 21)
    GUICtrlCreateLabel("Sound", 88, 112, 35, 17)
    $Radio1 = GUICtrlCreateRadio("Wav", 24, 136, 81, 25)
    $Radio2 = GUICtrlCreateRadio("Beep", 111, 134, 81, 25)
    $Sichern = GUICtrlCreateButton("Sichern", 112, 170, 105, 33, $WS_GROUP)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 5, 170, 97, 33, $WS_GROUP)
    GUICtrlSetOnEvent($Sichern, "Sichern")
    GUICtrlSetOnEvent($Sichern, "Abbrechen")
    GUISetState(@SW_SHOW,$Form1_1)
    GUICtrlSetState($Radio1, $GUI_CHECKED)

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




    EndFunc

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

    Func Sichern()
    $set1 = GUICtrlRead($set1name)
    $set2 = GUICtrlRead($set2name)
    $set1i = GUICtrlRead($set1ip)
    $set2i = GUICtrlRead($set2ip)
    $Rad = GUICtrlRead($Radio1)
    If GUICtrlRead($Rad) = 1 Then
    IniWrite("Config.ini","Sound","type","1")
    Else
    IniWrite("Config.ini","Sound","type","2")
    EndIf

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

    IniWrite("Config.ini","Namen","1Name",""&$set1&"")
    IniWrite("Config.ini","Namen","2Name",""&$set2"")
    IniWrite("Config.ini","IP","1IP",""&$set1i&"")
    IniWrite("Config.ini","IP","2IP",""&$set2i&"")
    GUISetState(@SW_HIDE,$Form1_1)
    EndFunc

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

    Func Abbrechen()
    GUISetState(@SW_HIDE,$Form1_1)
    EndFunc

    [/autoit]


    Brauch keine schnellen Antworten bin 2wochen in Urlaub 8)

  • Hallo Trojan,

  • Spoiler anzeigen
    [autoit]

    If Not FileExists("config.ini") Then
    IniWrite("Config.ini","Namen","1Name","z.B. Gerd")
    IniWrite("Config.ini","Namen","2Name","z.B. Hans")
    IniWrite("Config.ini","IP","1IP","192.")
    IniWrite("Config.ini","IP","2IP","192.")
    IniWrite("Config.ini","Sound","type","1")
    EndIf
    $sound = IniRead("Config.ini","Sound","type","")
    $ip1 = INIread("Config.ini", "IP", "1IP", "")
    $ip2 = INIread("Config.ini", "IP", "2IP", "")
    $name1 = INIread("Config.ini", "Namen", "1Name", "")
    $name2 = INIread("Config.ini", "Namen", "2Name", "")
    TCPStartup()
    $Socket = TCPListen(@IPAddress1,3000)
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>
    Opt("GUIOnEventMode", 1)
    Opt("TrayOnEventMode",1)
    Opt("TrayMenuMode",1)
    Beep(3000,25)
    Global $set1name,$set2name,$set1ip,$set2ip,$Radio1,$Form1_1
    $Form1 = GUICreate("HomeChatter", 447, 210, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    $input2 = GUICtrlCreateInput("", 32, 64, 265, 21)
    $Label1 = GUICtrlCreateLabel("HomeChatter", 88, 0, 150, 30)
    GUICtrlSetFont($Label1, 18, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel(""&$name2&":", 32, 40, 36, 17)
    $Button2 = GUICtrlCreateButton("Senden", 96, 88, 137, 33, $WS_GROUP)
    GUICtrlSetOnEvent($Button2, "Button2Click")
    $input1 = GUICtrlCreateInput("", 32, 138, 265, 21)
    $Label3 = GUICtrlCreateLabel(""&$name1&":", 32, 114, 34, 17)
    $sendenbutton = GUICtrlCreateButton("Senden", 96, 162, 137, 33, $WS_GROUP)
    GUICtrlSetOnEvent($sendenbutton, "Button1Click")
    $Group1 = GUICtrlCreateGroup("Tools", 304, 8, 121, 201)
    $versteck = GUICtrlCreateButton("Fenster verstecken", 304, 90, 120, 25, $WS_GROUP)
    GUICtrlSetOnEvent($versteck, "Weg")
    $Label4 = GUICtrlCreateLabel("Einfach die Nachricht eintippen und senden, aber bitte mit Namen", 312, 24, 93, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW,$Form1)
    $Settings = GUICtrlCreateButton("Settings", 320, 176, 89, 25, $WS_GROUP)
    GUICtrlSetOnEvent($Settings, "SettingsClick")

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

    $exit = TrayCreateItem("Fenster wiederholen")
    TrayItemSetOnEvent(-1,"SpecialEvent")

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

    While 1

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

    $NewSocket = TCPAccept($Socket)
    If $NewSocket >= 0 then
    Do
    $Empfang = TCPRecv($NewSocket,2048)
    Until $Empfang <> ""
    SoundSetWaveVolume(100)
    If $sound = 1 Then
    SoundPlay(@WindowsDir & "\media\tada.wav",1)
    Else
    Beep(2000,50)
    Beep(1000,50)
    Beep(3000,25)
    EndIf
    MsgBox(0,"Neue Nachricht",$Empfang)

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

    EndIf

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

    Sleep(100)
    WEnd

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

    Func Form1Close()
    TCPCloseSocket ($Socket)
    TCPShutdown()
    Exit
    EndFunc
    Func SpecialEvent()

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

    GUISetState(@SW_SHOW,$Form1)

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

    EndFunc

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

    Func Weg()
    TrayTip("HomeChatter","Hier kannst du das Fenster wiederholen",10)
    GUISetState(@SW_HIDE,$Form1)
    EndFunc

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

    Func Button1Click()
    $text = GUICtrlRead($input1)
    TCPStartup()
    $Connect = TCPConnect($ip1,3000)
    TCPSend ($Connect,$Text)
    TCPCloseSocket($Connect)
    TCPShutdown()
    Beep(1000,100)
    EndFunc
    Func Button2Click()
    $text = GUICtrlRead($input2)
    TCPStartup()
    $Connect = TCPConnect($ip2,3000)
    TCPSend ($Connect,$Text)
    TCPCloseSocket($Connect)
    TCPShutdown()
    Beep(1000,100)
    EndFunc

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

    Func SettingsClick()

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

    $Form1_1 = GUICreate("Settings", 220, 209, 192, 124)
    GUICtrlCreateLabel("1Name", 8, 16, 38, 17)
    $set1name = GUICtrlCreateInput("z.B. Otto", 8, 32, 89, 21)
    GUICtrlCreateLabel("2Name", 112, 16, 38, 17)
    $set2name = GUICtrlCreateInput("z.B. Hans", 112, 32, 89, 21)
    GUICtrlCreateLabel("1IP", 8, 64, 20, 17)
    $set1ip = GUICtrlCreateInput("192.", 8, 80, 89, 21)
    GUICtrlCreateLabel("2IP", 112, 64, 20, 17)
    $set2ip = GUICtrlCreateInput("192", 112, 80, 89, 21)
    GUICtrlCreateLabel("Sound", 88, 112, 35, 17)
    $Radio1 = GUICtrlCreateRadio("Wav", 24, 136, 81, 25)
    $Radio2 = GUICtrlCreateRadio("Beep", 111, 134, 81, 25)
    $Sichern = GUICtrlCreateButton("Sichern", 112, 170, 105, 33, $WS_GROUP)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 5, 170, 97, 33, $WS_GROUP)
    GUICtrlSetOnEvent($Sichern, "Sichern")
    GUICtrlSetOnEvent($Sichern, "Abbrechen")
    GUISetState(@SW_SHOW,$Form1_1)
    GUICtrlSetState($Radio1, $GUI_CHECKED)

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

    EndFunc

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

    Func Sichern()
    $set1 = GUICtrlRead($set1name)
    $set2 = GUICtrlRead($set2name)
    $set1i = GUICtrlRead($set1ip)
    $set2i = GUICtrlRead($set2ip)
    $Rad = GUICtrlRead($Radio1)
    If GUICtrlRead($Rad) = 1 Then
    IniWrite("Config.ini","Sound","type","1")
    Else
    IniWrite("Config.ini","Sound","type","2")
    EndIf

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

    IniWrite("Config.ini","Namen","1Name",""&$set1&"")
    IniWrite("Config.ini","Namen","2Name",""&$set2&"")
    IniWrite("Config.ini","IP","1IP",""&$set1i&"")
    IniWrite("Config.ini","IP","2IP",""&$set2i&"")
    GUISetState(@SW_HIDE,$Form1_1)
    EndFunc

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

    Func Abbrechen()
    GUISetState(@SW_HIDE,$Form1_1)
    EndFunc

    [/autoit]

    mfg. Jam00