Scripts for Tribes 1.40

I like that script which makes 2 chat huds. one for white messages and kills other for chats. I dont remember how it was or where it was... Is it possible to make this for 1.40?
Maybe bind keys to enable/disable one or the other or both at the same time. That would be freagin kewl

its more interesting for both people who dont like the chat but like the tribes messages only, and vice versa
 
Last edited:
Anubis is like the guy who says cars are his hobby but never learned to change the oil.


Anubis you should be able to "convert" that script to 1.4 the same way you "converted" the other ones. By adding your name to the comments.
 
VeKToR made that chat filter HUD I believe a long time ago. :cool:

Code:
// NoFiXmute.acs.cs

function after::onClientMessage( %cl, %msg, %type )
  after onClientMessage
{ 
  %mute_msg["Match Started"] = false; 
  %mute_msg["Station Access On"] = true; 
  %mute_msg["Station Access Off"] = true;
  %mute_msg["Resupply Complete"] = true;
  %mute_msg["Repair Done"] = true;
  %mute_msg["AutoRepair On"] = true;
  %mute_msg["AutoRepair Off"] = true;
  %mute_msg["Inventory Station deployed"] = true;
  %mute_msg["Remote Turret deployed"] = true;
  %mute_msg["Repair Stopped"] = true;
  %mute_msg["Unit is disabled"] = true;
  %mute_msg["Nothing in range"] = true;
  %mute_msg["Bought Laser Rifle - Auto buying Energy Pack"] = true;
  %mute_msg["Chaingun has no ammo"] = true;
  %mute_msg["Disc Launcher has no ammo"] = true;
  %mute_msg["Grenade Launcher has no ammo"] = true;
  %mute_msg["Mortar has no ammo"] = true;
  %mute_msg["Plasma Gun has no ammo"] = true;
  
  if(%type == 0 && %mute_msg[%msg])
    %ret = false;
}

Event::Attach(eventConnected, after::onClientMessage);

Anyway to group the mute messages? Something like %mute_msg["You received "] = true; does not work for any received messages (e.g. You received 1 Disc Launcher). Instead of writing them all down in the file obviously...

%mute_msg[" has no ammo"] = true; etc
 
Last edited:
VeKToR made that chat filter HUD I believe a long time ago. :cool:

Code:
// NoFiXmute.acs.cs

function after::onClientMessage( %cl, %msg, %type )
  after onClientMessage
{ 
  %mute_msg["Match Started"] = false; 
  %mute_msg["Station Access On"] = true; 
  %mute_msg["Station Access Off"] = true;
  %mute_msg["Resupply Complete"] = true;
  %mute_msg["Repair Done"] = true;
  %mute_msg["AutoRepair On"] = true;
  %mute_msg["AutoRepair Off"] = true;
  %mute_msg["Inventory Station deployed"] = true;
  %mute_msg["Remote Turret deployed"] = true;
  %mute_msg["Repair Stopped"] = true;
  %mute_msg["Unit is disabled"] = true;
  %mute_msg["Nothing in range"] = true;
  %mute_msg["Bought Laser Rifle - Auto buying Energy Pack"] = true;
  %mute_msg["Chaingun has no ammo"] = true;
  %mute_msg["Disc Launcher has no ammo"] = true;
  %mute_msg["Grenade Launcher has no ammo"] = true;
  %mute_msg["Mortar has no ammo"] = true;
  %mute_msg["Plasma Gun has no ammo"] = true;
  
  if(%type == 0 && %mute_msg[%msg])
    %ret = false;
}

Event::Attach(eventConnected, after::onClientMessage);

Anyway to group the mute messages? Something like %mute_msg["You received "] = true; does not work for any received messages (e.g. You received 1 Disc Launcher). Instead of writing them all down in the file obviously...

%mute_msg[" has no ammo"] = true; etc

Don't use Event::Attach(); That's for events. What I posted was a function attachment.

As far as your question, you would have to add an additional condition to check the message, since all that code does is check for a constant.
 
