ASECO/RASP v0.91 released!

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Xerrez
pedestrian
pedestrian
Posts: 5
Joined: 15 Dec 2007 16:39
Owned TM-games: TMN, TMU

Re: ASECO/RASP v0.91 released!

Post by Xerrez » 16 Dec 2007 20:04

thank you

User avatar
Slig
Pit Crew
Pit Crew
Posts: 2124
Joined: 05 Sep 2005 17:51
Owned TM-games: ALL
Location: TraxicoLand (Fr)
Contact:

Re: ASECO/RASP v0.91 released!

Post by Slig » 17 Dec 2007 01:08

Xymph wrote:I can see how this would help fix your 64-bit problem, and it doesn't hurt to use it on 32-bit systems (Aseco still works fine on my server with this), so I added it to the next release.
There are some other issues than this one for GbxRemote.inc.php with php5/php6 on linux 64 (amd64), for windows 64 i don't know, i can't test. And there are issues not only with amd64 but all recent php5/php6, for the stream_select() particulary...

I think that the version i modified some time ago should be ok for aseco too : GbxRemote.inc.zip or GbxRemote.inc.php.txt

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

re: ChatBot for xymph's aseco

Post by Assembler Maniac » 17 Dec 2007 05:18

Assembler Maniac wrote:It won't be very hard to port chatbot to tmn, I think that's where it started anyway. I'll work on it in the next few days.

Tony_Bad_Mann wrote:I tried the chatbot that Assembler Maniac was talking about from RASP 2.x but it seems it won't work with tmn or your 0.91 aseco anyway so I guess i'll wait for someone to do a final working release of a chatbot or go without one, thanks anyway tho.

And here it is:

plugin.chatbot.php

Code: Select all

<?php

/* plugin.rasp_chatbot.php

 Original idea (and some text) from XXX.Max, many other contributors have had hands in this.

 Provides for ban/kick/msgs from the bot
 edit chatbot.xml to change words/phrases/general settings

 // this re-write done from the ASECO TMU version - 2007-12-17 Assembler Maniac

 */

require_once('includes/xmlparser.inc.php');  // provides an xml parser

Aseco::registerEvent('onStartup', 'chatbot_startup');
Aseco::registerEvent('onChat', 'chatbot_chat');

class ChatBot
	{
	private $BotTag;
	private $kickwords;
	private $kicktext;
	private $banwords;
	private $bantext;
	private $blacklistwords;
	private $blacklisttext;
	private $textmsgs;
	public $Aseco;

	function loadSettings()
		{
		$xml_parser = new Examsly();
		$settings = $xml_parser->parseXML('chatbot.xml');
		$settings = $settings['SETTINGS'];

		foreach ($settings as $key => $value)
			{
			if ( $key == 'WATCHFOR' )
				{
				continue;
				}
			unset($settings[$key]);
			$settings[$key] = $value[0];
			}

		$this->textmsgs = array();

		foreach ($settings['WATCHFOR'][0]['TEXT'] as $val)
			{
			$t1 = split('\|', $val);
			$key = $t1[0];
			unset($t1[0]);
			$this->textmsgs[$key] = $t1;
			}

		$this->BotTag = $settings['BOTTAG'];
		$this->kicktext = $settings['KICKTEXT'];
		$this->bantext = $settings['BANTEXT'];
		$this->kickwords = split(',', $settings['KICKWORDS']);
		$this->banwords = split(',', $settings['BANWORDS']);
		$this->blacklistwords = split(',', $settings['BLACKLISTWORDS']);
		}

	function checkChatText(&$command)
		{
		// ignore text that comes from the server
		// also ignore anything that looks like it's a command
		if ( $command[0] == 0 || substr($command[2], 0, 1) == '/' )		// $command[0] is the player id, 0 = server
			{
			return;
			}

		foreach ($this->textmsgs as $key => $value)
			{
			if ( !(stripos($command[2], $key) === false) )
				{
				if ( count($value) == 1 )
					{
					$message = $this->BotTag . $value[1];
					}
				else
					{
					$key = array_rand($value);
					$message = $this->BotTag . $value[$key];
					}
				$this->Aseco->client->query("ChatSendServerMessage", $message);
				return;
				}
			}

		foreach ($this->kickwords as $value)
			{
			if ( !(stripos($command[2], $value) === false) )
				{
				$message = $this->BotTag . $this->kicktext;
				$this->Aseco->client->query("ChatSendServerMessageToLogin", $message, $command[1]);
				$this->Aseco->client->query("Kick", $command[1]);
				return;
				}
			}

		foreach ($this->banwords as $value)
			{
			if ( !(stripos($command[2], $value) === false) )
				{
				$message = $this->BotTag . $this->bantext;
				$this->Aseco->client->query("ChatSendServerMessageToLogin", $message, $command[1]);
				$this->Aseco->client->query("Ban", $command[1]);
				return;
				}
			}

		foreach ($this->blacklistwords as $value)
			{
			if ( !(stripos($command[2], $value) === false) )
				{
				$message = $this->BotTag . $this->blacklisttext;
				$this->Aseco->client->query("ChatSendServerMessageToLogin", $message, $command[1]);
				$this->Aseco->client->query("Blacklist", $command[1]);
				return;
				}
			}
		}  //  checkChatText
	}

