BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: Yrmy on July 14, 2008, 02:39:32 pm

Title: Teamspeak manager
Post by: Yrmy on July 14, 2008, 02:39:32 pm
Hi!

I decided to release my TS manager here. It's tested with BeBot Hyborian, but I guess it will work with AO bot too.

Along with my tsman.php comes libacts2 - The TeamSpeak 2 PHP library (http://libacts2.absurdcoding.org/manual/ric_README.html).

To get this running you must unzip the whole thing to ..\custom\modules. After that you should see tsman.php and tsman directory that is for Absurd library.

Settings are pretty obvious.
Code: [Select]
$address = '127.0.0.1'; //Default '127.0.0.1' aka localhost
$tcpport = 51234; //Default is 51234
$timeout = 5; //Default 5
$server='1'; //Default  1
$superadmin='superadmin'; //Default superadmin
$sapassword='YOURPASSWORDHERE';
$serverport=8767;//Default 8767 If multiple servers in same IP choose right port here

You do have to use superadmin account to run this.

Hope you like it!


Release notes:
0.22

Changes:
- Access controll added to commands.
Code: [Select]
//GUEST can only have list, LEADER can also move and kick ppl. Admin has powwa to ban.
  $this -> register_command('all', 'tsman', 'ADMIN', array('list' => 'GUEST', 'move' => 'LEADER', 'kick' => 'LEADER', 'ban' => 'ADMIN'));
- require("tsman/Absurd.php");

* * *
0.20 first public release

Features:
*list server channels and clients
*move clients from channel to channel
*kick client from server
*kickban client for x minutes

Commands:
*tsman  - treeview of server with channels and clients on them
*tsman list - same as above
*tsman move <client_id> <channel_id> - move client to another channel
*tsman kick <client_id> - kick client
*tsman ban <client_id> <##> - ban and kick client for ## minutes
Title: Re: Teamspeak manager
Post by: Dookie on July 15, 2008, 08:43:16 am
Ok, this is a very cool one!
Unfortunately it won't connect to my server.
I'm always getting

Code: [Select]
Fatal error: Uncaught exception 'Absurd_TeamSpeak2_Exception' with message 'ERROR, invalid login' in /var/www/vhosts/censored.com/download/bebot/modules/tsman/Absurd/TeamSpeak2/TCPClient.php:106
Stack trace:
#0 /var/www/vhosts/censored.com/download/bebot/modules/tsman/Absurd/TeamSpeak2/Host.php(149): Absurd_TeamSpeak2_TCPClient->request('slogin Name...')
#1 /var/www/vhosts/censored.com/download/bebot/modules/tsman/Absurd/TeamSpeak2/Host.php(126): Absurd_TeamSpeak2_Host->request('slogin Name...')
#2 /var/www/vhosts/censored.com/download/bebot/modules/tsman.php(94): Absurd_TeamSpeak2_Host->login('Name', 'password')
#3 /var/www/vhosts/censored.com/download/bebot/modules/tsman.php(57): ts->connectTS('censored...', 51234, 5, 8767, 'Name', 'password')
#4 /var/www/vhosts/censored.com/download/bebot/main/02_BaseActiveModule.php(114): ts->command_handler('Someone', 'tsman', 'tell')
#5 /var/www/vhosts/censored.com/download/bebot/Sources/Bot.php(779): BaseActiveModule->tell('So in /var/www/vhosts/censored.com/download/bebot/modules/tsman/Absurd/TeamSpeak2/TCPClient.php on line 106

I created a new TS user with appropriate rights and I'm sure the login details are correct.
What can be wrong here?

BTW: Linux users running bebot have to change line 24 of tsman.php into
Code: [Select]
  require("tsman/Absurd.php");(slash and not backslash) or the bot will crash because he can't find and incluse that file!
Title: Re: Teamspeak manager
Post by: Temar on July 15, 2008, 08:54:48 am
like it says invalid login
this module uses SuperAdmin not Admin
Title: Re: Teamspeak manager
Post by: Yrmy on July 15, 2008, 11:01:53 am
I will change line 24 to require("tsman/Absurd.php"); in next version. I will also add access level control for commands. It's probably a bad idea to give everyone kick/ban rights  ;D
Title: Re: Teamspeak manager
Post by: Dookie on July 15, 2008, 04:51:14 pm
Quote
this module uses SuperAdmin not Admin
Well, I thought I will not have to use the superadmin account, because Yrmy said it's not required:
Quote
You don't have to use superadmin account to run this.
Title: Re: Teamspeak manager
Post by: Yrmy on July 15, 2008, 08:24:36 pm
My bad. It really does need superadmin access. I updated my original post and also uploaded the 0.22 version. It adds access control and fixes that backslash to slash.
Title: Re: Teamspeak manager
Post by: weipa on July 15, 2008, 10:49:31 pm
have error message can't connet to teamspeak at 127.0.0.1:51234

but in config file i put ip from the ts-server
Title: Re: Teamspeak manager
Post by: Yrmy on July 15, 2008, 11:10:10 pm
have error message can't connet to teamspeak at 127.0.0.1:51234

but in config file i put ip from the ts-server

Did you edit tsman.php line 45 and restarted the bot after that. Because that error message really means the module is connecting to localhost.
Title: Re: Teamspeak manager
Post by: weipa on July 15, 2008, 11:25:39 pm
now this errormessage in bot cmd line and then bot restart
i place login and login pw with xxxx

Code: [Select]
Fatal error: Uncaught exception 'Absurd_TeamSpeak2_Exception' with message 'ERRO
R, invalid login' in G:\aoc bot\neu\custom\modules\tsman\Absurd\TeamSpeak2\TCPCl
ient.php:106
Stack trace:
#0 G:\aoc bot\neu\custom\modules\tsman\Absurd\TeamSpeak2\Host.php(149): Absurd_T
eamSpeak2_TCPClient->request('slogin test cer...')
#1 G:\aoc bot\neu\custom\modules\tsman\Absurd\TeamSpeak2\Host.php(126): Absurd_T
eamSpeak2_Host->request('slogin test cer...')
#2 G:\aoc bot\neu\custom\modules\tsman.php(95): Absurd_TeamSpeak2_Host->login('t
est', 'cervix')
#3 G:\aoc bot\neu\custom\modules\tsman.php(58): ts->connectTS('81.169.184.220',
'51234', '5', '9019', 'xxxxx', 'xxxxx')
#4 G:\aoc bot\neu\main\02_BaseActiveModule.php(133): ts->command_handler('Neria'
, 'tsman', 'tell')
#5 G:\aoc bot\neu\Sources\Bot.php(786): BaseActiveModule->tell('Neria', 'tsman')