This version will filter based on key words in a global array:

Code:
$mute_msg[$mute_msg_cnt = 0] = "Station Access";
$mute_msg[$mute_msg_cnt++] = "Resupply";
$mute_msg[$mute_msg_cnt++] = "Repair";
$mute_msg[$mute_msg_cnt++] = "Inventory";
$mute_msg[$mute_msg_cnt++] = "Remote";
$mute_msg[$mute_msg_cnt++] = "Unit";
$mute_msg[$mute_msg_cnt++] = "Nothing";
$mute_msg[$mute_msg_cnt++] = "Bought";
$mute_msg[$mute_msg_cnt++] = "no ammo";

function after::onClientMessage( %cl, %msg, %type )
  after onClientMessage
{
  if(%type != 0)
    return;
    
  for(%i = 0; %i <= $mute_msg_cnt; %i++)
  {
    if(String::FindSubStr(%msg, $mute_msg[%i]) != -1)
    {      
      %ret = false;
      return;
    }
  }
}
 
Was wondering if anyone could do me a script that would quickly switch to 3rd person view on flag grab and then back to first? I liked having it in my old config and would like it for 1.4 Cheers
 
Was wondering if anyone could do me a script that would quickly switch to 3rd person view on flag grab and then back to first? I liked having it in my old config and would like it for 1.4 Cheers

Nothing 1.40 related here, that's just about the correct events.

Code:
$Effects::3rdPersonFlagCheck::Delay = "0.25";
$Effects::3rdPersonFlagCheck::Duration = "0.35";

function Effects::3rdPersonFlagCheck(%tm, %cl)
{
	if(getManagerId() != %cl)
		return;
		
	schedule("postAction(2048, IDACTION_VIEW, 1);", $Effects::3rdPersonFlagCheck::Delay);
	schedule("postAction(2048, IDACTION_VIEW, 0);", $Effects::3rdPersonFlagCheck::Delay + $Effects::3rdPersonFlagCheck::Duration);
}

Event::attach(eventFlagGrab, Effects::3rdPersonFlagCheck );
Event::attach(eventFlagPickup, Effects::3rdPersonFlagCheck );
 
Last edited:
Code:
// Kamikaze Spam Script

function ThrowControl::startKamikaze() {
	//Switch to best weapon
	if (getItemCount("Mortar") && getItemCount("Mortar Ammo")) use("Mortar");
	else if (getItemCount("Grenade Launcher") && getItemCount("Grenade Ammo")) use("Grenade Launcher");
	// else Dont change...
	postAction(2048, IDACTION_FIRE1, 1);
	$throwStartTime=0;
	throwRelease("Grenade");
}


function ThrowControl::stopKamikaze() {
	postAction(2048, IDACTION_BREAK1, 1);
}
Hey, I ganked BigBunny's throwcontrol script to make a kamikaze spam script for 1.40. It's stripped down, but does most of what I want it do. The only issue is that the hand grenades only throw once at the beginning and then stop so i have to keep tapping the spam button to keep tossing nades. How can I fix this? See code above.
 
just make the grenade throw part a separate scheduled function

edit: not tested

Code:
// Kamikaze Spam Script

function ThrowControl::startKamikaze() {
	//Switch to best weapon
	if (getItemCount("Mortar") && getItemCount("Mortar Ammo")) use("Mortar");
	else if (getItemCount("Grenade Launcher") && getItemCount("Grenade Ammo")) use("Grenade Launcher");
	// else Dont change...
	postAction(2048, IDACTION_FIRE1, 1);
	ThrowControl::startKamikaze::ThrowABunchOfNades();
	
}


function ThrowControl::stopKamikaze() {
	postAction(2048, IDACTION_BREAK1, 1);
	schedule::cancel(nadethrowingplease);
}

function ThrowControl::startKamikaze::ThrowABunchOfNades() {
	$throwStartTime=0;
	throwRelease("Grenade");
	schedule::add("ThrowControl::startKamikaze::ThrowABunchOfNades();", 0.1, nadethrowingplease);
}