function chatbot_startup()
	{
	global $aseco;
	global $chatbot;

	$chatbot = new ChatBot();

	$chatbot->Aseco = $aseco;
	$chatbot->loadSettings();
	}  //  chatbot_startup

function chatbot_chat(&$aseco, &$command)
	{
	global $chatbot;
	$chatbot->checkChatText($command);
	}  //  chatbot_onchat
This is chatbot.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<settings>
	<BotTag>$f00 [ChatBot] $z</BotTag>
	<kickwords></kickwords>
	<kicktext>You were warned when you entered the server...  Now autobooting...</kicktext>
	<banwords></banwords>
	<bantext>Now banning you for life...</bantext>
	<blacklistwords></blacklistwords>
	<blacklisttext>Now blacklisting you for life...</blacklisttext>
	<watchfor>
		<text>chatbot stars|$0a0 Start with a cold gas. This is attracted to the centre by gravity. The outside forms into a disk as the inside continues to heat up and contract eventually stabalizing the pressure. This is how you make a star.</text>
		<text>chatbot version|$0a0 RASP Chat bot version 1.0 by Assembler Maniac. Total re-write from scratch.</text>
		<text>chatbot rank|$0a0 Typing $0ff/rank $0a0shows your position in relation to unique players that have visited this server. Depends on your highest placings in the maps on rotation</text>
		<text>chatbot karma|$0a0Typing $0ff/karma $0a0 allows you to see how good a track is. To give a karma point type ++ or -- if you dislike it. 1 vote per person per track, you can change at any time</text>
		<text>chatbot jukebox|$0a0 To use $0aaJUKEBOX $0a0first type $0ff/list $0a0to get map i.d. number, then type $0ff/jukebox $0a0and the  number of your map. eg.$0ff/jukebox 23</text>
		<text>chatbot help|$0a0/HELP $0ff(shows command list)$0a0 /RECS $0ff(shows top 5 server records) $0a0
/LIST $0ff(shows map no.)$0a0 /JUKEBOX 00? $0ff(Queue map up)</text>
		<text>chatbot thx| Anytime.</text>
	</watchfor>
</settings>
You can set as many "watchfor" texts as you want. Format for a watchfor is this:
<text>look for this|reply with this|or this|or this|or whatever # of possible responses you want, they'll randomly be chosen</text>

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: re: ChatBot for xymph's aseco

Post by Ant » 17 Dec 2007 12:08

Assembler Maniac wrote:
Assembler Maniac wrote:It won't be very hard to port chatbot to tmn, I think that's where it started anyway. I'll work on it in the next few days.

Tony_Bad_Mann wrote:I tried the chatbot that Assembler Maniac was talking about from RASP 2.x but it seems it won't work with tmn or your 0.91 aseco anyway so I guess i'll wait for someone to do a final working release of a chatbot or go without one, thanks anyway tho.

And here it is:



You can set as many "watchfor" texts as you want. Format for a watchfor is this:
<text>look for this|reply with this|or this|or this|or whatever # of possible responses you want, they'll randomly be chosen</text>
Nice one i'll let you know how i get on with it cheers man ! :D

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: ASECO/RASP v0.91 released!

Post by Ant » 17 Dec 2007 12:17

Well I tried it out, and I get this error, what should I do ??

Code: Select all

# initialize ASECO ############################################################
[Aseco] PHP Version is 5.1.6
[Aseco] Load settings [config.xml]
[Aseco] Load admin/ops lists [adminops.xml]
[Aseco] Load plugin [plugin.localdatabase.php]
[Aseco] Load plugin [plugin.rounds.php]
[Aseco] Load plugin [chat.admin.php]
[Aseco] Load plugin [chat.help.php]
[Aseco] Load plugin [chat.records.php]
[Aseco] Load plugin [chat.records2.php]
[Aseco] Load plugin [chat.recrels.php]
[Aseco] Load plugin [chat.players.php]
[Aseco] Load plugin [chat.players2.php]
[Aseco] Load plugin [chat.wins.php]
[Aseco] Load plugin [chat.laston.php]
[Aseco] Load plugin [chat.stats.php]
[Aseco] Load plugin [chat.server.php]
[Aseco] Load plugin [chat.me.php]
[Aseco] Load plugin [plugin.track.php]
[Aseco] Load plugin [plugin.rasp.php]
[Aseco] Load plugin [plugin.rasp_jukebox.php]
[Aseco] Load plugin [plugin.rasp_chat.php]
[Aseco] Load plugin [plugin.rasp_karma.php]
[Aseco] Load plugin [plugin.rasp_nextmap.php]
[Aseco] Load plugin [plugin.rasp_nextrank.php]
[Aseco] Load plugin [plugin.rasp_votes.php]
[Aseco] Load plugin [plugin.chatlog.php]
[Aseco] Load plugin [plugin.uptodate.php]
[Aseco] Load plugin [jfreu.plugin.php]
[Aseco] Load plugin [mistral.idlekick.php]
[Aseco] Load plugin [plugin.chatbot.php]
    [Aseco] Try to connect to server on 127.0.0.1:5003
