[Xaseco] Nouse Link V1.1

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

Moderators: Xymph, TM-Patrol

User avatar
Knutselmaaster
swift roadking
swift roadking
Posts: 692
Joined: 16 Feb 2007 01:40
Owned TM-games: TMO/TMN/TMNF/TMU
Manialink(s): intr
Location: Between DisneyLand and Paris
Contact:

Re: [Xaseco] Nouse Link V1.1

Post by Knutselmaaster » 17 Jan 2010 20:13

This is totally not logical:
If i Activate this plugin, I get this error:

Code: Select all

[PHP Warning] mysql_num_rows(): supplied argument is not a valid MySQL result resource on line 832 in file I:\TMF2010\testserver\xaseco\plugins\plugin.fufi.widge
ts.php
Tho there is no SQL in this plugin at al......

Anyone got any idea where it comes from?

EDIT, tried to put it before fufi in plugins.xml, but it doesnt change...

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [Xaseco] Nouse Link V1.1

Post by nouseforname » 17 Jan 2010 20:21

do you use the original?

strange anyway, i never saw this kind of error, by activating a plugin. but i know that fufi plugin sometimes have errors at startup.

how often did you try it with and without the "new" plugin?
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

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: [Xaseco] Nouse Link V1.1

Post by Ant » 17 Jan 2010 20:26

the mod I made of yours isn't the new plugin, I run it alongside yours nouseforname and it works perfectly for me - I just thought I'd share it if anyone else might like it too.

But I run yours, on all the time, and my version of your script just at scores screen - So I also don't know what the problem might be as I run fufi widgets with the play panel too and everything without errors.

Oh yeah, so sorry for my "new" version :wink:

User avatar
Knutselmaaster
swift roadking
swift roadking
Posts: 692
Joined: 16 Feb 2007 01:40
Owned TM-games: TMO/TMN/TMNF/TMU
Manialink(s): intr
Location: Between DisneyLand and Paris
Contact:

Re: [Xaseco] Nouse Link V1.1

Post by Knutselmaaster » 17 Jan 2010 20:30

tried several times, xaseco hangs on that message.
Seems that using strange signs (our teamtag) for servername generates it...

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: [Xaseco] Nouse Link V1.1

Post by Ant » 17 Jan 2010 23:04

Knutselmaaster wrote:tried several times, xaseco hangs on that message.
Seems that using strange signs (our teamtag) for servername generates it...
Didn't Fufi have a fix for that ???

User avatar
Oven Apple
cyclist
cyclist
Posts: 31
Joined: 03 Feb 2010 16:11
Owned TM-games: ALL
Location: Finland

Re: [Xaseco] Nouse Link V1.1

Post by Oven Apple » 20 Feb 2010 13:22

Thanks, nice one! :gobananas:
Image
I am thirsty! :1

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: [Xaseco] Nouse Link V1.1

Post by Ant » 15 Aug 2010 22:34

I have hacked this a bit so it shows 4 links - all to url. I'll share it here as well in case anyone else would like to use 4 links, I hope you don't mind nouse !

Code: Select all

<?php

/* ----------------------------------------------------------------------------------
 * 
 * Xaseco plugin to display an ingame manialink with 4 windows. All four link to url.
 * Possible to change main position via the config below. (Lines 48-63)
 * Manialink is combined with all /togglewidget commands (Menu, Chatcommand, F7).
 * If you want to change other things, check the manialink tags at lines 89 - 115.
 * For styles/substyles check http://fish.stabb.de/styles/
 *
 * ----------------------------------------------------------------------------------
 *
 * Author: 			nouseforname @ http://www.tm-forum.com
 * Home: 			tmf.game-host.org
 * Date: 			31.10.2009
 * Version:			1.1
 * Dependencies: 	none
 *
 * ----------------------------------------------------------------------------------
 *
 * LICENSE: This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * ----------------------------------------------------------------------------------
 */
 
/******** dont change this **********/
global $frameposition;				//
global $title, $closebutton;		//
global $urltext,  $url;	//
global $url1text, $url1;			//
global $url2text, $url2;            //
global $url3text, $url3;			//
global $xml_link_on, $xml_link_off;	//
/************************************/

// configuration
$frameposition = '0 32'; // main position x and y

$title = ''; // title with tmf colorcode

$urltext = '$fffWebsite';
$url = 'http://xxx-ant.letsrock-tm.com/';

$url1text = '$fffServer Ladder';
$url1 = 'http://xxx-ant.letsrock-tm.com/xaseco-stats/?lang=ENG&page=players';

$url2text = '$fffServer Forum';
$url2 = 'http://xxx-ant.letsrock-tm.com/phpBB3/index.php';

