1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Griss

Beiträge von Griss

  • Autoit CMD ansprechen.

    • Griss
    • 11. November 2010 um 18:26

    hi,

    habe ich bereits gemacht.

    Das Fenster bekommt zwar das Autoit zeichen oben links aber es kommt keine nachricht.

    Code:

    [autoit]

    #NoTrayIcon
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=PingTool_CMD.ico
    #AutoIt3Wrapper_Change2CUI=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    ConsoleWrite("HALLO")

    [/autoit]

    Batch:

    Code
    start CMD.exe 
    pause
  • Autoit CMD ansprechen.

    • Griss
    • 11. November 2010 um 16:56

    hi,

    ja ist nur ein beispiel aber die Autoit (exe) soll das senden.

    MfG
    Griss

  • Autoit CMD ansprechen.

    • Griss
    • 11. November 2010 um 16:03

    hi,

    ich glaub meine Frage wurde miss verstanden.

    Ich führe eine Autoit (convertiert in exe) mit einer Bat aus die bat hat ein "pause" am schluss
    und solle jetzt etwas gesendet bekommen wie z. B. "Fertig..." mit einer Ausage wie mit "Echo".

    MfG
    Griss

  • Autoit CMD ansprechen.

    • Griss
    • 11. November 2010 um 15:52

    Hi,

    wie kann ich mit Autoit eine CMD ansprechen?

    z. B. Ich habe mir ein script geschrieben das die cmdline ausliest.
    Nun sollte Autoit sowas wie "Fertig" and die CMD schreiben.
    Und das soll dann im CMD fenster stehen.

    MfG
    Griss

  • IniRead Problem

    • Griss
    • 29. August 2010 um 20:47

    Hi,

    danke für die Schnelle Hilfe.


    MfG

    Griss

  • IniRead Problem

    • Griss
    • 29. August 2010 um 17:44

    hi,

    kann ich das nicht i-wie machen das des kein string ist?

  • IniRead Problem

    • Griss
    • 29. August 2010 um 17:23

    hi,

    Ich habe ein kleines Problem mit "Iniread" unzwar werden einige Variablen in einer ini ausgelagert aber nicht wieder richtig ausgelsen.

    Unzwar wird z. B. die Variable $sound "false" gesetzt blos wenn ich das jetzt mit "if" überprüfe stimmt die beingung aufeinmal.

    Aber wenn ich das ganze aber in einer "Msgbox" ausgeben lasse wird es mir false angezeigt.

    Spoiler anzeigen
    [autoit]

    _load_settings()

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

    func _load_settings()
    $sound = iniread("config.ini","Settings","sound","False")
    $msg = iniread("config.ini","Settings","msg","True")
    $Weck_Sound = iniread("config.ini","Settings","Weck_Sound","False")
    $shut = iniread("config.ini","Settings","shut","False")
    $shutdown = iniread("config.ini","Settings","shutdown","False")
    $restart = iniread("config.ini","Settings","restart","False")
    $sleep = iniread("config.ini","Settings","sleep","False")
    if $sound = True Then msgbox(0,"","sound is true")
    if $msg = False Then msgbox(0,"","msg is false")
    if $Weck_sound = True Then msgbox(0,"","Weck_sound is true")
    if $shut = True Then msgbox(0,"","shut is true")
    if $shutdown = True Then msgbox(0,"","shutdown is true")
    if $restart = True Then msgbox(0,"","restart is true")
    if $sleep = True Then msgbox(0,"","sleep is true")
    EndFunc

    [/autoit]


    Und hier die ini.

    Spoiler anzeigen
    Code
    [Settings] 
    sound=False 
    msg=True 
    Weck_Sound=False 
    shut=False 
    shutdown=False 
    restart=False 
    sleep=False
  • 4 Gewinnt

    • Griss
    • 2. April 2009 um 15:17

    hi,
    ich hab noch ein paar sachen verbessert - eingebaut.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <StaticConstants.au3>
    Opt("GuiOnEventMode", 1)

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

    Local $Ok = False, $spieler = True
    Local $input[42], $button[7], $mItem[4], $plName[2], $runde = 0
    Global $rowY[7], $rowX[6][8], $rowZ1[9][39], $rowZ2[6][42]

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

    GUICreate("Spieler-Namen", 274, 131)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUICtrlCreateGroup("", 32, 9, 209, 81)
    $plName[0] = GUICtrlCreateInput("Spieler 1", 48, 24, 177, 21)
    $plName[1] = GUICtrlCreateInput("Spieler 2", 48, 56, 177, 21)
    GUICtrlCreateButton("&OK", 96, 96, 73, 25, $BS_DEFPUSHBUTTON)
    GuiCtrlSetOnEvent(-1, "_OkPressed")
    GUISetState(@SW_SHOW)

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

    While Not $Ok
    sleep(200)
    Wend

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

    Func _OkPressed()
    $Ok = True
    GUISetState(@SW_HIDE)
    EndFunc

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

    GUICreate("4 - Gewinnt", 593, 314, 210, 175)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    $Menu = GuiCtrlCreateMenu("&Menu")
    $mItem[1] = GUICtrlCreateMenuItem("Neues Spiel Starten",$menu)
    GuiCtrlSetOnEvent(-1, "_Neu")
    $mItem[2] = GUICtrlCreateMenuItem("Beenden",$menu)
    GuiCtrlSetOnEvent(-1, "_Exit")
    $about = GuiCtrlCreateMenu("&About")
    For $i = 0 To Ubound ($Button) -1
    $Button[$i] = GUICtrlCreateButton("Feld " & $i+1, 24 + $i * 64, 8, 49, 33, 0)
    GuiCtrlSetOnEvent(-1, "_ButtonEscape")
    Next
    For $i = 0 To UBound($input) -1
    $Input[$i] = GUICtrlCreateInput(" ", 40 + INT($i/6) * 64 , 56 + Mod($i, 6) * 40, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL, $ES_ReadOnly))
    GUICtrlSetBkColor($Input[$i], 0xFFFFFF)
    Next
    GUISetFont(10, 400, 0, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel("Runde: ", 488, 56, 50, 20, $SS_CENTER)
    $Label2 = GUICtrlCreateLabel("Am zug:", 488, 128, 51, 20, $SS_CENTER)
    GUISetFont(8, 400, 0, "Arial")
    $Label3 = GUICtrlCreateLabel(GuiCtrlRead($plName[0]), 488, 160, 90, 18, $SS_CENTER)
    $Label4 = GUICtrlCreateLabel($runde, 488, 88, 90, 18, $SS_CENTER)
    GUISetState(@SW_SHOW)

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

    While 1
    sleep(200)
    Wend

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

    Func _ButtonEscape()
    For $i = 0 To Ubound ($Button) -1
    If @GUI_CtrlId = $Button[$i] Then
    If $spieler Then
    $rowY[$i] = $rowY[$i] & "X"
    _SetItems($i)
    Else
    $rowY[$i] = $rowY[$i] & "O"
    _SetItems($i)
    EndIf
    EndIf
    Next
    $spieler = Not $spieler
    $runde += 1
    GuiCtrlSetdata($label4, $runde)
    GuiCtrlSetData($Label3, GuiCtrlRead($plName[Mod($runde+2,2)]))
    EndFunc

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

    Func _SetItems($i)
    $rowYSplit = StringSplit($rowY[$i], "")
    For $j = ((7 + ($i + 1)) * 6 - Ubound ($input)) - 6 To (Ubound ($input) - (7 - ($i + 1)) * 6) - 1
    If $j - ((7 + ($i + 1)) * 6 - Ubound ($input)) +6 < $rowYsplit[0] Then
    GuiCtrlSetData($input[($i+1)*5 - Mod($j,6)+ ($i > 0) * $i],$rowYsplit[$j - ((7 + ($i + 1)) * 6 - Ubound ($input))+6+1])
    EndIf
    Next
    If GuiCtrlRead( $input[((7 + ($i + 1)) * 6 - Ubound ($input))-6] ) <> " " Then
    GuiCtrlSetState($Button[$i], $Gui_Disable)
    Endif
    _Results()
    EndFunc

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

    Func _Results()
    For $k = 0 To Ubound($rowY) - 1
    If StringInStr($rowY[$k], "XXXX") Then
    MsgBox(0,"Ergebnis!", GuiCtrlRead($plName[0]) &" hat das Spiel gewonnen!"& @crlf &"In der Runde: " & $runde + 1)
    _Disable()
    ElseIf StringInStr($rowY[$k], "OOOO") Then
    MsgBox(0,"Ergebnis!", GuiCtrlRead($plName[1]) &" hat das Spiel gewonnen!"& @crlf &"In der Runde: " & $runde + 1)
    _Disable()
    EndIf
    Next
    For $l = 0 To 5
    For $m = $l To $l + 36 Step +6
    $rowX[$l][$m/6] = GuiCtrlRead($input[$m])
    Next
    $rowX[$l][0] = $rowX[$l][0] & $rowX[$l][1] & $rowX[$l][2] & $rowX[$l][3] & $rowX[$l][4] & $rowX[$l][5] & $rowX[$l][6]
    _WinnerEscape($rowX[$l][0])
    Next
    For $n = 0 To 5
    For $o = $n + ($n > 2) * Int($n/2) * $n + ($n > 4) * 3 To ($n < 3) * 35 - ($n < 3) * 6 * $n + ($n > 2) * 41 - ($n > 2) * ($n - 3) step +7
    $rowZ2[$n][$o] = GuiCtrlRead($input[$o])
    Next
    $z = $n + ($n > 2) * Int($n/2) * $n + ($n > 4) * 3
    For $p = 1 To (((($n < 3) * 35 - ($n < 3) * 6 * $n + ($n > 2) * 41 - ($n > 2) * ($n - 3))-$z) / 7)+1
    $rowZ2[$n][0] = $rowZ2[$n][0] & $rowZ2[$n][$z]
    $z += 7
    Next
    _WinnerEscape($rowZ2[$n][0])
    For $q = 0 To 5
    $rowZ2[$q][0] = ""
    Next
    Next
    For $n = 3 To 8
    For $o = $n + ($n > 5) * Mod($n,5) * 5 To ($n < 6) * ($n + ($n * 5)) + (($n > 5) * 30 + ($n > 5) * $n) step +5
    $rowZ1[$n][$o] = GuiCtrlRead($input[$o])
    Next
    $z = $n + ($n > 5) * Mod($n,5) * 5
    For $p = 1 To ((($n < 6) * ($n + ($n * 5)) + (($n > 5) * 30 + ($n > 5) * $n)-$z)/5)+1
    $rowZ1[$n][0] = $rowZ1[$n][0] & $rowZ1[$n][$z]
    $z += 5
    Next
    _WinnerEscape($rowZ1[$n][0])
    For $q = 3 To 8
    $rowZ1[$q][0] = ""
    Next
    Next
    EndFunc

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

    Func _WinnerEscape($hRow)
    If StringInStr($hRow, "XXXX") Then
    MsgBox(0,"Ergebnis!", GuiCtrlRead($plName[0]) &" hat das Spiel gewonnen!"& @crlf &"In der Runde: " & $runde + 1)
    _Disable()
    ElseIf StringInStr($hRow, "OOOO") Then
    MsgBox(0,"Ergebnis!", GuiCtrlRead($plName[1]) &" hat das Spiel gewonnen!"& @crlf &"In der Runde: " & $runde + 1)
    _Disable()
    EndIf
    EndFunc

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

    Func _Exit()
    Exit
    EndFunc

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

    Func _Neu()
    For $i = 0 To UBound($input) -1
    If $i < 7 Then
    GuiCtrlSetState($button[$i], $Gui_Enable)
    $rowY[$i] = ""
    EndIf
    GUICtrlSetData($Input[$i], " ")
    Next
    $runde = 0
    $spieler = $plName[0]
    GuiCtrlSetdata($label4, $runde)
    GuiCtrlSetData($Label3, GuiCtrlRead($plName[Mod($runde+2,2)]))
    EndFunc

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

    func _Disable()
    for $i = 0 to Ubound($button) -1
    GuiCtrlSetState($Button[$i], $Gui_Disable)
    Next
    endfunc

    [/autoit]


    Das nächste wäre vllt. einen Bot zu machen :D aber ich habe keine Ahnung wie ich das anfang soll.^^
    Dann vllt. noch ein Desing... aber erstmal ein Bot.

  • 4 Gewinnt

    • Griss
    • 1. April 2009 um 21:46

    hi,
    ich komme nicht weiter ^^
    ich wüsste zwar wie ich es machen könnte aber das wird dann wieder so lang.^^
    :edit
    ja weil ich es selbst rausgefunden habe und oben geschaut habe.

  • 4 Gewinnt

    • Griss
    • 1. April 2009 um 20:36

    hi,
    danke das du dir die mühe gemacht hast das script zu verbesser und eine erklärung zu schreiben!
    Und das script braucht auch viel weniger cpu auslastung ^^
    Nur leider ist es nicht möglich schräg zu gewinnen.
    Ich werde es mal selbst versuchen...

  • 4 Gewinnt

    • Griss
    • 1. April 2009 um 00:43

    hi,
    ja du hast recht mein code is nicht gerade kleine gehalten aber is ja auch eins meiner ersten Programme (Spiele).
    Nur leider verstehe ich deinen code teils nicht^^
    Bin noch anfänger... ^^
    Was bringt z. B. das?

    [autoit]

    Func _SetItems($i)
    $rowSplit = StringSplit($row[$i], "")
    For $j = ((7 + ($i + 1)) * 6 - Ubound ($input)) - 6 To (Ubound ($input) - (7 - ($i + 1)) * 6) - 1
    If $j - ((7 + ($i + 1)) * 6 - Ubound ($input)) +6 < $rowsplit[0] Then
    GuiCtrlSetData($input[($i+1)*5 - Mod($j,6)+ ($i > 0) * $i],$rowsplit[$j - ((7 + ($i + 1)) * 6 - Ubound ($input))+6+1])
    EndIf
    Next
    EndFunc

    [/autoit]
  • 4 Gewinnt

    • Griss
    • 31. März 2009 um 22:14

    hi,
    dann geht der rest vom code nicht mehr :D ...
    Aus irgendeinen Grund muss ich immer einen array mehr nehmen sonst funktionierts nicht.

  • 4 Gewinnt

    • Griss
    • 31. März 2009 um 21:54

    Komisch es wird immer ein button und ein feld (edit) zuviel erstellt.

  • 4 Gewinnt

    • Griss
    • 31. März 2009 um 21:16

    Danke hab ich ganz vergessen das ich des auch so machen kann.
    Habe aber immer noch das Problem das es immer spieler 2 gewinnt...

  • 4 Gewinnt

    • Griss
    • 31. März 2009 um 17:53

    hi,
    1. ich hab ein kleines 4 Gewinnt gemacht nur habe ich einen fehler i-wie gewinnt immer spieler 2
    2. vllt noch ein paar verbesserungsmöglichkeiten

    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.0.0
    Author: Griss

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

    Script Function: 4 Gewinnt
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #include <GUIConstants.au3>
    #include <EditConstants.au3>
    #include <ButtonConstants.au3>
    #include <StaticConstants.au3>

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

    dim $input[43]
    dim $button[8]
    dim $inp[43]
    dim $spieler = 1, $runde = 0
    dim $spalteh[8][7]
    dim $spaltev[7][8]
    dim $vsplate[7]
    dim $hsplate[8]
    dim $spaltero[13][13]
    dim $spaltelo[13][13]
    dim $lospalte[13]
    dim $rospalte[13]
    dim $mitem[4]

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

    #Region gui
    $Form2 = GUICreate("Spieler Name", 274, 131)
    $GroupBox1 = GUICtrlCreateGroup("", 32, 9, 209, 81)
    $Input1 = GUICtrlCreateInput("Spieler 1", 48, 24, 177, 21)
    $Input2 = GUICtrlCreateInput("Spieler 2", 48, 56, 177, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 96, 96, 73, 25, $BS_DEFPUSHBUTTON)
    GUISetState(@SW_SHOW)
    #EndRegion gui

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

    while 1
    $msg = guigetmsg()

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

    if $msg = $GUI_EVENT_CLOSE then Exit

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

    if $msg = $Button1 Then
    $Namesp1 = guictrlread($Input1)
    $Namesp2 = guictrlread($Input2)
    guictrlsetstate($Form2, @sw_hide)
    ExitLoop
    endif
    wend

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

    #Region ### START Koda GUI section ### Form=e:\dokumente und einstellungen\griss\desktop\koda_1.7.0.1\forms\4gewinnt verbessert2.kxf
    $Form1_1 = GUICreate("Form1", 593, 314, 210, 175)
    $Menu = GuiCtrlCreateMenu("&Menu")
    $mitem[1] = GUICtrlCreateMenuItem("Neues Spiel Starten",$menu)
    $mitem[2] = GUICtrlCreateMenuItem("Beenden",$menu)
    $about = GuiCtrlCreateMenu("&About")
    $Button[1] = GUICtrlCreateButton("Feld 1", 24, 8, 49, 33, 0)
    $Button[2] = GUICtrlCreateButton("Feld 2", 88, 8, 49, 33, 0)
    $Button[3] = GUICtrlCreateButton("Feld 3", 152, 8, 49, 33, 0)
    $Button[4] = GUICtrlCreateButton("Feld 4", 216, 8, 49, 33, 0)
    $Button[5] = GUICtrlCreateButton("Feld 5", 280, 8, 49, 33, 0)
    $Button[6] = GUICtrlCreateButton("Feld 6", 344, 8, 49, 33, 0)
    $Button[7] = GUICtrlCreateButton("Feld 7", 408, 8, 49, 33, 0)
    $Input[1] = GUICtrlCreateInput("", 40, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[2] = GUICtrlCreateInput("", 40, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[3] = GUICtrlCreateInput("", 40, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[4] = GUICtrlCreateInput("", 40, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[5] = GUICtrlCreateInput("", 40, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[6] = GUICtrlCreateInput("", 40, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[7] = GUICtrlCreateInput("", 104, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[8] = GUICtrlCreateInput("", 104, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[9] = GUICtrlCreateInput("", 104, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[10] = GUICtrlCreateInput("", 104, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[11] = GUICtrlCreateInput("", 104, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[12] = GUICtrlCreateInput("", 104, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[13] = GUICtrlCreateInput("", 168, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[14] = GUICtrlCreateInput("", 168, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[15] = GUICtrlCreateInput("", 168, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[16] = GUICtrlCreateInput("", 168, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[17] = GUICtrlCreateInput("", 168, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[18] = GUICtrlCreateInput("", 168, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[19] = GUICtrlCreateInput("", 232, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[20] = GUICtrlCreateInput("", 232, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[21] = GUICtrlCreateInput("", 232, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[22] = GUICtrlCreateInput("", 232, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[23] = GUICtrlCreateInput("", 232, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[24] = GUICtrlCreateInput("", 232, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[25] = GUICtrlCreateInput("", 296, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[26] = GUICtrlCreateInput("", 296, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[27] = GUICtrlCreateInput("", 296, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[28] = GUICtrlCreateInput("", 296, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[29] = GUICtrlCreateInput("", 296, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[30] = GUICtrlCreateInput("", 296, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[31] = GUICtrlCreateInput("", 360, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[32] = GUICtrlCreateInput("", 360, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[33] = GUICtrlCreateInput("", 360, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[34] = GUICtrlCreateInput("", 360, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[35] = GUICtrlCreateInput("", 360, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[36] = GUICtrlCreateInput("", 360, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[37] = GUICtrlCreateInput("", 424, 56, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[38] = GUICtrlCreateInput("", 424, 96, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[39] = GUICtrlCreateInput("", 424, 136, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[40] = GUICtrlCreateInput("", 424, 176, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[41] = GUICtrlCreateInput("", 424, 216, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Input[42] = GUICtrlCreateInput("", 424, 256, 25, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
    $Label1 = GUICtrlCreateLabel("Runde: ", 488, 56, 50, 20, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("Am zug:", 488, 128, 51, 20, $SS_CENTER)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label3 = GUICtrlCreateLabel(" ", 488, 160, 90, 18, $SS_CENTER)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Label4 = GUICtrlCreateLabel(" ", 488, 88, 90, 18, $SS_CENTER)
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")

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

    for $i = 1 to 42
    ;guictrlsetstate($Input[$i], $GUI_DISABLE)
    GUICtrlSetBkColor($Input[$i], 0xFFFFFF)
    next

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    guictrlsetdata($Label3 , $Namesp1&" [X]")
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")
    guictrlsetdata($Label4 , $runde)
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")

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

    While 1
    $Msg = GUIGetMsg()

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

    for $i = 1 to 42
    $inp[$i] = guictrlread($input[$i])
    if $inp[$i] = "" then $inp[$i] = " "
    next

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

    if $msg = $GUI_EVENT_CLOSE then Exit

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

    if $msg = $mitem[1] Then
    neu()
    EndIf

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

    if $msg = $mitem[2] Then Exit

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

    ;//

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

    for $i = 1 to 7
    if $msg = $button[$i] Then
    $h = $i * 6
    if $spieler = 2 then
    $runde = $runde + 1
    guictrlsetdata($Label3 , $Namesp1&" [X]")
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")
    guictrlsetdata($Label4 , $runde)
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")
    guisetstate(@sw_show)
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    Guictrlsetdata($Input[$h], "O")
    Guictrlsetstate($button[$i],$GUI_DISABLE)
    EndIf
    Guictrlsetdata($Input[$h], "O")
    EndIf
    Guictrlsetdata($Input[$h], "O")
    EndIf
    Guictrlsetdata($Input[$h], "O")
    EndIf
    Guictrlsetdata($Input[$h], "O")
    endif
    Guictrlsetdata($Input[$h], "O")
    $spieler = 1
    elseif $spieler = 1 then
    $runde = $runde + 1
    guictrlsetdata($Label3 , $Namesp2&" [O]")
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")
    guictrlsetdata($Label4 , $runde)
    GUICtrlSetFont(-1, 8, 800, 0, "Arial")
    guisetstate(@sw_show)
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    if $inp[$h] <> " " Then
    $h = $h -1
    Guictrlsetdata($Input[$h], "X")
    Guictrlsetstate($button[$i],$GUI_DISABLE)
    EndIf
    Guictrlsetdata($Input[$h], "X")
    EndIf
    Guictrlsetdata($Input[$h], "X")
    EndIf
    Guictrlsetdata($Input[$h], "X")
    EndIf
    Guictrlsetdata($Input[$h], "X")
    endif
    Guictrlsetdata($Input[$h], "X")
    $spieler = 2
    Guictrlsetdata($Input[$h], "X")
    EndIf
    endif
    next

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

    ;msgbox(0,"",$spieler)

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

    ;// Auswerten

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

    for $k = 1 to 7
    if $k = 1 then $h = 6
    if $k = 2 then $h = 12
    if $k = 3 then $h = 18
    if $k = 4 then $h = 24
    if $k = 5 then $h = 30
    if $k = 6 then $h = 36
    if $k = 7 then $h = 42
    for $i = 1 to 6
    $spalteh[$k][$i] = $inp[$h]
    $h = $h - 1
    next
    next

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

    for $k = 1 to 6
    if $k = 1 then $h = 42
    if $k = 2 then $h = 41
    if $k = 3 then $h = 40
    if $k = 4 then $h = 39
    if $k = 5 then $h = 38
    if $k = 6 then $h = 37
    for $i = 1 to 7
    $spaltev[$k][$i] = $inp[$h]
    $h = $h - 6
    next
    next

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

    for $k = 1 to 12
    if $k = 1 then dim $h = 1, $j = 1
    if $k = 2 then dim $h = 2, $j = 2
    if $k = 3 then dim $h = 3, $j = 3
    if $k = 4 then dim $h = 4, $j = 4
    if $k = 5 then dim $h = 5, $j = 5
    if $k = 6 then dim $h = 6, $j = 6
    if $k = 7 then dim $h = 12, $j = 6
    if $k = 8 then dim $h = 18, $j = 5
    if $k = 9 then dim $h = 24, $j = 4
    if $k = 10 then dim $h = 30, $j = 3
    if $k = 11 then dim $h = 36, $j = 2
    if $k = 12 then dim $h = 42, $j = 1
    for $i = 1 to $j
    $spaltero[$k][$i] = $inp[$h]
    $h = $h + 5
    Next
    next

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

    for $k = 1 to 12
    if $k = 1 then dim $h = 37, $j = 1
    if $k = 2 then dim $h = 31, $j = 2
    if $k = 3 then dim $h = 25, $j = 3
    if $k = 4 then dim $h = 19, $j = 4
    if $k = 5 then dim $h = 13, $j = 5
    if $k = 6 then dim $h = 7, $j = 6
    if $k = 7 then dim $h = 1, $j = 6
    if $k = 8 then dim $h = 2, $j = 5
    if $k = 9 then dim $h = 3, $j = 4
    if $k = 10 then dim $h = 4, $j = 3
    if $k = 11 then dim $h = 5, $j = 2
    if $k = 12 then dim $h = 6, $j = 1
    for $i = 1 to $j
    $spaltelo[$k][$i] = $inp[$h]
    $h = $h + 7
    Next
    next

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

    auswerten()
    WEnd

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

    func auswerten()

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

    for $j = 1 to 6
    for $i = 1 to 7
    $vsplate[$j] = $vsplate[$j] & $spaltev[$j][$i]
    If StringInStr($vsplate[$j], "XXXX") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    If StringInStr($vsplate[$j], "OOOO") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    Next
    Next

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

    for $j = 1 to 7
    for $i = 1 to 6
    $hsplate[$j] = $hsplate[$j] & $spalteh[$j][$i]
    If StringInStr($hsplate[$j], "XXXX") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    If StringInStr($hsplate[$j], "OOOO") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    Next
    Next

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

    for $j = 1 to 12
    for $i = 1 to 12
    $rospalte[$j] = $rospalte[$j] & $spaltero[$j][$i]
    If StringInStr($rospalte[$j], "XXXX") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    If StringInStr($rospalte[$j], "OOOO") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    Next
    Next

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

    for $j = 1 to 12
    for $i = 1 to 12
    $rospalte[$j] = $rospalte[$j] & $spaltelo[$j][$i]
    If StringInStr($rospalte[$j], "XXXX") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    If StringInStr($rospalte[$j], "OOOO") Then
    if $spieler = 2 then $spieler = 1
    if $spieler = 1 then $spieler = 2
    msgbox(0,"Gewonnen","Spieler: "&$spieler&" hat gewonnen")
    exit
    endif
    Next
    Next

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

    for $i = 1 to 6
    $vsplate[$i] = ""
    Next

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

    for $i = 1 to 7
    $hsplate[$i] = ""
    Next

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

    for $i = 1 to 12
    $lospalte[$i] = ""
    Next

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

    for $i = 1 to 12
    $rospalte[$i] = ""
    Next

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

    endfunc

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

    func neu()
    for $i = 1 to 6
    $vsplate[$i] = ""
    Next

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

    for $i = 1 to 7
    $hsplate[$i] = ""
    Next

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

    for $i = 1 to 12
    $lospalte[$i] = ""
    Next

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

    for $i = 1 to 12
    $rospalte[$i] = ""
    Next
    endfunc

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

    MfG
    Griss

  • TCP - IP Chat

    • Griss
    • 24. März 2009 um 22:00

    hi,
    noch ein kleines Problem wenn ich jetzt "$ConSocket = TCPAccept($MainSocket)" eingbe funktioniert der teil des scrpites nicht mehr.

    [autoit]

    Switch $Msg

    case $buttonsend
    If $ConSocket > -1 Then
    $ret = TCPSend($ConSocket,"Nachricht|" & $username & "|" & _NowTime(5) & "|" & GUICtrlRead($input))
    If @error Or $ret < 0 Then
    TCPCloseSocket($ConSocket)
    WinSetTitle($Form2, "", "my server - Client Disconnected")
    $ConSocket = -1
    ElseIf $ret > 0 Then
    GUICtrlSetData($edit, GUICtrlRead($edit) & $username & " " & _NowTime(5) & ": " & GUICtrlRead($input) & @CRLF)
    EndIf
    EndIf
    GUICtrlSetData($input, "")
    case $GUI_EVENT_CLOSE
    TCPCloseSocket ($mainSocket)
    GUISetState(@SW_hide,$form2)
    exit
    endswitch

    [/autoit]
  • TCP - IP Chat

    • Griss
    • 23. März 2009 um 22:22

    hi,
    ich wusste schon dass es nur an meinen pc leuft war ja nur ein test.
    Danke für die schnelle hilfe kann es aber leider gerade nicht testen...

  • TCP - IP Chat

    • Griss
    • 23. März 2009 um 21:03

    Server

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <Inet.au3>

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

    Example()

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

    Func Example()
    TCPStartup()
    $MainSocket = TCPListen(@ipaddress1,12,100)
    $ConnectedSocket = tcpconnect(@ipaddress1,80)
    While 1
    $a = inputbox("Send","Senden")
    tcpsend($connectedsocket,$a)
    WEnd
    TCPShutdown()
    EndFunc

    [/autoit]

    Client

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <Inet.au3>

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

    Example()

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

    Func Example()
    $GOOEY = GUICreate("get", 300, 200)
    $edit = GUICtrlCreateEdit("", 10, 10, 280, 180)
    GUISetState()
    Local $msg, $recv
    TCPStartup()
    $ConnectedSocket = tcpconnect(@ipaddress1,12)
    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    $recv = TCPRecv($ConnectedSocket, 2048)
    If $recv <> "" Then
    GUICtrlSetData($edit,$recv ))
    GUISetState()
    endif
    WEnd
    TCPShutdown()
    EndFunc

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

    </Inet>

  • TCP - IP Chat

    • Griss
    • 23. März 2009 um 16:33

    hi,
    wie kann ich etwas was ich mit "tcpsend" sende und wieder mit "tcprevc" auffangen irgendwie gibt das script mir dann nur komische zeichen aus.

  • TCP - IP Chat

    • Griss
    • 16. März 2009 um 18:20

    hi,
    Ich habe mit einen kleinen "TCP - IP Chat" angefangen nur leider komme ich nicht richtig weiter wie kann man z.B.
    nachrichten abfangen ohne diese i-wo zu speichern?
    Wie kann ich die ip von dem User bekommen gerade connected?
    Vllt ein paar verbesserungsmöglichkeiten für meinen chat.

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <WindowsConstants.au3>
    #include <StaticConstants.au3>
    #include <GuiIPAddress.au3>
    #include <inet.au3>
    #include <GuiStatusBar.au3>

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

    dim $ip = @ipaddress1
    dim $mitem[6]

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

    $Username = iniread("config.ini","config","name","")
    if $username = "" Then
    #Region gui
    $Namegui = GUICreate("Username", 316, 128)
    $GroupBox = GUICtrlCreateGroup("", 8, 1, 297, 81)
    $Input = GUICtrlCreateInput("", 24, 40, 265, 21)
    $Label = GUICtrlCreateLabel("Geben Sie Ihren Username ein.", 24, 16, 152, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Buttonok = GUICtrlCreateButton("&OK", 65, 91, 75, 25, 0)
    $Buttoncancel = GUICtrlCreateButton("&Cancel", 162, 91, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion gui
    While 1
    $Msg = GUIGetMsg()
    switch $msg
    Case $buttoncancel
    exitloop
    case $GUI_EVENT_CLOSE
    exitloop
    case $buttonok
    $username = GUICtrlRead($input)
    if $username = "" Then $username = "Defaultuser"
    iniwrite("config.ini","config","name",$username)
    exitloop
    Endswitch
    wend
    GUISetState(@SW_hide,$namegui)
    EndIf

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

    #Region gui
    $Form2 = GUICreate("Messenger", 531, 365)
    $ListView1 = GUICtrlCreateListView("Name", 336, 8, 177, 305)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 173)
    $Menu = GuiCtrlCreateMenu("Menu")
    $mitem[1] = GUICtrlCreateMenuItem("Start server",$menu)
    $mitem[2] = GUICtrlCreateMenuItem("connect",$menu)
    $mitem[3] = GUICtrlCreateMenuItem("Kick User",$menu)
    GUICtrlSetState ($mitem[3], $GUI_DISABLE)
    $mitem[4] = GUICtrlCreateMenuItem("Ban User",$menu)
    GUICtrlSetState ($mitem[4], $GUI_DISABLE)
    $mitem[5] = GUICtrlCreateMenuItem("close",$menu)
    $About = GuiCtrlCreateMenu("About")
    $aitem = GUICtrlCreateMenuItem("About",$About)
    $Help = GuiCtrlCreateMenu("Help")
    $hitem = GUICtrlCreateMenuItem("?",$Help)
    $Edit = GUICtrlCreateEdit("", 16, 8, 289, 265)
    GUICtrlSetState ($edit, $GUI_DISABLE)
    GUICtrlSetFont($edit, 10, 400, 0, "Courier New")
    $Input = GUICtrlCreateInput("", 16, 288, 225, 21)
    GUICtrlSetState ($input, $GUI_DISABLE)
    $buttonsend = GUICtrlCreateButton("Send", 256, 288, 49, 25, $BS_DEFPUSHBUTTON)
    GUICtrlSetState ($buttonsend, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion gui

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

    tcpstartup()

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

    While 1
    $Msg = GUIGetMsg()
    Switch $Msg
    Case $GUI_EVENT_CLOSE
    Exit

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

    case $mitem[1]
    $MainSocket = TCPListen($ip,80,100)
    $conSocket = TCPconnect($ip,80)
    If $ConSocket >= 0 Then
    msgbox(0,"","Client Connected")
    GUICtrlSetState ($buttonsend, $gui_enable)
    GUICtrlSetState ($edit, $gui_enable)
    GUICtrlSetState ($input, $gui_enable)
    GUICtrlSetState ($mitem[4], $gui_enable)
    GUICtrlSetState ($mitem[3], $gui_enable)
    GUISetState()
    $ret = TCPSend($ConSocket, "- " & $username & " is online now.")
    GUICtrlSetData($edit, "- " & $username & " is online now." & @CRLF)
    Else
    msgbox(0,"","Error Server Nicht erreichbar")
    EndIf
    while 1
    $Msg = GUIGetMsg()
    Switch $Msg
    case $buttonsend
    If $ConSocket > -1 Then
    $ret = TCPSend($ConSocket, GUICtrlRead($input))
    If @error Or $ret < 0 Then
    TCPCloseSocket($ConSocket)
    WinSetTitle($Form2, "", "my server - Client Disconnected")
    $ConSocket = -1
    ElseIf $ret > 0 Then
    GUICtrlSetData($edit, GUICtrlRead($edit) & $username & ": " & GUICtrlRead($input) & @CRLF)
    EndIf
    EndIf
    GUICtrlSetData($input, "")
    case $GUI_EVENT_CLOSE
    TCPCloseSocket ($mainSocket)
    GUISetState(@SW_hide,$form2)
    exit
    endswitch
    wend

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

    case $mitem[2]
    #Region gui
    $connectgui = GUICreate("Connect", 316, 128)
    $GroupBox = GUICtrlCreateGroup("", 8, 1, 297, 81)
    $Label = GUICtrlCreateLabel("Geben Sie die ip des Servers ein.", 24, 16, 161, 17)
    $IPAddress = _GUICtrlIpAddress_Create($connectgui, 24, 40, 257, 25)
    _GUICtrlIpAddress_Set($IPAddress, "192.168.0.0")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Buttonok = GUICtrlCreateButton("&OK", 65, 91, 75, 25, 0)
    $Buttoncancel = GUICtrlCreateButton("&Cancel", 162, 91, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion gui
    While 1
    $Msg = GUIGetMsg()
    $conip = GUICtrlRead($IPAddress)
    switch $msg
    Case $Buttonok
    $conSocket = TCPconnect($conip,80)
    msgbox(0,"",$consocket&" "&@error)
    If $ConSocket >= 0 Then
    msgbox(0,"","Client Connected")
    GUISetState(@SW_hide,$connectgui)
    GUICtrlSetState ($buttonsend, $gui_enable)
    GUICtrlSetState ($edit, $gui_enable)
    GUICtrlSetState ($input, $gui_enable)
    GUICtrlSetState ($mitem[4], $gui_enable)
    GUICtrlSetState ($mitem[3], $gui_enable)
    $ret = TCPSend($ConSocket, "- " & $username & " is online now.")
    GUICtrlSetData($edit, "- " & $username & " is online now." & @CRLF)

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

    while 1
    $Msg = GUIGetMsg()
    Switch $Msg
    case $buttonsend
    If $ConSocket > -1 Then
    $ret = TCPSend($ConSocket, GUICtrlRead($input))
    If @error Or $ret < 0 Then

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

    TCPCloseSocket($ConSocket)
    WinSetTitle($Form2, "", "my server - Client Disconnected")
    $ConSocket = -1
    ElseIf $ret > 0 Then

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

    GUICtrlSetData($edit, GUICtrlRead($edit) & $username & ": " & GUICtrlRead($input) & @CRLF)
    EndIf
    EndIf
    GUICtrlSetData($input, "")
    case $GUI_EVENT_CLOSE
    GUISetState(@SW_hide,$form2)
    exit
    endswitch
    wend
    Else
    msgbox(0,"","Error Server Nicht erreichbar")
    GUISetState(@SW_hide,$connectgui)
    exit
    EndIf
    Case $buttoncancel
    GUISetState(@SW_hide,$connectgui)
    Exit
    case $GUI_EVENT_CLOSE
    GUISetState(@SW_hide,$connectgui)
    exit
    endswitch
    wend

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

    case $mitem[3]
    exitloop
    case $aitem
    msgbox(0,"","Noch in Arbeit...")
    case $hitem
    msgbox(0,"","Noch in Arbeit...")

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

    EndSwitch
    WEnd

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™