I'm sure I'll regret this on snowblind sometime soon.
 
Last edited:
yeah, that doesn't work.

the syntax is broken. there's an extra parenthesis in the last line.

should be:
schedule::add("ThrowControl::startKamikaze::ThrowABunchOfNades();", 0.1, nadethrowingplease);

it's fixed now. thanks!
 
Last edited:
Code:
function DemoDrop::Start()
{
	if ($PlayingDemo)
		return;
	Schedule::Add("DemoDrop::SetupDemo();", 1);
}

function DemoDrop::SetupDemo(%address)
{
	if ($PlayingDemo)
		return;

	$ConnectedToServer = FALSE;

	setCursor(MainWindow, "Cur_Arrow.bmp");

	disconnect();
	Event::Trigger(eventDisconnected);

	deleteObject(ConsoleScheduler);
	newObject(ConsoleScheduler, SimConsoleScheduler);

	cursorOn(MainWindow);

	$recordDemo = true;

	setupRecorderFile();
	myConnect($Server::Address, $Server::JoinPassword);
}

Code:
$AutoName::Recording = "";
$AutoName::AutoDemo = true;
function setupRecorderFile()
{
	//returns time in global $time
	$f = AutoName::StripString("("@timestamp::format()@")-"@$PCFG::Name);
	$recorderFileName = "recordings\\" @ $f @ ".rec";

	//autoname stuff
	$AutoName::Stub = $f;
	$AutoName::Dummy = $recorderFileName;
	$AutoName::Recording = true;
	$AutoName::Maps = 0;
	
	echo("Recording to - " @ $recorderFileName);
}

function AutoName::Stop()
{
	if (!$AutoName::Recording || $PlayingDemo || $AutoName::Maps==0)
		return;

	%str = "";
	//build a list of the maps we played
	for (%i = 0; %i< $AutoName::Maps; %i++)
	{
		%m = $AutoName::MapList[%i];
		%map = $AutoName::Lookup[ %m ];
		
		if (%map == "")
		{
			//see if its an lt map
			%lttest = String::GetSubStr(%m, 0, String::Length(%m)-2);
			%map = $AutoName::Lookup[%lttest];
			if ( %map != "" )
				%map = %map @ "-lt";
			else
				%map = %m;
		}
		
		%str = %str @ "-" @ %map;
	}
	
	%dst = "Recordings\\" @ $AutoName::Stub @ %str @ ".rec";
	echo ("k/os: Trying to Copy... " @ $AutoName::Dummy @ " to " @ %dst);
	
	//try to copy the original demo to our new name
	if (File::copy($AutoName::Dummy, %dst))
	{
		echo("k/os: Deleting old recording");
		//delete the old
		File::delete($AutoName::Dummy);
	}

	if ($AutoName::AutoDemo)
		setupRecorderFile();
}

//add new map played
function AutoName::onMissionInfo(%server, %missionName, %ServerMissionType)
{
	if (!$AutoName::Recording)
		return;

	$AutoName::MapList[$AutoName::Maps++ - 1] = String::ToLower( String::Replace(%missionName, "_", "") );
}

//utility shit
function AutoName::StripString(%str)
{
	%str = string::replace(%str, "[",  "_");
	%str = string::replace(%str, "]",  "_");
	%str = string::replace(%str, "<",  "_");
	%str = string::replace(%str, ">",  "_");
	%str = string::replace(%str, "?",  "_");
	%str = string::replace(%str, ":",  "_");
	%str = string::replace(%str, "*",  "_");
	%str = string::replace(%str, "/",  "_");
	%str = string::replace(%str, "\\", "_");
	%str = string::replace(%str, "|",  "_");
	
	return %str;
}

function myConnect(%serverIp, %serverPw)
{
	$Server::Address = %serverIp;
	$Server::JoinPassword = %serverPw;
	connect(%serverIp);
}