[Aseco] Try to authenticate with username '*****' and password '*****'
[Aseco] Connection established successfully!
[Local DB] Load settings file
[Local DB] Try to connect to MySQL server
[Local DB] MySQL Server Version is 5.0.24a-community-nt
[RASP] Cleaning up unused data
*-*-*-*-*-* RASP is running! *-*-*-*-*-*
|...Loading Settings
|...Loaded!
|...Checking database structure
|...Structure OK!
|...Calculating ranks
|...Done!
[ASECO Warning] [XML Error 64] Reserved XML Name on line 1
[PHP Warning] Invalid argument supplied for foreach() on line 37 in file C:\TmDe
dicatedServer_2006-05-30\TmDedicatedServer\aseco_rasp_091\aseco_rasp_091\plugins
\plugin.chatbot.php
[PHP Warning] Invalid argument supplied for foreach() on line 49 in file C:\TmDe
dicatedServer_2006-05-30\TmDedicatedServer\aseco_rasp_091\aseco_rasp_091\plugins
\plugin.chatbot.php
###############################################################################
  Aseco v0.91 Xymph running on 127.0.0.1:5003
  Game  : TmNationsESWC - TimeAttack
  Author: Florian Schnell
  Re-Authored: Assembler Maniac & Xymph
###############################################################################
Begin Race
[12/17,12:21:31] track changed [none] >> [XXX Firebrand]
[12/17,12:21:31] current record on XXX Firebrand is 0:47.07 and held by DFAJazzy
Last edited by Ant on 13 May 2010 02:14, edited 1 time in total.

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO/RASP v0.91 released!

Post by Assembler Maniac » 17 Dec 2007 13:06

Not sure what to do about that, I did actually test run it here with no problems. Hopefully Xymph can lend a hand on this.

edit:
Ok, I tested it again on TMN with my old version of RASP and it's still working.

I'm betting that the cut/paste corrupted something. Try downloading http://www.pchotshots.com/amaniac/chatbot.zip and let me know if there's still a problem.
Asus P4C800-E Deluxe
P4 3.2Ghz @ 3.35Ghz
2G Kingston Hyper-X DDR 2
ATI Radeon X850 XT Platinum 256M
Sound Blaster Audigy II
2x 120G Maxtor Hard drives
HDTV Tuner Card (Fusion 5 Gold)

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: ASECO/RASP v0.91 released!

Post by Ant » 17 Dec 2007 13:50

Ok nice one, it works now, dunno what happened before then, but thankyou very much its just what I was after !! :1010

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO/RASP v0.91 released!

Post by Assembler Maniac » 17 Dec 2007 13:59

Tony_Bad_Mann wrote:Ok nice one, it works now, dunno what happened before then, but thankyou very much its just what I was after !! :1010
Glad to help. Best part is that it took only minor changes to make the TMU version work for TMN. Wish all of the plugins were that easy.
Asus P4C800-E Deluxe
P4 3.2Ghz @ 3.35Ghz
2G Kingston Hyper-X DDR 2
ATI Radeon X850 XT Platinum 256M
Sound Blaster Audigy II
2x 120G Maxtor Hard drives
HDTV Tuner Card (Fusion 5 Gold)

User avatar
sbone
happy cruiser
happy cruiser
Posts: 180
Joined: 13 Sep 2007 18:11
Owned TM-games: TMUF, TM2
Location: In the sky...
Contact:

Re: ASECO/RASP v0.91 released!

Post by sbone » 17 Dec 2007 14:39

Hi,

Thanks Xymph to this release (again ;) )

At first start, for jfreu's settings (like servername), shall we put them in the both files :
aseco/plugins/jfreu/jfreu.config.xml
and aseco/includes/jfreu.config.php