#6 G:\aoc bot\neu\Sources\Bot.php(846): Bot->check_access_and_execute('Neria', '
tsman', 'tsman', 'tell', NULL)
#7 G:\aoc bot\neu\Sources\Bot.php(972): Bot->handle_command_input('Neria', '!tsm
an', 'tell')
#8 G:\aoc bot\neu\Main.php(370): Bot->inc_tell(Array)
#9 [internal function]: callback(30, Array, NULL)
#10 G:\aoc bot\neu\Sources\AOChat.php(365): call_user_func('callback', 30, Array
, NULL)
#11 G:\aoc bot\neu\Sources\AOChat.php(249): AOChat->get_packet()
#12 G:\aoc bot\neu\Main.php(341): AOChat->wait_for_packet()
#13 {main}
  thrown in G:\aoc bot\neu\custom\modules\tsman\Absurd\TeamSpeak2\TCPClient.php
on line 106
Title: Re: Teamspeak manager
Post by: Yrmy on July 16, 2008, 05:54:27 am
You are not using superadmin to login.
Title: Re: Teamspeak manager
Post by: weipa on July 16, 2008, 09:43:21 am
tried it with two accounts both has SA flag when  i use it to connect
Title: Re: Teamspeak manager
Post by: Yrmy on July 16, 2008, 11:39:11 am
I'd still say there's something wrong with your settings in tsman.php, teamspeak server or in your firewall.
Title: Re: Teamspeak manager
Post by: weipa on July 16, 2008, 11:47:06 am
is there a specific port to open?
or manually allow startbot.bat in windows firewall?
maybe the $tcpport is not default port on this server, i am unable to reach the admin/owner of the ts server, is it possible to find out the port?
Title: Re: Teamspeak manager
Post by: soccerboyis on July 30, 2008, 06:56:32 am
I'll probably get flamed but could this possibly work for Ventrilo with ventrilo's server status? I don't know much about coding so this probably was a stupid question lol. I know there was a mod that someone made for ventrilo but I'm not sure if it was for AoC and I could never get it working.
Title: Re: Teamspeak manager
Post by: Yrmy on July 30, 2008, 08:06:16 am
Nope, only with teamspeak.
Title: Re: Teamspeak manager
Post by: enhance on August 07, 2008, 03:49:35 am
Why does this need superadmin?  Is there any way to get this running in a limited form with just a normal server admin?  Most rented TS servers do not allow you to have or make superadmins.
Title: Re: Teamspeak manager
Post by: enhance on August 07, 2008, 06:11:52 am
Answering my own question...

