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. GtaSpider

Beiträge von GtaSpider

  • Script ausführen ohne Icon im Systray

    • GtaSpider
    • 16. März 2006 um 14:31

    ja: Opt("TrayAutoPause",0), ohne pause
    #NoTrayIcon für NoTrayIcon!

  • RichTextControl

    • GtaSpider
    • 15. März 2006 um 21:39

    Hallo!
    so ich hab jetzt ein rtf control! alles schön und gut mit bunten farben usw.. ich will jetzt aber eine vertikale scrollbar haben! wie geht das in einem RTf control?
    bisheriges script(autoit beta hilfe bei GuiCtrlcreateEdit!):

    Code
    #include <GUIConstants.au3>
    $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
    
    
    $oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
    
    
    GUICreate("Embedded RICHTEXT control Test", 320, 200, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS))
    $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER)
    GuiCtrlSetFont($TagsPageC,9,400,4)
    GuiCtrlSetColor($TagsPageC,0x0000ff)
    GuiCtrlSetCursor($TagsPageC,0)
    $AboutC = GUICtrlCreateButton('About',105,177,70,20)
    $PrefsC = GUICtrlCreateButton('FontSize',175,177,70,20)
    $StatC = GUICtrlCreateButton('Plain Style',245,177,70,20)
    
    
    $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 400 , 260 )
    GUICtrlSetPos($GUIActiveX,10,10,300,160)
    
    
    With $oRP; Object tag pool
    .OLEDrag()
    .Font = 'Arial'
    .SelColor = 0x0000ff
    .seltext = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload'
    ;.FileName = @ScriptDir & '\RichText.rtf'
    .BackColor = 0xff00
    .MultiLine = True
    ;~ .ScrollBars = "Vertical"
    .seltext = @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "TEST"
    EndWith
     
    GUISetState ();Show GUI
    
    
    While 1
    	$msg = GUIGetMsg()
    
    	Select
    		Case $msg = $GUI_EVENT_CLOSE
    ;~ 			$oRP.SaveFile( @ScriptDir & "\RichText.rtf", 0 )
    			ExitLoop
    		Case $msg = $TagsPageC
    			Run(@ComSpec & ' /c start [URL]http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid=[/URL]{3B7C8860-D78F-101B-B9B5-04021C009402}','', @SW_HIDE)
    		Case $msg = $AboutC
    			$oRP.AboutBox() 
    		Case $msg = $PrefsC
    			$oRP.SelFontSize = 20
    			DllCall("user32.dll", "int", "SendMessage", "hwnd", $GUIActiveX, "int", 0xB6, "int", 0, "int",100)
    		Case $msg = $StatC
    			$oRP.SelBold = False
    			$oRP.SelItalic = False
    			$oRP.SelUnderline = True
    			$oRP.SelFontSize = 8
    			$oRP.SelColor = 0x0000ff
    	EndSelect
    WEnd
    
    
    Exit
    
    
    Func MyErrFunc()
    
    
      $HexNumber=hex($oMyError.number,8)
    
    
      Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"       & @CRLF  & @CRLF & _
    			 "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
    			 "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
    			 "err.number is: "         & @TAB & $HexNumber              & @CRLF & _
    			 "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
    			 "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
    			 "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
    			 "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
    			 "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
    			,5)
    
      ; Will automatically continue after 5 seconds
      SetError(1)  ; to check for after this function returns
    Endfunc
    Alles anzeigen
  • Job (Einzelauftrag)

    • GtaSpider
    • 15. März 2006 um 17:58

    ok hab mich auch mal gemeldet^^

  • Ping

    • GtaSpider
    • 15. März 2006 um 15:00

    ja das prob versteh ich auch nich mit dem ping das es so lange dauert?! ich hab dann zunot noch ne idee, dass man das halt per cmd machen müsste(befehl ping [ip])muss mal gucken!

    Wollte auch bald ein PingAll UDF rausbringen...

    mfG spider

  • TCP Chat

    • GtaSpider
    • 13. März 2006 um 19:55

    Hi!
    also ich will ein script schreiben mit dem man per tcp/ip chatten kann! will aber diesmal das das script automatisch erkennt wenn jmd "was von ihm will"(also jetzt chatten^^)
    Das Prob:

    also ich hab jetzt insgesamt 3 scripts!
    das erste:
    ist eine liste wie bei icq usw.. das alle anzeigt die du halt geaddet hast.. dann kannst du auf send message gehen und das öffnet dann script 3(s.u.)

    C
    #include <GUIConstants.au3>
    #include <GuiListView.au3>
    
    
    Global Const $THRESHOLD = Number(RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed"))
    Global $TIMER = TimerInit()
    
    
    $timesini = IniReadSection("list.ini", "USER")
    If IsArray($timesini) Then
    	$timesini = $timesini[0][0]
    Else
    	$timesini = 0
    EndIf
    Dim $ListViewItem[$timesini + 1],$MainSocket
    ;~ MsgBox(0,"",$timesini)
    
    
    $Gui = GUICreate("                                 ¤¤¤GC¤¤¤", 343, 197, 192, 125)
    $ListView = GUICtrlCreateListView("", 8, 8, 250, 150, $LVS_LIST)
    For $i = 1 To $timesini
    	$iniuser = IniRead("list.ini", "USER", $i, "")
    	If $iniuser = "" Then ContinueLoop
    	$ListViewItem[$i] = GUICtrlCreateListViewItem($iniuser, $ListView)
    Next
    $add = GUICtrlCreateButton("&Add", 264, 8, 67, 25)
    $del = GUICtrlCreateButton("&Delete", 264, 40, 67, 25)
    $send = GUICtrlCreateButton("&Send Message", 8, 168, 250, 25)
    $setting = GUICtrlCreateButton("Se&ttings", 264, 72, 67, 25)
    $exit = GUICtrlCreateButton("&Exit", 264, 135, 67, 25)
    $Progress = GUICtrlCreateProgress(266, 104, 64, 25)
    GUICtrlCreateLabel("    ©2006 GtaSpider", 267, 160, 70, 36)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    
    
    GUISetState(@SW_SHOW)
    While 1
    	$msg = GUIGetMsg()
    	Select
    		Case $msg = $GUI_EVENT_CLOSE Or $msg = $exit
    			ExitLoop
    		Case $msg = $GUI_EVENT_PRIMARYDOWN
    			_DoubleClickOnListView($ListView)
    		Case $msg = $send
    			_SendMsg(StringReplace(GUICtrlRead(GUICtrlRead($ListView)), "|", ""))
    		Case $msg = $add
    			While 1
    				$IP_Other_PC = InputBox("GtaSpider Chat", @LF & @LF & "IP address or DNS name of PC to chat to:" & @LF & "(Preface DNS name with \)")
    				If @error Then Exit
    				If StringLeft($IP_Other_PC, 1) = "" Then
    					$IP_Other_PC = TCPNameToIP(StringTrimLeft($IP_Other_PC, 1));Convert NAME to IP
    					If @error Then ContinueLoop
    				EndIf
    				ExitLoop
    			WEnd
    			$timesini += 1
    			IniWrite("list.ini", "USER", $timesini, $IP_Other_PC)
    			_GUICtrlListViewDeleteAllItems ($ListView)
    			Dim $ListViewItem[$timesini + 1]
    			For $i = 1 To $timesini
    				$iniuser = IniRead("list.ini", "USER", $i, "")
    				If $iniuser = "" Then ContinueLoop
    				$ListViewItem[$i] = GUICtrlCreateListViewItem($iniuser, $ListView)
    			Next
    		Case $msg = $del
    			If MsgBox(4, "", "Delete this ip from list?") = 7 Then ContinueLoop
    			$IP_To_DEL = StringReplace(GUICtrlRead(GUICtrlRead($ListView)), "|", "")
    			For $i = 1 To $timesini
    				$iniuser = IniRead("list.ini", "USER", $i, "")
    				If $iniuser = $IP_To_DEL Then
    					IniDelete("list.ini", "USER", $i)
    					ExitLoop
    				EndIf
    			Next
    			$i = 0
    			$ii = 1
    			$lastii = 0
    			$timesini = IniReadSection("list.ini", "USER")
    			If IsArray($timesini) Then
    				$timesini = $timesini[0][0]
    				While 1
    					$i += 1
    					$iniuser = IniRead("list.ini", "USER", $i, "")
    					If $iniuser <> "" Then
    						If $lastii = $ii Then $ii += 1
    						IniDelete("list.ini", "USER", $i)
    						IniWrite("list.ini", "USER", $ii, $iniuser)
    						$lastii = $ii
    						ContinueLoop
    					EndIf
    					$ii += 1
    					If $ii - 1 = $timesini Then ExitLoop
    				WEnd
    				_GUICtrlListViewDeleteAllItems ($ListView)
    				Dim $ListViewItem[$timesini + 1]
    				For $i = 1 To $timesini
    					$iniuser = IniRead("list.ini", "USER", $i, "")
    					If $iniuser = "" Then ContinueLoop
    					$ListViewItem[$i] = GUICtrlCreateListViewItem($iniuser, $ListView)
    				Next
    			EndIf
    	EndSelect
    WEnd
    Exit
    
    
    Func _SendMsg($IP_Other_PC)
    ;~ 	For $i = 1 To 100
    ;~ 	GUICtrlSetData($Progress,$i)
    ;~ 	Sleep(10)
    ;~ 	Next
    ;~ 	Run("gc.exe " & $IP_Other_PC)
    	$MainSocket = TCPConnect(TCPNameToIP($IP_Other_PC), 8000)
    	If $MainSocket = -1 Then Return MsgBox(0, "Error", "Could Not Connect or Bad Connection")
    	TCPSend($MainSocket,@IPAddress1)
    	MsgBox(0,"","")
    	TCPSend($ConnectedSocket,@IPAddress1)
    EndFunc   ;==>_SendMsg
    
    
    Func _DoubleClickOnListView(ByRef $lvctrl)
    	Dim $MousePos = GUIGetCursorInfo()
    	If ($MousePos[4] == $lvctrl And GUICtrlRead($lvctrl) > 0 And _GUICtrlListViewGetHotItem ($lvctrl) = _GUICtrlListViewGetCurSel ($lvctrl)) Then
    		$timerdiff = TimerDiff($TIMER)
    		If $timerdiff <= $THRESHOLD Then
    			$ListRead = StringReplace(GUICtrlRead(GUICtrlRead($lvctrl)), "|", "")
    			_SendMsg($ListRead)
    		EndIf
    		$TIMER = TimerInit()
    	EndIf
    EndFunc   ;==>_DoubleClickOnListView
    
    
    Func OnAutoItExit()
        TCPCloseSocket($MainSocket)
        TCPShutdown()
    EndFunc;==>OnAutoItExit
    Alles anzeigen


    das 2.:
    läuft die ganze zeit im hintergrund und checkt ob jmd "anrufen" will!

    Code
    #cs
    $irs = IniReadSection("list.ini","USER")
    If @error Then _error("Keine/Falsche List.ini gefunden!")
    Global Const $TCP_PORT = 3333
    TCPStartup()
    For $i = 1 To $irs[0][0]
    	$ip = $irs[$i][1]
    	$tcp = TCPListen($ip,$TCP_PORT)
    	ClipPut($tcp)
    	If $tcp <> -1 Then ExitLoop
    	Sleep(1000)
    Next
    MsgBox(0,$ip,$tcp)
    ;~ Run("gc.exe "&$ip)
    TCPShutdown()
    
    Func _error($text)
    	MsgBox(16,"Error",$text)
    	Exit
    EndFunc
    #ce
    
    
    Opt("RunErrorsFatal", 0)
    Global Const $Port = 8000
    Global $MaxConc = 100
    Global $MainSocket = TCPStartServer($Port, $MaxConc)
    If @error <> 0 Then Exit MsgBox(16, "Error", "Server unable to initialize.")
    Global Const $MaxLength = 512
    Global $ConnectedSocket[$MaxConc]
    Global $CurrentSocket = 0
    Local $Track = 0
    Global Const $MaxConnection = ($MaxConc - 1)
    For $Track = 0 To $MaxConnection Step 1
    	$ConnectedSocket[$Track] = -1
    Next
    While 1
    	$ConnectedSocket[$CurrentSocket] = TCPAccept($MainSocket)
    	If $ConnectedSocket[$CurrentSocket] <> - 1 Then
    		$CurrentSocket = SocketSearch()
    	EndIf
    	$Track = 0
    	For $Track = 0 To $MaxConnection Step 1
    		If $ConnectedSocket[$Track] <> - 1 Then
    			$Data = TCPRecv($ConnectedSocket[$Track], $MaxLength)
    			If $Data <> "" Then
    				_next($Data)
    				$CurrentSocket = SocketSearch()
    			EndIf
    		EndIf
    	Next
    WEnd
    Func _next($ip)
    	MsgBox(0,"","")
    	RunWait("gc.exe "&$ip)
    EndFunc   ;==>AutoItExecute
    Func SocketSearch()
    	Local $Track = 0
    	For $Track = 0 To $MaxConnection Step 1
    		If $ConnectedSocket[$Track] = -1 Then
    			Return $Track
    		Else
    			; Socket In Use
    		EndIf
    	Next
    EndFunc   ;==>SocketSearch
    Func TCPSendMessageAll($ConnectionLimit, $Data)
    	Local $Track = 0
    	For $Track = 0 To $ConnectionLimit Step 1
    		If $ConnectedSocket[$Track] <> - 1 Then TCPSend($ConnectedSocket[$Track], $Data)
    	Next
    EndFunc   ;==>TCPSendMessageAll
    Func TCPStartServer($Port, $MaxConnect = 1)
    	Local $Socket
    	$Socket = TCPStartup()
    	Select
    		Case $Socket = 0
    			SetError(@error)
    			Return -1
    	EndSelect
    	$Socket = TCPListen(@IPAddress1, $Port, $MaxConnect)
    	Select
    		Case $Socket = -1
    			SetError(@error)
    			Return 0
    	EndSelect
    	SetError(0)
    	Return $Socket
    EndFunc   ;==>TCPStartServer
    Func OnAutoItExit()
        TCPCloseSocket($MainSocket)
        TCPShutdown()
    EndFunc;==>OnAutoItExit
    Alles anzeigen


    das 3.:
    das Main Programm! mit dem du das eigentliche senden/empfangen machst mit einem richtext control und schönen farben :)

    C
    ;Single peer-peer TCP example
    ;Run on one PC and enter the IP or DNS name of PS to chat with...
    
    
    ;Going to create a GUI so include predefined constant variables
    #include <GUIConstants.au3>
    ;Create some constant info
    Global Const $TCP_PORT = 3333
    $oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
    ;Declare our variables
    Dim $IP_Other_PC
    Dim $over = 0
    Dim $nMainSocket = -1
    Dim $nSocketRecv = -1
    Dim $nSocketSend = -1
    Dim $szSendBuffer = ""
    Dim $szRecvBuffer = ""
    Dim $GUI, $INPUT, $EDIT, $BTN
    Dim $n
    Dim $bOK_ShowGUI = 0
    ;cmdline
    If $cmdline[0]>0 Then
    	$IP_Other_PC = $cmdline[1]
    	$over = 1
    EndIf
    
    
    
    
    ;Initializes the PC for using TCP sockets
    TCPStartup()
    
    
    ;Set Hotkey to quit
    HotKeySet("`", "QuitScript")
    
    
    ;Create a listening socket
    $nMainSocket = TCPListen($IP_Other_PC, $TCP_PORT)
    
    
    ;Create a User Interface
    CreateChatGUI($GUI, $INPUT, $EDIT, $BTN)
    
    
    ;Start the real work
    While 1;OUR communication cycle encapsulated in this loop
    
    	If $nSocketRecv = -1 Then;Only If no connection
    		;Initial or broken connection. Ask for an IP to TCP communicate to
    		While $IP_Other_PC = ""
    			$IP_Other_PC = InputBox("GtaSpider Chat", @LF & @LF & "IP address or DNS name of PC to chat to:" & @LF & "(Preface DNS name with \)",$IP_Other_PC)
    			If @error Then Exit
    			If StringLeft($IP_Other_PC, 1) == "" Then
    				$IP_Other_PC = TCPNameToIP(StringTrimLeft($IP_Other_PC, 1));Convert NAME to IP
    			EndIf
    		WEnd
    	EndIf
    
    	;Wait for an incoming connection
    	While $nSocketRecv = -1
    		ToolTip( "waiting for incoming connection...", 0, 0)
    		$nSocketRecv = TCPAccept($nMainSocket)
    		If $nSocketSend = -1 Then
    			$nSocketSend = TCPConnect($IP_Other_PC, $TCP_PORT)
    		EndIf
    		If $nSocketSend <> - 1 And $bOK_ShowGUI = 0 Then $bOK_ShowGUI = 1
    	WEnd
    
    	;Attempt an outgoing connecion
    	If $nSocketSend = -1 Then
    		ToolTip( "attempting to connect...", 0, 0)
    		$nSocketSend = TCPConnect($IP_Other_PC, $TCP_PORT)
    		If $nSocketSend <> - 1 Then $bOK_ShowGUI = 1
    	Else
    		If $bOK_ShowGUI = 1 Then
    			ToolTip("")
    			GUISetState(@SW_SHOW, $GUI)
    			$bOK_ShowGUI = 0
    		EndIf
    		$szBufferSend = HandleGUIInteraction($GUI, $INPUT, $EDIT, $BTN)
    		If $szBufferSend <> "" Then
    			$n = TCPSend($nSocketSend, $szBufferSend)
    			If @error Then;Connection lost
    				GUISetState(@SW_HIDE, $GUI)
    				$nSocketRecv = -1
    				$nSocketSend = -1
    				$szBufferSend = ""
    			Else
    				$szBufferSend = StringTrimLeft($szBufferSend, $n)
    			EndIf
    		EndIf
    	EndIf
    
    	;Attempt to receive data from incoming connection
    	$szRecvBuffer = TCPRecv($nSocketRecv, 2048)
    	If @error Then;Connection lost
    		TCPCloseSocket($nSocketRecv)
    		$nSocketRecv = -1
    		$nSocketSend = -1
    		GUISetState(@SW_HIDE, $GUI)
    	ElseIf $szRecvBuffer <> "" Then
    		Update($GUI, $EDIT, $szRecvBuffer)
    	EndIf
    WEnd
    
    
    
    
    Func QuitScript()
    	TCPShutdown()
    	Exit
    EndFunc   ;==>QuitScript
    
    
    Func CreateChatGUI(ByRef $gui_hwnd, ByRef $input_id, ByRef $edit_id, ByRef $btn_id)
    	$gui_hwnd = GUICreate( "GtaSpider Chat", 400, 500, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
    
    
    	
    	$input_id = GUICtrlCreateInput("", 10, 10, 380, 20)
    	$edit_id = GUICtrlCreateObj($oRP, 10, 40, 380, 450)
    	GUICtrlSetPos(-1, 11, 40, 380, 450)
    ;~ 	$edit_id = GUICtrlCreateEdit("", 10, 40, 380, 450)
    	$btn_id = GUICtrlCreateButton( "hidden", 0, 0, 50, 20, $BS_DEFPUSHBUTTON)
    	GUICtrlSetState(-1, $GUI_HIDE)
    	GUICtrlSetState($input_id, $GUI_FOCUS)
    ;~     GUISetState()
    EndFunc   ;==>CreateChatGUI
    
    
    Func HandleGUIInteraction(ByRef $gui_hwnd, ByRef $input_id, ByRef $edit_id, ByRef $btn_id)
    	Local $msg, $szInBuffer, $szEditBuffer
    	$msg = GUIGetMsg()
    	If $msg = -3 Then QuitScript()
    	If $msg = $btn_id Then
    		$szInBuffer = GUICtrlRead($input_id)
    		GUICtrlSetState($input_id, $GUI_FOCUS)
    		If $szInBuffer <> "" Then
    			$szEditBuffer = GUICtrlRead($edit_id) & $szInBuffer & @CRLF
    			$oRP.SelText = $szEditBuffer
    			GUICtrlSetData($input_id, "")
    			Return $szInBuffer
    		EndIf
    	EndIf
    	Return ""
    EndFunc   ;==>HandleGUIInteraction
    
    
    Func Update(ByRef $gui_hwnd, ByRef $edit_id, ByRef $recv_text)
    	Local $sz
    	$sz = $recv_text & @CRLF
    	With $oRP
    		.SelColor = 0x0000ff
    		.SelText = $sz
    		.SelColor = 0x0
    	EndWith
    ;~ 	GUICtrlSetData($edit_id, $sz)
    EndFunc   ;==>Update
    Alles anzeigen

    das Prob:
    das 1.! undzwar:

    Code
    $MainSocket = TCPConnect(TCPNameToIP($IP_Other_PC), 8000)
    	If $MainSocket = -1 Then Return MsgBox(0, "Error", "Could Not Connect or Bad Connection")
    	TCPSend($MainSocket,@IPAddress1)
    	MsgBox(0,"","")
    	TCPSend($ConnectedSocket,@IPAddress1)

    hier! er sendet eingentlich so wie er soll! aber nummer 2 auf dem anderen rechener kanns nich empfangen?!
    komischer weisse klappt es aber hiermit:

    C
    #include <GuiConstants.au3>
    #include <GuiEdit.au3>
    #include <Misc.au3>
    Local $Server = InputBox("Server", "Please input the server you would like to connect to:")
    Local $Port = InputBox("Server Port", "Please input the port or the server you would like to connect to:")
    TCPStartup()
    $MainSocket = TCPConnect(TCPNameToIP($Server), $Port)
    MsgBox(0,"",)
    If $MainSocket = -1 Then Exit MsgBox(0, "Error", "Could Not Connect or Bad Connection")
    GUICreate("Server Client", 390, 210)
    $Send = GUICtrlCreateEdit("", 10, 10, 175, 150, $WS_VSCROLL)
    Local $History = GUICtrlCreateEdit("Server Messages:", 200, 10, 175, 150, BitOR($WS_VSCROLL, $ES_READONLY))
    $SButton = GUICtrlCreateButton("Send", 145, 165, 100, 35)
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then
            Exit
        ElseIf $msg = $SButton Or _IsPressed ("0D") = 1 Then
            $Text = GUICtrlRead($Send)
            $TCPSent = TCPSend($MainSocket, $Text)
            GUICtrlSetData($Send, "")
        EndIf
        $Recv = TCPRecv($MainSocket, 512)
        If $Recv <> "" Then
            GUICtrlSetData($History, GUICtrlRead($History) & @CRLF & $Recv)
            _GUICtrlEditLineScroll ($History, 0, _GUICtrlEditGetLineCount ($History))
        EndIf
    WEnd
    Func OnAutoItExit()
        TCPCloseSocket($MainSocket)
        TCPShutdown()
    EndFunc;==>OnAutoItExit
    Alles anzeigen


    ich kapiers net?!
    will mich autoit möglicherweise ärgern?? ich weiß das haben sich schon viele gefragt, aber diesmal :huh:


    EDIT : Verd**** Schei** man man man ich hab einfach nur TCPStartup vergessen :rolleyes: sry!
    von mir aus :CLOSED:

  • GtaSpider

    • GtaSpider
    • 13. März 2006 um 16:31

    Hi! wer ich bin: Ich bin ich und versuche auch ich zu bleiben^^ ansonsten bin ich Programmierer noch in der "anfangsphase"! naja... ich heiße mit vornamen max und hab ne freundin :) liebe es zu programmieren aber nich nur mit autoit.. bin auch so ein bisschen in C++ geübt.. mhh bin nich administrator im forum aber auf meinem PC :]
    ok ich weiß net was ich noch so schreiben soll.. bin bei icq und bald auch bei Skype!

    mfg spider

  • Variable in andres Script übertragen

    • GtaSpider
    • 12. März 2006 um 18:18

    wie sieht die variable denn aus? also enthält sie leerzeichen?
    wenn ja muss du sie in " setzen! Aslo so:

    Code
    $a = '"hallo dies ist ein test"'
    $b = "dies_ist_nur_ein_wort_desswegen_keine_gänsefüschen!"
    Run("ScriptB.exe "&$a&" "&$b)


    oder du machst es mit EnvSet:

    Code
    EnvSet("ToScriptB",$a)
    EnvSet("ToScriptB2",$b)


    und dann liest du es im anderen script so aus:

    Code
    $a = EnvGet("ToScriptB")
    $b = EnvGet("ToScriptB2")


    EnvSet/Get ist eine parameterübergabe ans Betriebsystem und soetwas wie die Zwischenablage nur das es undendlich viele verschiedene davon gibt!ABER:

    Code
    Eine Umgebungsvariable, die so gesedtzt wird, ist nur von Programmen auslesbar, die aus AutoIt heraus gestartet wurden (mittels Run oder RunWait). Sobald AutoIt beendet wird, verlieren die Umgebungsvariablen ihre Gültigkeit.
  • Tutorialwünsche?

    • GtaSpider
    • 12. März 2006 um 09:15

    Wilkommen ersmal im Forum :)

    wenn ich es jetzt richtig verstanden hab:
    autoitscript in den autostart ordner kopieren(@StartupDir) oder ein task erstellen der beim neustart starten soll..

    wie soll er die denn weitergeben ?( per tcp oder was?

    mfG gta

    p.s. admin also ein namen per ip rauszufinden also IP>COMPUTERNAME geht mit meinem udf: http://autoit.aufwaerts.de/thread.php?threadid=94&sid=
    oder
    http://www.windows-unattended.de/forum/-iptoname-t4397.html

  • Pixelsearch

    • GtaSpider
    • 11. März 2006 um 12:27

    ^^ dankeschön was würd ich nur ohne dich machen :)

  • Pixelsearch

    • GtaSpider
    • 10. März 2006 um 17:35

    Hallo!

    Zur Not selber machen:

    Code
    $cc = _ChooseColor(2, 0xFF0000, 2)
    MsgBox(0, "Chosen Color:", $cc);so von Chosed auf Chosen^^
    ClipPut($cc)
    ;in der beta is das unter #include <misc.au3>!
    Func _ChooseColor($i_ReturnType = 0, $i_colorref = 0, $i_refType = 0)
    	Local $custcolors = "int[16]"
    	Local $struct = "dword;int;int;int;ptr;dword;int;ptr;ptr"
    	Local $p = DllStructCreate($struct)
    	If @error Then
    		;MsgBox(0,"","Error in DllStructCreate " & @error);
    		SetError(-1)
    		Return -1
    	EndIf
    	Local $cc = DllStructCreate($custcolors)
    	If @error Then
    		; MsgBox(0,"","Error in DllStructCreate " & @error);
    		;        DllStructDelete ($p)
    		SetError(-2)
    		Return -1
    	EndIf
    	If ($i_refType == 1) Then
    		$i_colorref = Int($i_colorref)
    	ElseIf ($i_refType == 2) Then
    		$i_colorref = Hex(String($i_colorref), 6)
    		$i_colorref = '0x' & StringMid($i_colorref, 5, 2) & StringMid($i_colorref, 3, 2) & StringMid($i_colorref, 1, 2)
    	EndIf
    	DllStructSetData($p, 1, DllStructGetSize($p))
    	DllStructSetData($p, 2, 0)
    	DllStructSetData($p, 4, $i_colorref)
    	DllStructSetData($p, 5, DllStructGetPtr($cc))
    	DllStructSetData($p, 6, BitOR($CC_ANYCOLOR, $CC_FULLOPEN, $CC_RGBINIT))
    
    	Local $ret = DllCall("comdlg32.dll", "long", "ChooseColor", "ptr", DllStructGetPtr($p))
    	If ($ret[0] == 0) Then
    		; user selected cancel or struct settings incorrect
    		;        DllStructDelete ($p)
    		;        DllStructDelete ($cc)
    		SetError(-3)
    		Return -1
    	EndIf
    	Local $color_picked = DllStructGetData($p, 4)
    	;    DllStructDelete ($p)
    	;    DllStructDelete ($cc)
    	If ($i_ReturnType == 1) Then
    		; return Hex BGR Color
    		Return '0x' & Hex(String($color_picked), 6)
    	ElseIf ($i_ReturnType == 2) Then
    		; return Hex RGB Color
    		$color_picked = Hex(String($color_picked), 6)
    		Return '0x' & StringMid($color_picked, 5, 2) & StringMid($color_picked, 3, 2) & StringMid($color_picked, 1, 2)
    	ElseIf ($i_ReturnType == 0) Then
    		Return $color_picked
    	Else
    		SetError(-4)
    		Return -1
    	EndIf
    EndFunc   ;==>_ChooseColor
    Alles anzeigen
  • FileFindFirstFile und Verzeichnisse

    • GtaSpider
    • 7. März 2006 um 21:20

    JaIn in der FileFindFirstFile nicht aber später wenn filefindnextfile schon declarird wurde, nämlich so:

    Code
    $dir = @WindowsDir
    $file = FileFindFirstFile($dir&"\*.*")
    SplashTextOn("afdg","",400,20,-1,-1,1)
    While 1
    	$filenext = FileFindNextFile($file)
    	If @error Then ExitLoop
    	$attr = FileGetAttrib($dir&""&$filenext)
    	If StringInStr($attr,"D") Then ContinueLoop;"D" = Dir! siehe hilfe! und wenn ordner z.b. versteckt zeigt er dank StringInStr auch ContiuLoop an!
    	ControlSetText("afdg","","Static1",$filenext)
    	Sleep(500)
    WEnd
    SplashOff();nich notwendig aber besser..
    Alles anzeigen


    hoffe konnte helfen!

  • Variable in andres Script übertragen

    • GtaSpider
    • 7. März 2006 um 20:53

    na klar immer gerne ;)

  • Variable in andres Script übertragen

    • GtaSpider
    • 7. März 2006 um 15:46

    mehrere möglichkeiten:
    1. du schreibst es in script A so das er das in einer datei abspeichert, werehnd Script B jede sekunde in die datei guckt
    oder 2. du schreibst scribt B so das es auch per cmdline funktionier, du also nur in script A schreiben musst:

    Code
    Run("ScriptB.exe "&$a)


    scribt b müsste am anfang so aussehen:

    Code
    If $cmdline[0] > 0 Then; checkt ob überhaupt was in der cmdline drinsteht
    	$X = $cmdline[1];x wird als cmdline declarirt! wenn man also "scribtB.exe hallo" startet, wird in der msgbox "hallo" angezeigt!
    Else; wenn nix in der cmdline drin is also man "scriptB.exe" so startet wird x zu -1!
    	$X = "-1"
    EndIf
    MsgBox(0,"",$X);hier wird das ergebnis ausgestrahlt
    $data = """hallo! wenn x = -1 dann wird das hier in der msgbox stehen!"""; wichtig: hier ist ein satz mit leerzeichen also musst du den text in " fassen also "+"" wegen "!? du kannst auch '" machen!
    $data = '"hallo! wenn x = -1 dann wird das hier in der msgbox stehen!"'; also so!
    If $x = "-1" Then RunWait(@ComSpec & ' /c '&@ScriptFullPath&" "&$data, '', @SW_HIDE); hier startet er nochmal mit dem text von $data in $cmdline[1]!
  • Funktionsaufruf mit CALL

    • GtaSpider
    • 7. März 2006 um 15:33

    hab den fehler gefunden! er ist in der ini!
    so darf es nicht sein:

    Code
    [SCRIPT]
    1=FTP_PUT()
    2=BACKUP_LOCAL()


    so muss es sein:

    Code
    [SCRIPT]
    1=FTP_PUT
    2=BACKUP_LOCAL


    die klammern dürfen nich da sein da die funktion dann FTP_PUT() heißen müsste, die funktion heißt aber nur FTP_PUT!

  • Suchen und Ersetzten

    • GtaSpider
    • 5. März 2006 um 17:04

    guck mal in der beta:

    Code
    ; ===================================================================
    ; Author: Kurt (aka /dev/null) and JdeB
    ;
    ; _ReplaceStringInFile($szFileName, $szSearchString, $szReplaceString,$bCaseness = 0, $bOccurance = 0)
    ;
    ; Replaces a string ($szSearchString) with another string ($szReplaceString) the given TEXT file
    ; (via filename)
    ;
    ; Operation:
    ; The funnction opens the original file for reading and a temp file for writing. Then
    ; it reads in all lines and searches for the string. If it was found, the original line will be
    ; modified and written to the temp file. If the string was not found, the original line will be
    ; written to the temp file. At the end the original file will be deleted and the temp file will
    ; be renamed.
    ;
    ; Parameters:
    ; 	$szFileName 		name of the file to open.
    ;				ATTENTION !! Needs the FULL path, not just the name returned by eg. FileFindNextFile
    ; 	$szSearchString		The string we want to replace in the file
    ; 	$szReplaceString	The string we want as a replacement for $szSearchString
    ; 	$fCaseness		shall case matter?
    ;				0 = NO, case doe not matter (default), 1 = YES, case does matter
    ;	$fOccurance		shall we replace the string in every line or just the first occurance
    ;				0 = first only, 1 = ALL strings (default)
    ;
    ; Return Value(s):
    ;	On Success 		Returns the number of occurences of $szSearchString we found
    ;
    ;	On Failure 		Returns -1 sets @error
    ;					@error=1	Cannot open file
    ;					@error=2	Cannot open temp file
    ;					@error=3	Cannot write to temp file
    ;					@error=4	Cannot delete original file
    ;					@error=5	Cannot rename/move temp file
    ;
    ; ===================================================================
    Func _ReplaceStringInFile($szFileName, $szSearchString, $szReplaceString, $fCaseness = 0, $fOccurance = 1)
    
    	Local $iRetVal = 0
    	Local $szTempFile, $hWriteHandle, $aFileLines, $nCount, $sEndsWith, $hFile
    	;===============================================================================
    	;== Read the file into an array
    	;===============================================================================
    	$hFile = FileOpen($szFileName, 0)
    	If $hFile = -1 Then
    		SetError(1)
    		Return -1
    	EndIf
    	Local $s_TotFile = FileRead($hFile, FileGetSize($szFileName))
    	If StringRight($s_TotFile, 2) = @CRLF Then
    		$sEndsWith = @CRLF
    	ElseIf StringRight($s_TotFile, 1) = @CR Then
    		$sEndsWith = @CR
    	ElseIf StringRight($s_TotFile, 1) = @LF Then
    		$sEndsWith = @LF
    	Else
    		$sEndsWith = ""
    	EndIf
    	$aFileLines = StringSplit(StringStripCR($s_TotFile), @LF)
    	FileClose($hFile)
    	;===============================================================================
    	;== Open the temporary file in write mode
    	;===============================================================================
    	$szTempFile = _TempFile()
    
    	$hWriteHandle = FileOpen($szTempFile, 2)
    	If $hWriteHandle = -1 Then
    		SetError(2)
    		Return -1
    	EndIf
    	;===============================================================================
    	;== Loop through the array and search for $szSearchString
    	;===============================================================================
    	For $nCount = 1 To $aFileLines[0]
    		If StringInStr($aFileLines[$nCount], $szSearchString, $fCaseness) Then
    			$aFileLines[$nCount] = StringReplace($aFileLines[$nCount], $szSearchString, $szReplaceString, 1 - $fOccurance, $fCaseness)
    			$iRetVal = $iRetVal + 1
    
    			;======================================================================
    			;== If we want just the first string replaced, copy the rest of the lines
    			;== and stop
    			;======================================================================
    			If $fOccurance = 0 Then
    				$iRetVal = 1
    				ExitLoop
    			EndIf
    		EndIf
    	Next
    	;===============================================================================
    	;== Write the lines to a temp file.
    	;===============================================================================
    	For $nCount = 1 To $aFileLines[0] - 1
    		If FileWriteLine($hWriteHandle, $aFileLines[$nCount]) = 0 Then
    			SetError(3)
    			FileClose($hWriteHandle)
    			Return -1
    		EndIf
    	Next
    	; Write the last record and ensure it ends wit hthe same as the input file
    	If $aFileLines[$nCount] <> "" Then FileWrite($hWriteHandle, $aFileLines[$nCount] & $sEndsWith)
    	FileClose($hWriteHandle)
    
    	;======================================================================
    	;== Delete the original file
    	;======================================================================
    	If FileDelete($szFileName) = 0 Then
    		SetError(4)
    		Return -1
    	EndIf
    
    	;======================================================================
    	;== Rename the temp file to the original file
    	;======================================================================
    	If FileMove($szTempFile, $szFileName) = 0 Then
    		SetError(5)
    		Return -1
    	EndIf
    
    	Return $iRetVal
    EndFunc   ;==>_ReplaceStringInFile
    Alles anzeigen
  • Inputbox

    • GtaSpider
    • 4. März 2006 um 19:15

    Hertlich wilkommen im forum!

    Code
    $i = "hallo"
    $k = InputBox("HELLO","123","nothubg","*",100,100,0,0)
    If @error Then Exit
    If not $k = $i Then
    	MsgBox(0,"",$k)
    Else
    	MsgBox(0,"",$i)
    EndIf


    so ungefähr müsste es klappen!

  • Pixelsearch

    • GtaSpider
    • 4. März 2006 um 15:55

    scite isn editor für autoit! perfekt! wate ich gib dir mal die seite: http://www.autoitscript.com/autoit3/scite/

  • Übersetzung der Beta

    • GtaSpider
    • 4. März 2006 um 11:35

    also ich würd auch gerne mithelfen halt.. dann mach ik halt was anderes! übersetzen z.b!

  • Pixelsearch

    • GtaSpider
    • 4. März 2006 um 11:33

    ok pls.. du kannst das wählen im opt modus.. da ürgendwie opt("ColorMode",0)=RGB(deafult) und 1 = BGR^! wenn du scite hast kannste strg+w machn und dann kannste ürgendwo die farbn auswälen!

  • Übersetzung der Beta

    • GtaSpider
    • 3. März 2006 um 20:09

    also fh leider ja..

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™