Sign in to follow this  
Followers 0
xzaz

Teamspeak Admin

13 posts in this topic

#1 ·  Posted (edited)

Hi there, this is one of my first (complete) scripts. It is a autoit TS admin client controled Through Telnet.

;Script by Xzaz => www.xzaz.nl
#include <GUIConstants.au3>
#include <array.au3>
#Include <GuiList.au3>
Opt("GUICoordMode", 1)

;Setting the vars
$Line = 0
$IP = "192.168.0.1" ;IP to connect
$Port = "51234" ; Port to connect
$waittime = 100 ;Howmuch ms for refresh resv

;Globals
Global $recvwin
Global $begin
;Startup the TCP/UDP
TCPStartUp()
$socket = TCPConnect( $IP, $Port )

;Create GUI
GUICreate("Teamspeak",410,300)
$input = GUICtrlCreateInput("Type: 'Help' for commands",10,5,200,25)
GUICtrlSetState(-1,$GUI_FOCUS) 
$recvwin = GUICtrlCreateEdit("",10,30,400,270)
$butt = GUICtrlCreateButton("Send",220,5,80,20)
GUICtrlSetState(-1,$GUI_DEFBUTTON)
$butt_reset = GUICtrlCreateButton("Reset",310,5,80,20)
GUISetState(@SW_SHOW)

;Begin check every 3 seconds for new output
$begin = TimerInit()
#Region Loop
    ;begin loop
    While 1
        ;Sleep for lower CPU usage
        Sleep(100)
        
        ;Get GUI msg
        $msg = GUIGetMsg()
        
            Select
                    Case $msg = $GUI_EVENT_CLOSE 
                        ;If msg is Close then Exit program
                        Exit 0
                    Case $msg = $butt
                        ;If the button is pressed
                        sending(GUICtrlRead($input))
                        recv()
                    Case $msg = $butt_reset
                        Clearlist()
                    Case Else           
                        ;Check the differentce
                        $dif = TimerDiff($begin)
                            if $dif > $waittime Then 
                                recv() 
                                ;begin reset
                                $begin = TimerInit()
                            EndIf
            EndSelect
        
        
    
        ;End Loop
    Wend
#EndRegion End Loop

#Region Functions
Func SetConsole($Text)
    $Line = $Line + 1
    GUICtrlSetData ($recvwin, $Text & @CRLF, $Line)
EndFunc 

Func recv()
     _GUICtrlListClear ($recvwin)
    $recv = TCPRecv($socket, 100000)
    if $recv <> "" Then
    SetConsole($recv)
EndIf
EndFunc

func sending($send_data)
    TCPSend($socket,$send_data  & @CRLF)
EndFunc

func Clearlist()
    GUICtrlSetData($recvwin,"")
EndFunc

#EndRegion End Functions

Comments,question everything is welcome :)

Edited by xzaz

Share this post


Link to post
Share on other sites



I thought for a second someone else had posted a Teamspeak status client before I posted mine - that would have really cheesed me off!

It's a nice concept - however it would be a good idea to enable the user to select commands in the GUI, and display the server output in a more user-friendly way. So that the user connects to the server and the click "Select Server", giving a list of possible server the user can connect to. From there they can then look at the user currently online and in what channels they are.

I could give you the code I have for getting the player list, channel list, server name and parsing the data to give the server layout so you could integrate it all into a nice GUI (my version does it in text as I made it to be implemented as a web-based script).

Share this post


Link to post
Share on other sites

good script keep on autoiting

Share this post


Link to post
Share on other sites

Tnx for the response guys. I will make a new GUI with build-in server commands.

@Secure_ICT

First you need to login with your Super admin account:

slogin name password

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Looks good, havent tested it since i dont use TS.

but:

while 1
Sleep(100)
$msg=guigetmsg()
;..
;..

should after what i know just be:

while 1
$msg=guigetmsg()
;..
;..
.

Since the GUIgetmsg idles the CPU.

Edit:Typo

Edited by rambo3889

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

Looks good, havent tested it since i dont use TS.

but:

while 1
Sleep(100)
$msg=guigetmsg()
;..
;..

should after what i know just be:

while 1
$msg=guigetmsg()
;..
;..
.

Since the GUIgetmsg idles the CPU.

Edit:Typo

Tnx that solved my "lag" problem :)

Share this post


Link to post
Share on other sites

I am, the only Administrator on this computer.

maybe you are not in the administrator's group

type > contro userpasswords2 in the run com. line and check if your current user is listed in the Administrator's group

if not make him and then check the program

Share this post


Link to post
Share on other sites

Yes and it says:

James: Debugger Users;Administrators

hm u r in the administrators but i think you should remove the debugger users

not sure

Share this post


Link to post
Share on other sites

It's been awhile (since college) since I've messed with TeamSpeak, but this is impressive.

@Secure_ICT:

I think he means you have to login to the TeamSpeak server with your super admin account on there (I do remember their being a super admin on it). Again, it's been awhile for me, so I may be wrong, but it makes sense that, to control TeamSpeak, you'd have to be logged in as an admin, let alone the Super Admin.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0