Replacing the line:
Quote
$host->login($superadmin, $sapassword);   //Authenticate as SuperAdmin on this host

With:
Quote
     $server=$host->getServerByUdp($serverport);
     $server->login($superadmin, $sapassword);   //Authenticate as Server Admin on this server


Will make it work as a server admin, and not a superadmin.

Also, the \d in the preg_matches needs to be changed to \d*.  That way it can match multiple digit ids.
Title: Re: Teamspeak manager
Post by: Barlyman on August 15, 2008, 05:31:38 am
I know this dont help me much but I installed the module and edited the tsman.php and all seems fine, except I dont get any responce from the bot when trying a "!tsman" or "!tsman list", not even an error message.

in !help I see tsman and I can do a "!help tsman" and get the info, but none of the commands work.

does anyone have the slightest clue to what might cause this?

would relly like this module to work :) would be so much easier in raids

//Barlyman
Title: Re: Teamspeak manager
Post by: Drizzurdeen on February 17, 2009, 06:42:47 pm
nice tool ... but where i can download it ???

sry for the question :(
Title: Re: Teamspeak manager
Post by: xdave78 on February 17, 2009, 06:54:50 pm
At the End of the first Thread ';)
Title: Re: Teamspeak manager
Post by: Drizzurdeen on February 18, 2009, 06:55:29 pm
tx a lot ... works wunderful :D
Title: Re: Teamspeak manager
Post by: Temar on February 18, 2009, 08:34:22 pm
just so you know there is a Huge problem with this module
it wasn't designed for use on a Bot
this module creates objects every time you use it, and the memory use your bot is using increases each time
Title: Re: Teamspeak manager
Post by: Iheaca on February 25, 2009, 05:29:56 pm
It is nevertheless a great Bot, one of the few providing a clear view of channels and users. I use it a lot.

Hopefully an updated version or new TS Manager will emerge with no bug/issues :)
Title: Re: Teamspeak manager
Post by: Yrmy on February 25, 2009, 06:40:45 pm
It is nevertheless a great Bot, one of the few providing a clear view of channels and users. I use it a lot.

Hopefully an updated version or new TS Manager will emerge with no bug/issues :)

Nice to hear you find this usefull. Unfortunately I'm not playing aoc anymore so if anyone is willing to improve this bot you have blessing.
Title: Re: Teamspeak manager
Post by: knutarn on October 25, 2010, 09:51:52 am
Work on TeamSpeak 3?
Title: Re: Teamspeak manager
Post by: Drizzurdeen on October 25, 2010, 01:28:47 pm
don't think so ... haven't seen any mod for ts3 so far :(
Title: Re: Teamspeak manager
Post by: knutarn on October 25, 2010, 10:57:59 pm
aa:/ 
Title: Re: Teamspeak manager
Post by: knutarn on January 11, 2011, 02:15:09 pm
can non make a mod to TS3
SimplePortal 2.3.7 © 2008-2024, SimplePortal