Jump to content

Recommended Posts

Posted

Have you tried looking at the >Teamspeak 3 UDF ?

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Posted (edited)

I have not. I do not like using other people's lengthy or complex UDF's because if I use something, I want to know it is always available and updated. I don't mind taking a snippet of code that I fully understand but I do not use non-intrinsic UDF's because I don't like the idea of loving some UDF's functionality and then AutoIt updates and it is broken and I may not have the extreme skill level or time to dedicate to making it work again if the creator is not supporting it any longer. That chance is extremely low with the UDF's that come with AutoIt because they are part of the language now and likely will remain or be superseded by something better.

Edited by Morthawt
Posted (edited)

Then go into the UDF and see how they use it, from their you will be able to integrate. If you don't use any code, at least you will have concepts in front of you of how to do what you would like to do.

Here is a snippet from the UDF pertaining to your question (and a reason why you should at least take a look..)

; #FUNCTION# ;===============================================================================
;
; Name...........: _TS3banclient
; Description ...: Bans the client specified with ID clid from the server.
; AutoIt Version : V3.3.6.0
; Syntax.........: _TS3banclient($TS3clientid[, $TS3time = ""[, $TS3reason = ""]])
; Parameters ....: $TS3clientid - Client id
;                   $TS3time - Optional: (Default = "") : Banntime in seconds
;                   $TS3reason - Optional: (Default = "") : Bannreason
; Return values .: Success - Returns : Bann id
;                  Failure - Returns 0 and Sets @Error:
;                  |0 - No error.
;                  |1 - Error: Set return - Error message
; Author ........: chip
;
; ;==========================================================================================
Func _TS3banclient($TS3clientid, $TS3time = "", $TS3reason = "")
    If $TS3time <> "" Then
        $TS3clientid = $TS3clientid & " time=" & $TS3time
    EndIf
    If $TS3reason <> "" Then
        $TS3clientid = $TS3clientid & " banreason=" & $TS3reason
    EndIf
    TCPSend($TS3connection, "banclient clid=" & $TS3clientid & Chr(10))
    While 1
        $recv = TCPRecv($TS3connection, 2048)
        $recv = StringReplace($recv, @LF, @CRLF)
        $recv = StringReplace($recv, @CRLF & @CR, @CRLF)
        If StringInStr($recv, "banid=") Then
            $recv = StringReplace($recv, "error id=0 msg=ok", "")
            Return $recv
        ElseIf StringInStr($recv, "error") Then
            Return SetError(1, 0, _TS3errors($recv))
            ExitLoop
        EndIf
    WEnd
EndFunc   ;==>_TS3banclient
 
 
; #FUNCTION# ;===============================================================================
;
; Name...........: _TS3errors
; Description ...: Server error message
; AutoIt Version : V3.3.6.0
; Syntax.........: _TS3errors($TS3error)
; Parameters ....: $TS3error - Error message
; Return values .: Success - Returns : Error message
;                  Failure - Returns 0 and Sets @Error:
;                  |0 - No error.
; Author ........: chip
;
; ;==========================================================================================
Func _TS3errors($TS3error)
    $errormessage = StringSplit($TS3error, "msg=", 1)
    $message = StringReplace($errormessage[2], "\s", " ", 0, 1)
    Return $message
EndFunc   ;==>_TS3errors
Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Posted

Thanks

 

Anytime ;)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...