Hallo ich weiß so ein Programm wurde schonmal gepostet(Es macht das meine Mutter auf einen Butten klickt und daraufhin alles bei mir minimiert wird und es erscheint eine jeweilige MsgBox), aber ich möchte sowas gerne selber machen und habe nun ein Problem!
Und zwar findet der Server keine Verbindung zum Clienten!
hier das script vom Server
Spoiler anzeigen
TCPStartup ()
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
_ProgressSim("program", "PC KONTROLLE v1.0", "Bitte warten PC KONTROLLE wird geladen...", "Starten!", 10, 1)
[/autoit] [autoit][/autoit] [autoit]Func program()
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Pc Kontrolle v1.0", 373, 301, 196, 130)
$Label1 = GUICtrlCreateLabel("PC KONTROLLE", 56, 16, 271, 53)
GUICtrlSetFont(-1, 26, 800, 2, "Comic Sans MS")
$Group1 = GUICtrlCreateGroup("Kontrollaktionen", 8, 72, 145, 217)
$Button1 = GUICtrlCreateButton("Ausmachen", 16, 88, 129, 41, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS")
$Button2 = GUICtrlCreateButton("Auflegen", 16, 136, 129, 41, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS")
$Button3 = GUICtrlCreateButton("Antreten", 16, 184, 129, 41, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS")
$Button4 = GUICtrlCreateButton("Ins Bett", 16, 232, 129, 49, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button5 = GUICtrlCreateButton("Nachricht senden", 176, 136, 185, 33, $WS_GROUP)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
$Button6 = GUICtrlCreateButton("Verbindung testen", 176, 88, 185, 33, $WS_GROUP)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
$Label2 = GUICtrlCreateLabel("Made by Elbolamier", 184, 216, 156, 27)
GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$TCPL = TCPListen (TCPNameToIP("user-mts"), 34567)
Do
$TCPA = TCPAccept($TCPL)
Until $TCPA <> -1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
TCPSend ($TCPA,"Ausmachen")
Case $button2
TCPSend ($TCPA,"Auflegen")
Case $button3
TCPSend ($TCPA,"Antreten")
Case $Button4
TCPSend ($TCPA,"Bett")
Case $Button5
TCPSend ($TCPA,InputBox("PC KONTROLLE v1.0","Bitte gebe eine Nachricht ein."))
Case $Button6
$Ping = Ping ("Regenbogen-PC")
if $Ping <> 0 Then
MsgBox (64,"PC KONTROLLE v1.0","Fabian ist am Pc und hat eine bestehende Internetverbindung.")
Else
MsgBox (64,"PC KONTROLLE v1.0","Fabian ist entweder nicht am Pc oder hat keine bestehende Internetverbindung.")
EndIf
EndSwitch
WEnd
EndFunc ;==>program
Func _ProgressSim($func, $titel, $text, $button = "Start!", $step = 1, $speed = 1)
Local $Sleep = $speed * 1000
Local $i
#Region ### START Koda GUI section ### Form=
Local $Form1 = GUICreate($titel, 474, 98, 192, 124)
Local $Progress1 = GUICtrlCreateProgress(8, 64, 457, 25)
Local $Button1 = GUICtrlCreateButton($button, 352, 16, 113, 25, $WS_GROUP)
GUICtrlSetState (-1,$GUI_DISABLE)
Local $Label1 = GUICtrlCreateLabel($text, 8, 8, 332, 44)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 0 To 100 Step $step
GUICtrlSetData ($Progress1,$i)
Sleep ($Sleep)
Next
GUICtrlSetState ($Button1,$GUI_ENABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState (@SW_HIDE,$Form1)
Call ($func)
EndSwitch
WEnd
EndFunc
und hier der client
Spoiler anzeigen
TCPStartup()
Do
$Connect = TCPConnect(TCPNameToIP("user-mts"),34567)
Until $Connect <> -1
While 1
Do
$Recv = TCPRecv($Connect, 9999)
Until $Recv <> ""
If $Recv = "Ausmachen" Then
WinMinimizeAll()
MsgBox (0,"MUTTER NERVT!","Bitte mach jetzt den Pc aus!")
ElseIf $Recv = "Auflegen" Then
WinMinimizeAll()
MsgBox(0,"Mutter nervt","Bitte leg jetzt auf!")
ElseIf $Recv = "Antreten" Then
WinMinimizeAll()
MsgBox (0,"Mutter nervt","Bitte komm mal rüber")
ElseIf $Recv = "Bett" Then
WinMinimizeAll()
MsgBox (0,"Mutter nervt","Bitte geh jetzt ins Bett")
Else
WinMinimizeAll()
MsgBox (0,"Mutter nervt immer noch",$Recv)
EndIf
$Recv = ""
WEnd
ich bitte um hilfe