$url3text = '$fffTM-Forum';
$url3 = 'http://www.tm-forum.com/';

/************* dont change anything below ****************************/
Aseco::registerEvent('onStartup', 'init_link_manialinks');
Aseco::registerEvent('onNewChallenge', 'link_on');
Aseco::registerEvent('onPlayerConnect', 'link_deal_with_players');
Aseco::registerEvent('onEndRace', 'link_on');
Aseco::registerEvent('onPlayerManialinkPageAnswer', 'link_handle_buttonclick');
Aseco::registerEvent('onChat', 'link_toggle_command');
Aseco::registerEvent('onPlayerDisconnect', 'link_remove_player');

global $active_players;
$active_players = array();

function init_link_manialinks($aseco) {
	global $xml_link_on, $xml_link_off;
	global $active_players;
	global $frameposition;
	global $title, $closebutton;
	global $urltext,  $url;
	global $url1text, $url1;
	global $url2text, $url2;
	global $url3text, $url3;
	global $withwidgets;
	global $action_;
	
	$xml_link_on = '<manialink id="0815471122111">
		<frame posn="'.$frameposition.' 3">
			<format size="1" />
			<label posn="0 2.5 0" sizen="36 3" halign="center" valign="center" style="TextCardInfoSmall"  text="'.$title.'"  />
			<frame posn="-12 0 0">
				<quad posn="0 0 0" sizen="12 3"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />
				<quad posn="-4.5 0.1 1" sizen="2.5 2.5"  halign="center" valign="center" style="Icons64x64_1" substyle="ButtonServers"  />
				<label posn="1 0.1 1" sizen="11 1" halign="center" valign="center" style="TextCardInfoSmall" text="'.$urltext.'" url="'.$url.'"  />
			</frame>
			<frame posn="0 0 0">
				<quad posn="0 0 0 " sizen="12 3"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />
				<quad posn="-4.5 0.1 1" sizen="2.5 2.5"  halign="center" valign="center" style="Icons64x64_1" substyle="ButtonServers"  />
				<label posn="1 0.1 1" sizen="11 1" halign="center" valign="center" style="TextCardInfoSmall" text="'.$url1text.'" url="'.$url1.'"  />
			</frame>
			<frame posn="12 0 0">
				<quad posn="0 0 0 " sizen="12 3"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />
				<quad posn="-4.5 0.1 1" sizen="2.5 2.5"  halign="center" valign="center" style="Icons64x64_1" substyle="ButtonServers"  />
				<label posn="1 0.1 1" sizen="11 1" halign="center" valign="center" style="TextCardInfoSmall" text="'.$url2text.'" url="'.$url2.'" />
			</frame>
			<frame posn="24 0 0">
				<quad posn="0 0 0 " sizen="12 3"  halign="center" valign="center" style="Bgs1InRace" substyle="NavButtonBlink"  />
				<quad posn="-4.5 0.1 1" sizen="2.5 2.5"  halign="center" valign="center" style="Icons64x64_1" substyle="ButtonServers"  />
				<label posn="1 0.1 1" sizen="11 1" halign="center" valign="center" style="TextCardInfoSmall" text="'.$url3text.'" url="'.$url3.'" />
			</frame>
			<quad posn="1 2 0" sizen="1.5 1.5" halign="center" valign="center" style="Icons64x64_1" substyle="Close" action="382009003" actionkey="3" /> 
		</frame>
	</manialink>';

	$xml_link_off = '<manialink id="0815471122111">
	<frame posn="0 0 0">
	<quad posn="0 0 0" sizen="0 0" halign="center" valign="center" action="382009003" actionkey="3" /> 
	</frame>
	</manialink>';
}

// display manialink
function link_on($aseco) {
	global $active_players;
	global $xml_link_on;
	$aseco->client->addCall('SendDisplayManialinkPageToLogin', array(implode(',', $active_players), $xml_link_on, 0, false));
}  

// switch off manialink at roundsend
function link_off($aseco) {
	global $xml_link_off;
	$aseco->client->addCall('SendDisplayManialinkPage', array($xml_link_off, 0, false));
} 

// put playerlogins into array at player connect, and display manialink
function link_deal_with_players($aseco, $player) {
	global $active_players, $xml_link_on;
	$active_players[] = $player->login;
	$aseco->client->addCall('SendDisplayManialinkPageToLogin', array($player->login, $xml_link_on, 0, false));
}

// remove leaving players from array
function link_remove_player($aseco, $player) {
	global $active_players;
	$login = $player->login;
	
	if (in_array($login, $active_players)) {
			$key = array_search($login, $active_players);
			unset($active_players[$key]);
			sort($active_players);
	}
}
 