//map abbreviations to shorten filenames
$AutoName::Lookup["acrophobia"] = "ac";
$AutoName::Lookup["arcticwolf"] = "aw";
$AutoName::Lookup["Avalanche"] = "av";
$AutoName::Lookup["bastardforge"] = "bf";
$AutoName::Lookup["bastardforgeday"] = "bfd";
$AutoName::Lookup["broadside"] = "bs";
$AutoName::Lookup["canyoncrusadedeluxe"] = "ccdx";
$AutoName::Lookup["canyoncrusade"] = "ccd";
$AutoName::Lookup["cloakofnight"] = "con";
$AutoName::Lookup["dangerouscrossing"] = "dx";
$AutoName::Lookup["desertofdeath"] = "dod";
$AutoName::Lookup["domino"] = "dm";
$AutoName::Lookup["emeraldvalley"] = "ev";
$AutoName::Lookup["hildebrand"] = "hb";
$AutoName::Lookup["icedagger"] = "id";
$AutoName::Lookup["iceridge"] = "ir";
$AutoName::Lookup["integration"] = "int";
$AutoName::Lookup["jaggedclaw"] = "jc";
$AutoName::Lookup["midnightmayhem"] = "mmd";
$AutoName::Lookup["midnightmayhemdeluxe"] = "mmdx";
$AutoName::Lookup["northernlights"] = "nl";
$AutoName::Lookup["obfuscation"] = "obf";
$AutoName::Lookup["raindance"] = "rd";
$AutoName::Lookup["reliquary"] = "rq";
$AutoName::Lookup["rollercoaster"] = "rc";
$AutoName::Lookup["runout"] = "ro";
$AutoName::Lookup["scarabrae"] = "scara";
$AutoName::Lookup["sidewinder"] = "sw";
$AutoName::Lookup["simoom"] = "sm";
$AutoName::Lookup["snowblind"] = "sb";
$AutoName::Lookup["spincycle"] = "sc";
$AutoName::Lookup["starfall"] = "sf";
$AutoName::Lookup["stonehenge"] = "sh";
$AutoName::Lookup["stonehengepub"] = "sh_pub";
$AutoName::Lookup["stonehengecluster"] = "sh_pub";
$AutoName::Lookup["tesseract"] = "tes";
$AutoName::Lookup["timberline"] = "tl";
$AutoName::Lookup["opensnare"] = "os";
$AutoName::Lookup["firenza"] = "fz";
$AutoName::Lookup["teamside"] = "ts";
$AutoName::Lookup["anthill"] = "ant";
$AutoName::Lookup["fogofwar"] = "fow";
$AutoName::Lookup["citadels"] = "cit";
$AutoName::Lookup["adishbestservedcold"] = "dish";
$AutoName::Lookup["hammerdown"] = "hd";
$AutoName::Lookup["bloodyvengeance"] = "bv";
$AutoName::Lookup["siege"] = "siege";








//patch a few things in to always record (covers almost every situation
if ($AutoName::AutoDemo)
{
	//record demo when clicking join button
	Event::Attach(eventJoinGame, setupRecorderfile);
	//demo drop on map change
	Event::Attach(eventChangeMission, DemoDrop::Start);

	function PlayerSetupNext()
	{
		if ($QuickStart == "TRUE")
			QuickStart();
		else
		{
			if ($PCFG::Name == "")
				OpenNewPlayerDialog();
			else
			GuiLoadContentCtrl(MainWindow, "gui\\Connect.gui");
		}
		
		setupRecorderFile();
	}

	setupRecorderFile();
	$recordDemo=true;
}

Event::Attach(eventMissionInfo, AutoName::onMissionInfo);

//make sure we stop/rename in every possible situation
Event::Attach(eventDisconnected, AutoName::Stop);
Event::Attach(eventConnectionLost, AutoName::Stop);
Event::Attach(eventConnectionTimeout, AutoName::Stop);
Event::Attach(eventExit, AutoName::Stop);
 
Last edited:
Back
Top