[T1] deploy announce help

Spinal
08-30-2003, 09:20 PM
OK, I need some help binding this script to an on/off toggle key. Any suggestions how that might be done?




function Done1()
{
remoteBP(2048, "<jc>Bought favorite 1", 3);
remoteEval(2048, say(1, "Engineer :: Invo"));
}
function Done2()
{
remoteBP(2048, "<jc>Bought favorite 2", 3);
remoteEval(2048, say(1, "Engineer :: Airbase"));
}
function Done3()
{
remoteBP(2048, "<jc>Bought favorite 3", 3);
remoteEval(2048, say(1, "Engineer :: Emplacement"));
}
function Done4()
{
remoteBP(2048, "<jc>Bought favorite 4", 3);
remoteEval(2048, say(1, "Goliath :: Missle Control Station"));
}
function Done5()
{
remoteBP(2048, "<jc>Bought favorite 5", 3);
remoteEval(2048, say(1, "Assassin :: Shield Pack"));
}
function Done6()
{
remoteBP(2048, "<jc>Bought favorite 6", 3);
remoteEval(2048, say(1, "Scout :: Ammo Pack"));
}
function Done7()
{
remoteBP(2048, "<jc>Bought favorite 7", 3);
remoteEval(2048, say(1, "Scout :: Shield Pack"));
}
function Done8()
{
remoteBP(2048, "<jc>Bought favorite 8", 3);
remoteEval(2048, say(1, "Scout :: Interceptor Pack w/Hellfire Module"));
}
function Done9()
{
remoteBP(2048, "<jc>Bought favorite 9", 3);
remoteEval(2048, say(1, "Mercenary :: Shield Pack"));
}
function Done10()
{
remoteBP(2048, "<jc>Bought favorite 10", 3);
remoteEval(2048, say(1, "Mercenary :: Ammo Pack"));
}
function Done11()
{
remoteBP(2048, "<jc>Bought favorite 11", 3);
remoteEval(2048, say(1, "Juggernaught :: Heavy Plasma Cannon"));
}
function Done12()
{
remoteBP(2048, "<jc>Bought favorite 12", 3);
remoteEval(2048, say(1, "Juggernaught :: Tactical Nukes"));
}
function Done13()
{
remoteBP(2048, "<jc>Bought favorite 13", 3);
remoteEval(2048, say(1, "Juggernaught :: Godhammer"));
}
function Done14()
{
remoteBP(2048, "<jc>Bought favorite 14", 3);
remoteEval(2048, say(1, "Mercenary :: Invo"));
}
function Done15()
{
remoteBP(2048, "<jc>Bought favorite 15", 3);
remoteEval(2048, say(1, "Dreadnaught :: Ammo Pack"));
}
function Done16()
{
remoteBP(2048, "<jc>Bought favorite 16", 3);
remoteEval(2048, say(1, "Dreadnaught :: Rocket Launcher Pack"));
}
function Done17()
{
remoteBP(2048, "<jc>Bought favorite 17", 3);
remoteEval(2048, say(1, "Goliath :: Suicide Detpack"));
}
function Done18()
{
remoteBP(2048, "<jc>Bought favorite 18", 3);
remoteEval(2048, say(1, "Arbitor :: Teleport Pack"));
}
function Done19()
{
remoteBP(2048, "<jc>Bought favorite 19", 3);
remoteEval(2048, say(1, "Arbitor :: EMP Beacon"));
}
function Done20()
{
remoteBP(2048, "<jc>Bought favorite 20", 3);
remoteEval(2048, say(1, "Scout :: Flight Pack"));
}
function Done21()
{
remoteBP(2048, "<jc>Bought favorite 21", 3);
remoteEval(2048, say(1, "Engineer :: EMP Beacon"));
}
function Done22()
{
remoteBP(2048, "<jc>Bought favorite 22", 3);
remoteEval(2048, say(1, "Engineer :: Shield Beacon"));
}
function Done23()
{
remoteBP(2048, "<jc>Bought favorite 23", 3);
remoteEval(2048, say(1, "Engineer :: Power Device"));
}
function Done24()
{
remoteBP(2048, "<jc>Bought favorite 24", 3);
remoteEval(2048, say(1, "Engineer :: Jammer Beacon"));
}
function Done25()
{
remoteBP(2048, "<jc>Bought favorite 25", 3);
remoteEval(2048, say(1, "Engineer :: Arbitor Beacon"));
}
function Done26()
{
remoteBP(2048, "<jc>Bought favorite 26", 3);
remoteEval(2048, say(1, "Engineer :: Large Shock Force Field"));
}
function Done27()
{
remoteBP(2048, "<jc>Bought favorite 27", 3);
remoteEval(2048, say(1, "Engineer :: Accelerator Pad"));
}
function Done28()
{
remoteBP(2048, "<jc>Bought favorite 28", 3);
remoteEval(2048, say(1, "Engineer :: Launch Pad"));
}
function Done29()
{
remoteBP(2048, "<jc>Bought favorite 29", 3);
remoteEval(2048, say(1, "Engineer :: Ammo Pack"));
}
function Done30()
{
remoteBP(2048, "<jc>Bought favorite 30", 3);
remoteEval(2048, say(1, "Mercenary :: Anti-Aircraft Turret"));
}
function Done31()
{
remoteBP(2048, "<jc>Bought favorite 31", 3);
remoteEval(2048, say(1, "Dreadnaught :: Invo"));
}
function Done32()
{
remoteBP(2048, "<jc>Bought favorite 32", 3);
remoteEval(2048, say(1, "Dreadnaught :: Shock Floor"));
}
function Done33()
{
remoteBP(2048, "<jc>Bought favorite 33", 3);
remoteEval(2048, say(1, "Dreadnaught :: Air Ammo Pad"));
}
function Done34()
{
remoteBP(2048, "<jc>Bought favorite 34", 3);
remoteEval(2048, say(1, "Juggernaught :: Lascannon"));
}
function Done35()
{
remoteBP(2048, "<jc>Bought favorite 35", 3);
remoteEval(2048, say(1, "Chemeleon :: Flight Pack"));
}
function Done36()
{
remoteBP(2048, "<jc>Bought favorite 36", 3);
remoteEval(2048, say(1, "Chemeleon :: Ammo Pack"));
}
function Done37()
{
remoteBP(2048, "<jc>Bought favorite 37", 3);
remoteEval(2048, say(1, "Scout :: Repair Pack"));
}
function Done38()
{
remoteBP(2048, "<jc>Bought favorite 38", 3);
remoteEval(2048, say(1, "Scout :: Interceptor Pack w/Valkeryie Module"));
}
function Done39()
{
remoteBP(2048, "<jc>Bought favorite 39", 3);
remoteEval(2048, say(1, "Scout :: Stealthshield Pack"));
}
function Done40()
{
remoteBP(2048, "<jc>Bought favorite 40", 3);
remoteEval(2048, say(1, "Mercenary :: Stealthshield Pack"));
}

