Page 1 of 1

TeamSpeak

Posted: Tue Dec 22, 2015 11:48 am
by boberski
Hi,

I have private TS3 server on my privet VPS is someone intrested in joining, or maybe we just create official POL channel there?

Do not by shy :P

http://ts.hell-yeah.pl/ (all the addresses and ports)
Server password: HellYeah!@#$ (if it do not work please ping me :P)

Re: TeamSpeak

Posted: Tue Dec 22, 2015 12:51 pm
by xeon
Would be awesome if someone developed a module to configure Teamspeak channels from POL, for example, 1 ts channel for guild etcetera :cheesy:

Re: TeamSpeak

Posted: Tue Dec 22, 2015 1:02 pm
by bodom
xeon wrote:Would be awesome if someone developed a module to configure Teamspeak channels from POL, for example, 1 ts channel for guild etcetera :cheesy:
That's a nice idea, and it seems to be a quite easy feature to script :D
If you'll go on and start working on that package, let me know if you'll need an hand!

Re: TeamSpeak

Posted: Tue Dec 22, 2015 11:46 pm
by boberski
xeon wrote:1 ts channel for guild etcetera :cheesy:
Just give a name, I will create it. :)

Re: TeamSpeak

Posted: Wed Dec 23, 2015 6:37 am
by boberski
I created cannel for POLServer :)

Re: TeamSpeak

Posted: Thu Dec 24, 2015 1:54 pm
by xeon
Well send a patch to POL devs ;)

Re: TeamSpeak

Posted: Fri Dec 25, 2015 3:30 am
by boberski
@xeon - I created channel on my TS3 server to this community :) Maybe I create POL module for that in the future. :)

Re: TeamSpeak

Posted: Fri Dec 25, 2015 12:19 pm
by CWO
You can probably pull this off by scripting a Teamspeak bot and use the POL AUX interface. I used to have an mIRC bot that you could do quite a few things on like create accounts, get info on players and server statistics.

Re: TeamSpeak

Posted: Fri Dec 25, 2015 1:28 pm
by xeon
Yes, I just don't know from an aux package how to pilot a Teamspeak server. I saw, when I looked into it, some kind of libraries to integrate with, so an external program maybe should be written to achieve that.

Re: TeamSpeak

Posted: Sun Dec 27, 2015 1:13 am
by CWO
Well, the teamspeak bot needs to initiate the connection to POL through the configured AUX port (auxsvc.cfg). From there, the POL script is fired. The POL script could send strings to the teamspeak bot that the bot will process as commands, it can also receive commands from the teamspeak bot if needed. What you do is make the AUX script an event based script, set the PID to a global prop, then send events that will forward as commands to the teamspeak bot.

Here's an example of the POL AUX script that I made for IRC

in IRC, if players would type !online, the IRC bot sends "sonline" to POL (important: remember the 's' for string, 'i' for integer). It then ran the function and transmitted back the number of online players, typically i## like 'i25' for 25 players online.

An example of a POL script sending an event to the script which gets passed to the bot would be the Pages() function. The string would be constructed in the AUX script and transmitted to the bot.

Code: Select all

// AccountBot connection script by CWO
// This script handles various communications both AccountBot-Server and Server-AccountBot.

use uo;
use os;

program AccountBot(con)
	Print("AccountBot has connected to POL");
	SetGlobalProperty("accountbot", getpid());			// This needs to be set so that other scripts can send events to it. Ex: Paging.
	while(con)									// While the connection is active
		var ev := wait_for_event(120);				// Wait up to 120 seconds for anything to happen.
		if (!ev)
			continue;							// If nothing has come in, re-loop
		endif
		Print("AccountBot communication: " + CStr(ev.value));
		var thevalue := SplitWords(ev.value);
		case(thevalue[1])
				"p"		: con.transmit("p");					// AccountBot ping/pong.
				"online"	: con.transmit("online:" + Online());		// Number of players online.
				"player"	: PlayerInfo(con, ev.value);			// Specific player info.
		 		"stats"	: ServerStats(con);					// Server Stats.
		  		"page"	: Pages(con, ev);					// Page transmission to IRC.
		endcase
	endwhile
	Print("AccountBot disconnected");
endprogram

function Online()
	var count := 0;
	foreach player in EnumerateOnlineCharacters()
		if (!player.cmdlevel)
			count := count + 1;
		endif
	endforeach
	return count;						// Number of non-staff online.
endfunction

function PlayerInfo(con, value)
	value["player "] := "";
	foreach player in EnumerateOnlineCharacters()
		if (lower(value) == lower(player.name) && !player.cmdlevel)
			con.transmit("player:" +player.name + ":" + CStr(GetObjProperty(player, "Fame") + ":" + GetObjProperty(player, "Karma") + ":" + GetObjProperty(player, "onlinetimer")/60));		//Player is online. Send info.
			return;
		endif
	endforeach
    con.transmit("player:x");					//Player is offline.
endfunction

function ServerStats(con)
	con.transmit("stats:" + CStr(polcore().itemcount + ":" + polcore().mobilecount + ":" + polcore().sysload + ":" + polcore().sysload_severity + ":" + polcore().uptime + ":" + Online() + ":" + polcore().instr_per_min));
endfunction

function Pages(con, ev)
	if (ev.pagername)									//If POL is sending a new page out
		con.transmit("page:" + ev.pagername + ":" + ev.page);
	else												//Else a staff member sent the !pages command from IRC
		var status;
		var people := EnumerateOnlineCharacters();
		foreach page in GetGlobalProperty("Pagelist")
			if (SystemFindObjectBySerial(page.chrserial) in people)	//Pager is online
				status := "onln";
			else
				foreach player in people
					if (player.acctname == page.acctname)		//Pager is online but on another character
						status := "acct";
					endif
				endforeach
				if (status != "acct")							//Pager is offline
					status := "ofln";
				endif
			endif
			con.transmit("pagecmd:" + status + ":" + page.name + ":" + page.text);   // Send individual page
		endforeach
		if (!status)
			con.transmit("pagecmd:nopages");					// There are no pages currently
		endif
	endif
endfunction
So this is an example of what the POL side could look like. I couldn't help you from the teamspeak side.

Re: TeamSpeak

Posted: Thu Dec 31, 2015 5:04 am
by xeon
Thanks for sharing CWO
I just don't know any "bot" out there able to pilot a Teamspeak server.
If you have any link to share!

EDIT
I just found out a bot based on .NET
I think I'll see what I can produce ... :D

Re: TeamSpeak

Posted: Fri May 26, 2017 12:29 pm
by boberski
One more time :)
If some of you want to voice chat please do not hesitate and join https://ts.hyeah.pl/. There is a channel called Penultima OnLine especially for people from this forum.

Teamspeak server address is ts.hyeah.pl I think I do not have to explain how to connect to TS3 server :P

Re: TeamSpeak

Posted: Sat May 27, 2017 5:32 am
by DevGIB
Channel maxfamily reached :(

Re: TeamSpeak

Posted: Sat May 27, 2017 12:00 pm
by boberski
What do you mean by that?

EDIT:
Check now to see if you get this error :)

Re: TeamSpeak

Posted: Sun May 28, 2017 4:33 am
by DevGIB
Yep working now.
Sure is quite in here :P