// F7 key press action id for widgets 382009003
// button click from menu "toggle widgets" 3831330
function link_handle_buttonclick($aseco, $command) {
	$login = $command[1];
	$action = $command[2];
	if ( $action == 382009003 || $action == 3831330 ) {
		link_change_player_status($aseco, $login);
	}
}

// change display status to specifig login
function link_change_player_status($aseco, $login) {
	global $active_players;
	global $xml_link_on, $xml_link_off;
	if (in_array($login, $active_players)) {
			$key = array_search($login, $active_players);
			unset($active_players[$key]);
			sort($active_players);
			$aseco->client->addCall('SendDisplayManialinkPageToLogin', array( $login, $xml_link_off, 0, false));
		}
		else {
			$active_players[] = $login;
			$aseco->client->addCall('SendDisplayManialinkPageToLogin', array($login, $xml_link_on, 0, false));
		}
}

// get chat command /togglewidgets from any player
function link_toggle_command($aseco, $command) {
	$playerid = $command[0];
	$login = $command[1];
	$action = $command[2];
	$state = $command[3];
	if ($playerid != 0 && $action == '/togglewidgets' && $state == 1) {
		link_change_player_status($aseco, $login);
	}
}
?>
Heres a screenshot as well to see how it looks.
Image
You can obviously change the position in its config (lines 48-63) - I have this positioned here because of the play panel and the betting panel. The betting panel was vineeth.hs (the one thats bundled with the play panel) - but I also hacked nouses betting plugin to use that panel. I haven't taken out my links, so you will need to change them for whatever links you want to put in. (Also in its config)

Hope this is useful for anyone else too :1

peugeot405
tricycle manager
tricycle manager
Posts: 25
Joined: 25 May 2009 13:28
Owned TM-games: tmuf
Location: Belgium

Re: [Xaseco] Nouse Link V1.1

Post by peugeot405 » 29 May 2011 15:46

It seems the nouse link is not hidden at the end of the round, is there a setting i have to change?
I ask this because i have eyepiece installed and it shows the nouse link above the widgets.

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: [Xaseco] Nouse Link V1.1

Post by Ant » 29 May 2011 17:44

If you're using the 4 links version, you can change

Code: Select all

Aseco::registerEvent('onEndRace', 'link_on');
to

Code: Select all

Aseco::registerEvent('onEndRace', 'link_off');

peugeot405
tricycle manager
tricycle manager
Posts: 25
Joined: 25 May 2009 13:28
Owned TM-games: tmuf
Location: Belgium

Re: [Xaseco] Nouse Link V1.1

Post by peugeot405 » 29 May 2011 18:01

thanks Ant, that's just what i needed. :thumbsup:

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: [Xaseco] Nouse Link V1.1

Post by Ant » 29 May 2011 23:01

Happy to help :)

User avatar
movielord
sunday driver
sunday driver
Posts: 54
Joined: 16 Jul 2008 13:56
Owned TM-games: TMS-TMN-TMNF-TMUF

Re: [Xaseco] Nouse Link V1.1

Post by movielord » 01 Jun 2011 18:36

Very nice plugin :1

Can someone be kind enough to give me the correct coordonates so that I can position it on top of the donate panel please?

I'm using the 4 links version

I tried but, I just can't figure it out :(

Image
Image

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

Re: [Xaseco] Nouse Link V1.1

Post by Xymph » 01 Jun 2011 19:07

movielord wrote:Can someone be kind enough to give me the correct coordonates so that I can position it on top of the donate panel please?
Look at that panel's coordinates (X Y: 11.7 -45.6), change the Y offset to move it a bit up (say, -42.0), then tweak X and Y from there.
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

User avatar
movielord
sunday driver
sunday driver
Posts: 54
Joined: 16 Jul 2008 13:56
Owned TM-games: TMS-TMN-TMNF-TMUF

Re: [Xaseco] Nouse Link V1.1

Post by movielord » 01 Jun 2011 20:03

Xymph wrote:
movielord wrote:Can someone be kind enough to give me the correct coordonates so that I can position it on top of the donate panel please?
Look at that panel's coordinates (X Y: 11.7 -45.6), change the Y offset to move it a bit up (say, -42.0), then tweak X and Y from there.
Sorry it doesn't help me... :( but thanks anyways
Image

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: [Xaseco] Nouse Link V1.1

Post by Ant » 01 Jun 2011 21:13

Basically, what Xymph is saying is keep inputting co-ordinates (obviously restarting XAseco after each change) until you get your desired position. Its all about trial and error - at least thats how I do it anyway.

This really should be fine though:

Code: Select all

$frameposition = '11.7 -42'; // main position x and y

Post Reply