Mafo
08-30-2003, 09:59 PM
code tags are fun!
edit: err this is all renegaydes isn't it :\

cyclonite
08-31-2003, 02:38 AM
I'm sure there would be an easier way to do that then just writing 40 functions, rofl.
But since you've already done it...
I don't know what you mean by an on/off toggle...it doesn't make sense with regards to what you posted (the code)
But here is how you bind something:
bindCommand(keyboard0, make, "w", TO, "Done1();");

random
08-31-2003, 02:44 AM
Download a script pack and have a play around with it.
Those things won't actually buy any favorites, they'll just echo with a BottomPrint, and say in TeamChat what favorite you bought.
You could make all of that alot quicker/faster fairly easily, but I'd suggest having a look at a few other script packs to get a better idea of what you want to do.

Spinal
08-31-2003, 03:30 PM
I want to toggle the deploy announce on and off for tourney mode, cause spamming that shit out just floods the server in tourney mode.
I was wondering if there was a simpler method than just writing out a keybinds to the 40 different functions. I have looked at other deploy announce scripts, but I haven't seen one that toggles on and off.

SuperSlug
08-31-2003, 04:02 PM
This is what I do for my favorites. You might try something like this.
//slugFavs.acs.cs


// Current Fav
$Loadout = 0;

// Announce to team your loadout
$announceLoadout = 0;

