[t1 config] waypointer and ctf HUd

R3L!K

Veteran X
I had andrews 10K config and just did a fresh install and new config.

I took the code from Andrew's config (located in his autoexec.cs file along with tons of other stuff) and pasted it into individual files to be exec'd off inthe autoexec.cs file.

http://www.tribalwar.com/forums/showthread.php?t=165260&highlight=waypointer
That link led to a dead link for a waypointer

So I can't get the waypointer to work:

//Waypointer
editActionMap("playMap.sae");
MyBind("1", "Waypoint::TargetFriendly();");
MyBind("2", "Waypoint::TargetEnemy();");

function onClientMessage(%cl, %msg) {
if (!%cl) {
if (String::FindSubStr(%msg, "flag") != -1) Flag::Event(%msg);
else if (%msg=="Station Access On") Fav::Enter();
else if (%msg=="Station Access Off") Fav::Exit();
}
return true;
}

function onClientChangeTeam(){CTF::Update();}
function onMapReset() { $Fav::Favorite=4;$Flag::Score[0]=$Flag::Score[1]=0;$Flag::Status[0]=$Flag::Status[1]="home";CTF::Update(); }
function onJoinReset() { $Zoom::Zoom = 2;Zoom::resetZoom();onMapReset(); }
function remoteMissionChangeNotify(%cl, %mission){ flushTextureCache();Schedule("purgeResources(true);", 3);onMapReset(); }

function onConnection(%msg) {
$dataFinished = false;
if(%msg=="Accepted") {
onJoinReset();
resetSimTime();
resetPlayDelegate();
remoteEval(2048, SetCLInfo, '', '', '', '', '', 'T:V Sucks', true, true);
cursorOn(MainWindow);
GuiLoadContentCtrl(MainWindow, "gui\\Loading.gui");
renderCanvas(MainWindow);
}
else {
echo("Retry: " @ $errorString);
schedule("connect($Server::Address);", 0.75);
}
}

function Team::Friendly() {%team = Client::getTeam(getManagerId()); if (%team==-1) %team = 0; return %team;}
function Team::Enemy(){return Team::Friendly() ^ 1;}

function Flag::GetName(%msg, %search, %xor) {
$Flag::Event = false;
if((%idx = String::FindSubStr(%msg, %search)) != -1) {
%str = substr(%msg, 0, %idx);
if (%str=="You")
%str = Client::getName(getManagerId());
else if (%str=="Your Team")
return(0);
$cl = getClientByName(%str);
$team = Client::GetTeam($cl) ^ %xor;
return ($Flag::Event = true);
}
return(0);
}

function Flag::Event(%msg) {
if (Flag::GetName(%msg, " took the", 1)) {$Flag::Status[$team]=$cl; Waypoint::Event($team, $cl); if ($team==Team::Enemy()) $tv::cl = $cl;}
else if (Flag::GetName(%msg, " dropped the", 1)) {$Flag::Status[$team]="field";$Flag::Timer[$team]=476;$Flag::Tag[$team]++;Flag::DropTimer($team,$Flag::Tag[$team]);}
else if (Flag::GetName(%msg, " returned the", 0)) {$Flag::Status[$team]="home";}
else if (Flag::GetName(%msg, " captured the", 1)) {$Flag::Status[$team]="home";$Flag::Score[$team^1]++;}
else if (Flag::GetName(%msg, " left the mission", 1)) {$Flag::Status[$team]="home";}
if ($flag::Event) CTF::Update();
}

function Flag::DropTimer(%team, %tag) {
if (%tag!=$Flag::Tag[%team]) return;
if ($Flag::Status[%team] != "field") return;
$Flag::Tag[%team]++;
if($Flag::Timer[%team]-- <= 0) {
$Flag::Status[%team] = "home";
} else {
Schedule("Flag::DropTimer("@%team@","@$flag::tag[%team]@");", 0.1);
}
CTF::Update();
}