or only in the second one (xml file will be writed at start isn't it ?)

Another thing, what is <pf>0</pf> at the end of jfreu.config.xml ?
@+
-- SbOne --
Public CSb1 portal : http://csb1.sbone.fr -/- Team CSb1 : http://sbone.fr

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: ASECO/RASP v0.91 released!

Post by Ant » 17 Dec 2007 15:20

Assembler Maniac wrote:
Tony_Bad_Mann wrote:Ok nice one, it works now, dunno what happened before then, but thankyou very much its just what I was after !! :1010
Glad to help. Best part is that it took only minor changes to make the TMU version work for TMN. Wish all of the plugins were that easy.

lol, well i have a fair few responses set on it now, maybe you can come and check it out on my server and let me know if you think i can improve any or add any more. Anyone else is welcome to give me feedback too.

Thanks again mate my server is a better place with a bot in your face !! :lol:

Xymph
Pit Crew
Pit Crew
Posts: 5650
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO/RASP v0.91 released!

Post by Xymph » 17 Dec 2007 21:06

Slig wrote:There are some other issues than this one for GbxRemote.inc.php with php5/php6 on linux 64 (amd64), for windows 64 i don't know, i can't test. And there are issues not only with amd64 but all recent php5/php6, for the stream_select() particulary...

I think that the version i modified some time ago should be ok for aseco too : GbxRemote.inc.zip or GbxRemote.inc.php.txt
Okay, there are a lot more changes here indeed, but they look plausible and everything works fine on my server, so I'll include this with the next release. Thanks.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO/RASP v0.91 released!

Post by Assembler Maniac » 17 Dec 2007 21:09

Xymph wrote:
Slig wrote:There are some other issues than this one for GbxRemote.inc.php with php5/php6 on linux 64 (amd64), for windows 64 i don't know, i can't test. And there are issues not only with amd64 but all recent php5/php6, for the stream_select() particulary...

I think that the version i modified some time ago should be ok for aseco too : GbxRemote.inc.zip or GbxRemote.inc.php.txt
Okay, there are a lot more changes here indeed, but they look plausible and everything works fine on my server, so I'll include this with the next release. Thanks.
Feel free to download and include the chatbot as well.
Asus P4C800-E Deluxe
P4 3.2Ghz @ 3.35Ghz
2G Kingston Hyper-X DDR 2
ATI Radeon X850 XT Platinum 256M
Sound Blaster Audigy II
2x 120G Maxtor Hard drives
HDTV Tuner Card (Fusion 5 Gold)

Xymph
Pit Crew
Pit Crew
Posts: 5650
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO/RASP v0.91 released!

Post by Xymph » 17 Dec 2007 21:10

sbone wrote:Thanks Xymph to this release (again ;) )
My pleasure.
sbone wrote:At first start, for jfreu's settings (like servername), shall we put them in the both files :
aseco/plugins/jfreu/jfreu.config.xml
and aseco/includes/jfreu.config.php

or only in the second one (xml file will be writed at start isn't it ?)
Yes, only in the .php file. The .xml file isn't automatically written (nor read) at startup, but it is written every time one of the settings in there is modified via a /jfreu command, and of course by the /jfreu writeconfig command itself. If you do modify any settings, after an Aseco restart you should do /jfreu readconfig first.
sbone wrote:Another thing, what is <pf>0</pf> at the end of jfreu.config.xml ?
That's the time value defined by the /jfreu nopfkick command.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Xymph
Pit Crew
Pit Crew
Posts: 5650
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO/RASP v0.91 released!

Post by Xymph » 17 Dec 2007 21:19

Assembler Maniac wrote:Feel free to download and include the chatbot as well.
Thanks for the offer, but as I have mentioned before I am not going to add any particular chatbot to the official distribution. I added a link to your post in the Plugins section of my TMN page though.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Aikira
highway camper
highway camper
Posts: 4
Joined: 19 Dec 2007 07:54
Owned TM-games: TMN, TMU

Re: ASECO/RASP v0.91 released!

Post by Aikira » 19 Dec 2007 08:17

We have a problem with Aseco/RASP v0.91 on a Debian 64 Lamp Root Server, probably one of you could help us... We have started TrackmaniaServer with all the necessary settings, we started under phpmyadmin the necessary database and we also copied a running Version of Aseco v0.91 onto the rootserver. After starting the TrackmaniaServer and after running Aseco with (php5 aseco.php), we get the load plugin messages and rasp is running, until we get
Begin Race
[12/19,09:12:32] track changed [none] >> [Little empire]
[12/19,09:12:32] currently no record on Little empire

and that's it. We've tried different GbxRemote.inc.php files specified here, but the result stays the same, aseco always stops after the first few print outs on the terminal. We hope that you can help us with our problem, if you need more infos please let us know.

Bye Aikira

P.S.: I want to apologize for my English, I'm just a German ;-)

Post Reply