// Names of Loadouts
$SuperSlug::FaveName[0] = "Light (Energy & GL)";
$SuperSlug::FaveName[1] = "Light (Energy & LR)";
$SuperSlug::FaveName[2] = "Light (Energy & GL & LR)";
$SuperSlug::FaveName[3] = "Medium (Inventory)";
$SuperSlug::FaveName[4] = "Medium (Turret)";
$SuperSlug::FaveName[5] = "Heavy (Energy)";
$SuperSlug::FaveName[6] = "Heavy (Shield)";
$SuperSlug::FaveName[7] = "Heavy (Ammo)";
$SuperSlug::FaveName[8] = "Heavy (Repair)";
$SuperSlug::FaveName[9] = "Heavy (Inventory)";
$SuperSlug::FaveName[10] = "Light (SLO)";
$SuperSlug::FaveName[11] = "Light (Pulse)";

// Bindings for loadouts
editActionMap("playMap.sae");
bindCommand(keyboard0, make, alt, "1", TO, "SuperSlugFavs::Select(0);");
bindCommand(keyboard0, make, alt, "2", TO, "SuperSlugFavs::Select(1);");
bindCommand(keyboard0, make, alt, "3", TO, "SuperSlugFavs::Select(2);");
bindCommand(keyboard0, make, alt, "4", TO, "SuperSlugFavs::Select(3);");
bindCommand(keyboard0, make, alt, "5", TO, "SuperSlugFavs::Select(4);");
bindCommand(keyboard0, make, alt, "6", TO, "SuperSlugFavs::Select(5);");
bindCommand(keyboard0, make, alt, "7", TO, "SuperSlugFavs::Select(6);");
bindCommand(keyboard0, make, alt, "8", TO, "SuperSlugFavs::Select(7);");
bindCommand(keyboard0, make, alt, "9", TO, "SuperSlugFavs::Select(8);");
bindCommand(keyboard0, make, alt, "0", TO, "SuperSlugFavs::Select(9);");
bindCommand(keyboard0, make, alt, "-", TO, "SuperSlugFavs::Select(10) ;");
bindCommand(keyboard0, make, alt, "=", TO, "SuperSlugFavs::Select(11) ;");

bindCommand(keyboard0, make, alt, "e", TO, "SuperSlugFavs::ToggleAuto Announce();");

function SuperSlugFavs::Buy()
{
// At normal inventory station
if($Event::Station == "Inventory")
{
// Auto buy repair kits at invenory
// Drop repair packs/pulses
for(%i = 0; %i < 3; %i++)
{

remoteEval(2048, buyItem, 30);
remoteEval(2048, dropItem, 30);

remoteEval(2048, buyItem, 35);
remoteEval(2048, dropItem, 35);

remoteEval(2048, useItem, 39);
remoteEval(2048, buyItem, 39);
}
}
if($Event::Station == "RemoteInventory")
{
for(%i = 0; %i < 2; %i++)
{
remoteEval(2048, useItem, 39);
remoteEval(2048, buyItem, 39);
}
}

schedule::add("CmdInventoryGui::buyFavor ites($Loadout);", 0.3);
}

function SuperSlugFavs::EnterStati on(%type)
{
$Event::Station = %type;
}

function SuperSlugFavs::Select(%nu m)
{
$Loadout = %num;
CmdInventoryGui::buyFavor ites($Loadout);

remoteTP(2048, "<jc><f1>Loadout Selected: <f2>" @ $SuperSlug::FaveName[$Loadout], 2);
}

function SuperSlugFavs::ToggleAuto Announce()
{
if($announceLoadout)
{
$announceLoadout = 0;
remoteTP(2048, "<JC><F1>Announce loadout to team is:<F2> OFF", 2);
}
else
{
$announceLoadout = 1;
remoteTP(2048, "<JC><F1>Announce loadout to team is:<F2> ON", 2);
}
}

function SuperSlugFavs::AnnounceLo adout()
{
if($announceLoadout)
{
say(1, "Leaving - " @ $SuperSlug::FaveName[$Loadout]);
}
}
Event::Attach(eventEnterS tation, SuperSlugFavs::EnterStati on);
Event::Attach(eventEnterS tation, SuperSlugFavs::Buy);
Event::Attach(eventExitSt ation, SuperSlugFavs::AnnounceLo adout);

Spinal
09-01-2003, 03:55 PM
Tanks slug, I think that will work, with almost no modification.