TeamSpeak

Open discussion forum. For topics that do not fit anywhere else.

Moderator: POL Developer

Post Reply
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

TeamSpeak

Post 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)
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: TeamSpeak

Post 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:
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: TeamSpeak

Post 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!
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: TeamSpeak

Post by boberski »

xeon wrote:1 ts channel for guild etcetera :cheesy:
Just give a name, I will create it. :)
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: TeamSpeak

Post by boberski »

I created cannel for POLServer :)
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: TeamSpeak

Post by xeon »

Well send a patch to POL devs ;)
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: TeamSpeak

Post by boberski »

@xeon - I created channel on my TS3 server to this community :) Maybe I create POL module for that in the future. :)
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: TeamSpeak

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: TeamSpeak

Post 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.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: TeamSpeak

Post 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.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: TeamSpeak

Post 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
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: TeamSpeak

Post 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
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: TeamSpeak

Post by DevGIB »

Channel maxfamily reached :(
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: TeamSpeak

Post by boberski »

What do you mean by that?

EDIT:
Check now to see if you get this error :)
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: TeamSpeak

Post by DevGIB »

Yep working now.
Sure is quite in here :P
Post Reply