function Flag::Timer(%team) {
%val=$Flag::Timer[%team];
if (%val < 10) %val="0"@%val;
if (%val < 100) %val="0"@%val;
return (substr(%val,0,2) @ "." @ substr(%val,2,1));
}

function BanList::export() { HUD::OnExit(); }
function PlayGui::eek:nOpen() {for (%i=0; %i<$HUDs; %i++){addToSet(playGui, $Hud[%i]);Schedule($Hud[%i, wake] @ "();", 0);}}
function PlayGui::eek:nClose(){for (%i=0; %i<$HUDs; %i++){removeFromSet(playGui, $Hud[%i]);Schedule($Hud[%i, sleep] @ "();", 0);}}
function Hud::eek:nExit(){for (%i = 0; %i < $HUDs; %i++){removeFromSet(playGui, $Hud[%i]);deleteObject($Hud[%i]);} }

//%type = FearGui::FearGuiMenu or SimGui::Control
function Hud::New(%name, %x, %y, %w, %h, %wake, %sleep, %type) {
%i = ($HUDs++ -1);
$Hud[%i] = newObject(%name, %type, %x, %y, %w, %h);
$Hud[%i, wake] = %wake;
$Hud[%i, sleep] = %sleep;
Control::SetVisible(%name, true);
}

function Waypoint::Event(%team, %client) {
%friendlyCarrier = ( %team==Team::Enemy() );
%enemyCarrier = ( %team==Team::Friendly() );
if ( ($Waypoint::Target==2) && (%friendlyCarrier) ) Waypoint::TargetFriendly();
else if ( ($Waypoint::Target==1) && (%enemyCarrier) ) Waypoint::TargetEnemy();
}

function Waypoint::Target(%cl, %msg, %wav){ if ( %cl != "home" && %cl != "field" && %cl != getManagerId() ) remoteEval(2048, "IssueTargCommand", 0, %msg @ Client::GetName( %cl ) @ %wav, %cl - 2048, getManagerId()); }
function Waypoint::TargetFriendly(){Waypoint::Target($Flag::Status[Team::Enemy()], "Escort: ", "~wescfr");}
function Waypoint::TargetEnemy(){Waypoint::Target($Flag::Status[Team::Friendly()], "Attack: ", "~wattway");}

if (!$CTF::Loaded) {
HUD::New("CTF::Box", 5, 74, 180, 40, CTF::Wake, CTF::Sleep, FearGui::FearGuiMenu);
newObject("CTF::Status0", FearGuiFormattedText, 5, 0, 180, 20);
newObject("CTF::Status1", FearGuiFormattedText, 5, 20, 180, 20);
addToSet("CTF::Box", "CTF::Status0");
addToSet("CTF::Box", "CTF::Status1");
$CTF::Loaded=1;
}

function CTF::SetTeamValue(%slot, %team) {
%s = $Flag::Score[%team];
%l = $Flag::Status[%team];

if (%l=="home") %l = "<f3>Home";
else if (%l=="field") %l = "<f3>Dropped-><f2>" @ Flag::Timer(%team);
else {
%fixed="";
%l=Client::GetName(%l);
for (%i=0;(%ch=substr(%l, %i, 1)) != ""; %i++) {
if (%ch=="<") %ch = "\xd7";
%fixed = %fixed @ %ch;
}

%l = "<f2>" @ %fixed;
}

Control::SetValue("CTF::Status" @ %slot, "<b3,3:" @ GetWord("f.bmp> e.bmp> ", %slot)@" <f3>(<f2>" @ %s @ "<f3>) " @ %l);
}

function CTF::Wake() {CTF::Update();}
function CTF::Sleep() {}
function CTF::Update() {CTF::SetTeamValue(0, Team::Friendly());CTF::SetTeamValue(1, Team::Enemy());}

And the CTF is not working/updating either.

Any ideas or help would be great.

OR better yet, if someone had a ctf hud that I could use and a waypointer than that would be great too!
 
Last edited:
Back
Top