Call of Duty: Modern Warfare 2 · handler “Modern Warfare 2 Multiplayer”
Version 5
Release notes
updated iw4x client and bot warfare mod. improved gamepad and m/k support, added LAN features
- Released
- Size
- 10.2 MB
- Downloads
- 330
- Check
- Verified
- SHA-256
- fa99b9330cfac5616c37fb786fdb0bc820fdf074c1215cdecd372e783b457433
Files 139
| Path | Size |
|---|---|
| handler/d3d9.dll | 8.1 MB |
| handler/d3d9.ini | 4.3 KB |
| handler/F2 Guest.au3 | 1.2 KB |
| handler/F2 Guest.exe | 894 KB |
| handler/F2 Host.au3 | 851 B |
| handler/F2 Host.exe | 894 KB |
| handler/F3 Restart.au3 | 474 B |
| handler/F3 Restart.exe | 894 KB |
| handler/iw4x-sp.exe | 1.4 MB |
| handler/iw4x.dll | 2.7 MB |
| handler/iw4x.exe | 4.0 MB |
| handler/iw4x.stat | 8.0 KB |
| handler/iw4x_config.cfg | 13 KB |
| handler/Local IP.txt | 15 B |
| handler/mods/bots/bots.txt | 355 B |
| handler/mods/bots/maps/iw4_credits.d3dbsp.ents | 12 KB |
| handler/mods/bots/maps/mp/bots/waypoints/_custom_map.gsc | 99 KB |
| handler/mods/bots/maps/mp/bots/_bot.gsc | 23 KB |
| handler/mods/bots/maps/mp/bots/_bot_chat.gsc | 58 KB |
| handler/mods/bots/maps/mp/bots/_bot_http.gsc | 356 B |
| handler/mods/bots/maps/mp/bots/_bot_internal.gsc | 61 KB |
| handler/mods/bots/maps/mp/bots/_bot_script.gsc | 162 KB |
| handler/mods/bots/maps/mp/bots/_bot_utility.gsc | 59 KB |
| handler/mods/bots/maps/mp/bots/_menu.gsc | 29 KB |
| handler/mods/bots/maps/mp/bots/_wp_editor.gsc | 20 KB |
| handler/mods/bots/maps/mp/gametypes/dd.gsc | 30 KB |
| handler/mods/bots/maps/mp/gametypes/vip.gsc | 11 KB |
| handler/mods/bots/maps/mp/gametypes/_class.gsc | 43 KB |
| handler/mods/bots/maps/mp/gametypes/_damage.gsc | 74 KB |
| handler/mods/bots/maps/mp/gametypes/_gamelogic.gsc | 78 KB |
| handler/mods/bots/maps/mp/gametypes/_killcam.gsc | 15 KB |
| handler/mods/bots/maps/mp/gametypes/_menus.gsc | 16 KB |
| handler/mods/bots/maps/mp/gametypes/_persistence.gsc | 5.3 KB |
| handler/mods/bots/maps/mp/gametypes/_rank.gsc | 16 KB |
| handler/mods/bots/maps/mp/gametypes/_spawnlogic.gsc | 51 KB |
| handler/mods/bots/maps/mp/gametypes/_weapons.gsc | 76 KB |
| handler/mods/bots/maps/mp/killstreaks/_ac130.gsc | 54 KB |
| handler/mods/bots/maps/mp/killstreaks/_airdrop.gsc | 42 KB |
| handler/mods/bots/maps/mp/killstreaks/_airstrike.gsc | 34 KB |
| handler/mods/bots/maps/mp/killstreaks/_autosentry.gsc | 16 KB |
| handler/mods/bots/maps/mp/killstreaks/_emp.gsc | 11 KB |
| handler/mods/bots/maps/mp/killstreaks/_harrier.gsc | 28 KB |
| handler/mods/bots/maps/mp/killstreaks/_helicopter.gsc | 59 KB |
| handler/mods/bots/maps/mp/killstreaks/_killstreaks.gsc | 41 KB |
| handler/mods/bots/maps/mp/killstreaks/_nuke.gsc | 15 KB |
| handler/mods/bots/maps/mp/killstreaks/_uav.gsc | 15 KB |
| handler/mods/bots/maps/mp/mp_afghan.gsc | 655 B |
| handler/mods/bots/maps/mp/mp_derail.gsc | 610 B |
| handler/mods/bots/maps/mp/mp_nuked.d3dbsp.ents | 125 KB |
| handler/mods/bots/maps/mp/mp_rust.gsc | 451 B |
| handler/mods/bots/maps/mp/perks/_perkfunctions.gsc | 23 KB |
| handler/mods/bots/maps/mp/perks/_perks.gsc | 14 KB |
| handler/mods/bots/maps/mp/_stinger.gsc | 8.0 KB |
| handler/mods/bots/maps/mp/_utility.gsc | 59 KB |
| handler/mods/bots/scripts/bots.gsc | 56 B |
| handler/mods/bots/scripts/bots_chat.gsc | 61 B |
| handler/mods/bots/scripts/bots_menu.gsc | 57 B |
| handler/mods/bots/scripts/bots_pvb.gsc | 3.6 KB |
| handler/mods/bots/scripts/bots_sniper_loadout.gsc | 2.0 KB |
| handler/mods/bots/scripts/bots_test.gsc | 518 B |
| handler/mods/bots/scripts/bots_wp_editor.gsc | 62 B |
| handler/mods/bots/scripts/FPSBooster.gsc | 1.6 KB |
| handler/mods/bots/scripts/mp/co_hunted/hunted.gsc | 18 KB |
| handler/mods/bots/scripts/mp/mp_abandon/carnival.gsc | 43 KB |
| handler/mods/bots/scripts/mp/mp_afghan/afghan.gsc | 32 KB |
| handler/mods/bots/scripts/mp/mp_alpha/lockdown.gsc | 72 KB |
| handler/mods/bots/scripts/mp/mp_backlot/backlot.gsc | 49 KB |
| handler/mods/bots/scripts/mp/mp_bloc/bloc.gsc | 70 KB |
| handler/mods/bots/scripts/mp/mp_bloc_sh/bloc.gsc | 70 KB |
| handler/mods/bots/scripts/mp/mp_bog_sh/bog.gsc | 41 KB |
| handler/mods/bots/scripts/mp/mp_boneyard/scrapyard.gsc | 40 KB |
| handler/mods/bots/scripts/mp/mp_bravo/mission.gsc | 70 KB |
| handler/mods/bots/scripts/mp/mp_brecourt/wasteland.gsc | 53 KB |
| handler/mods/bots/scripts/mp/mp_broadcast/broadcast.gsc | 94 KB |
| handler/mods/bots/scripts/mp/mp_carentan/chinatown.gsc | 96 KB |
| handler/mods/bots/scripts/mp/mp_cargoship/wetwork.gsc | 63 KB |
| handler/mods/bots/scripts/mp/mp_cargoship_sh/wetwork.gsc | 63 KB |
| handler/mods/bots/scripts/mp/mp_checkpoint/karachi.gsc | 46 KB |
| handler/mods/bots/scripts/mp/mp_citystreets/district.gsc | 67 KB |
| handler/mods/bots/scripts/mp/mp_compact/salvage.gsc | 57 KB |
| handler/mods/bots/scripts/mp/mp_complex/bailout.gsc | 68 KB |
| handler/mods/bots/scripts/mp/mp_convoy/ambush.gsc | 78 KB |
| handler/mods/bots/scripts/mp/mp_countdown/countdown.gsc | 69 KB |
| handler/mods/bots/scripts/mp/mp_crash/crash.gsc | 62 KB |
| handler/mods/bots/scripts/mp/mp_crash_snow/crash.gsc | 62 KB |
| handler/mods/bots/scripts/mp/mp_crash_tropical/crash.gsc | 62 KB |
| handler/mods/bots/scripts/mp/mp_cross_fire/crossfire.gsc | 85 KB |
| handler/mods/bots/scripts/mp/mp_derail/derail.gsc | 80 KB |
| handler/mods/bots/scripts/mp/mp_dome/dome.gsc | 63 KB |
| handler/mods/bots/scripts/mp/mp_estate/estate.gsc | 61 KB |
| handler/mods/bots/scripts/mp/mp_estate_tropical/estate.gsc | 61 KB |
| handler/mods/bots/scripts/mp/mp_farm/downpour.gsc | 84 KB |
| handler/mods/bots/scripts/mp/mp_favela/favela.gsc | 50 KB |
| handler/mods/bots/scripts/mp/mp_fav_tropical/favela.gsc | 50 KB |
| handler/mods/bots/scripts/mp/mp_firingrange/firingrange.gsc | 66 KB |
| handler/mods/bots/scripts/mp/mp_fuel2/fuel.gsc | 74 KB |
| handler/mods/bots/scripts/mp/mp_hardhat/hardhat.gsc | 60 KB |
| handler/mods/bots/scripts/mp/mp_highrise/highrise.gsc | 65 KB |
| handler/mods/bots/scripts/mp/mp_invasion/invasion.gsc | 59 KB |
| handler/mods/bots/scripts/mp/mp_killhouse/killhouse.gsc | 32 KB |
| handler/mods/bots/scripts/mp/mp_nightshift/skidrow.gsc | 63 KB |
| handler/mods/bots/scripts/mp/mp_nuked/nuketown.gsc | 53 KB |
| handler/mods/bots/scripts/mp/mp_overgrown/overgrown.gsc | 81 KB |
| handler/mods/bots/scripts/mp/mp_paris/resistance.gsc | 82 KB |
| handler/mods/bots/scripts/mp/mp_pipeline/pipeline.gsc | 101 KB |
| handler/mods/bots/scripts/mp/mp_plaza2/arkaden.gsc | 106 KB |
| handler/mods/bots/scripts/mp/mp_quarry/quarry.gsc | 46 KB |
| handler/mods/bots/scripts/mp/mp_rundown/rundown.gsc | 58 KB |
| handler/mods/bots/scripts/mp/mp_rust/rust.gsc | 54 KB |
| handler/mods/bots/scripts/mp/mp_rust_long/rustlong.gsc | 36 KB |
| handler/mods/bots/scripts/mp/mp_seatown/seatown.gsc | 109 KB |
| handler/mods/bots/scripts/mp/mp_shipment/shipment.gsc | 15 KB |
| handler/mods/bots/scripts/mp/mp_shipment_long/shipmentlong.gsc | 26 KB |
| handler/mods/bots/scripts/mp/mp_showdown/showdown.gsc | 36 KB |
| handler/mods/bots/scripts/mp/mp_storm/storm.gsc | 82 KB |
| handler/mods/bots/scripts/mp/mp_storm_spring/storm.gsc | 82 KB |
| handler/mods/bots/scripts/mp/mp_strike/strike.gsc | 94 KB |
| handler/mods/bots/scripts/mp/mp_subbase/subbase.gsc | 53 KB |
| handler/mods/bots/scripts/mp/mp_terminal/terminal.gsc | 66 KB |
| handler/mods/bots/scripts/mp/mp_trailerpark/trailerpark.gsc | 40 KB |
| handler/mods/bots/scripts/mp/mp_underground/underground.gsc | 71 KB |
| handler/mods/bots/scripts/mp/mp_underpass/underpass.gsc | 39 KB |
| handler/mods/bots/scripts/mp/mp_vacant/vacant.gsc | 39 KB |
| handler/mods/bots/scripts/mp/mp_village/village.gsc | 57 KB |
| handler/mods/bots/scripts/mp/oilrig/oilrig.gsc | 31 KB |
| handler/mods/bots/scripts/showHP.gsc | 1.4 KB |
| handler/mods/bots/scripts/spawnTest.gsc | 1.4 KB |
| handler/mods/bots/scripts/spectatorKick.gsc | 790 B |
| handler/mods/bots/scripts/tripleDom.gsc | 1.5 KB |
| handler/osd.ini | 4.6 KB |
| handler/Prompt.au3 | 1.2 KB |
| handler/Prompt.exe | 894 KB |
| handler/Prompt2.au3 | 515 B |
| handler/Prompt2.exe | 894 KB |
| handler/Prompt3.au3 | 1.3 KB |
| handler/Prompt3.exe | 894 KB |
| handler/start.au3 | 1.0 KB |
| handler/start.exe | 894 KB |
| handler.js | 46 KB |
handler.js
Plain textHub.Handler.Version = 5; // Released at https://hub.splitscreen.me/ on Fri Apr 28 2023 06:56:35 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "esp2D3Wr49B3EBkbX";
Hub.Maintainer.Name = "Perserveruz";
Hub.Maintainer.Id = "nFAYvHKj75jAFRAgt";
var answers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"];
var answers1 = ["2", "1", "3", "4", "5", "6", "7", "8", "0"];
var answers2 = ["No", "Yes"];
var answers3 = ["Yes", "No"];
var answers4 = ["60", "45", "30", "0"];
var answers5 = ["Default", "Yes", "No"];
var answers6 = [
"No",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
"32",
"33",
"34",
"35",
"36",
"37",
"38",
"39",
"40",
"41",
"42",
"43",
"44",
"45",
"46",
"47",
"48",
"49",
"50",
"51",
"52",
"53",
"54",
"55",
"56",
"57",
"58",
"59",
"60",
"61",
"62",
"63",
"64",
"65",
"66",
"67",
"68",
"69",
"70",
"71",
"72",
"73",
"74",
"75",
"76",
"77",
"78",
"79",
"80",
"81",
"82",
"83",
"84",
"85",
"86",
"87",
"88",
"89",
"90",
"91",
"92",
"93",
"94",
"95",
"96",
"97",
"98",
"99",
"100",
"101",
"102",
"103",
"104",
"105",
"106",
"107",
"108",
"109",
"110",
"111",
"112",
"113",
"114",
"115",
"116",
"117",
"118",
"119",
"120",
"121",
"122",
"123",
"124",
"125",
"126",
"127",
"128",
"129",
"130",
"131",
"132",
"133",
"134",
"135",
"136",
"137",
"138",
"139",
"140",
"141",
"142",
"143",
"144",
"145",
"146",
"147",
"148",
"149",
"150",
"151",
"152",
"153",
"154",
"155",
"156",
"157",
"158",
"159",
"160",
"161",
"162",
"163",
"164",
"165",
"166",
"167",
"168",
"169",
"170",
"171",
"172",
"173",
"174",
"175",
"176",
"177",
"178",
"179",
"180",
"181",
"182",
"183",
"184",
"185",
"186",
"187",
"188",
"189",
"190",
"191",
"192",
"193",
"194",
"195",
"196",
"197",
"198",
"199",
"200"
];
var answers7 = ["Default", "Low", "Mid", "High", "Extra"];
Game.AddOption("Launch bot mod", "Select No if you wish to play on IW4x servers", "botmod", answers3);
Game.AddOption("Select the number of bots to be added", "", "Bots", answers);
Game.AddOption("Select the bot skill level", "", "Skill", answers1);
Game.AddOption("Unlock all stats", "", "Unlock", answers2);
Game.AddOption("Choose your preferred graphic settings", "", "Graphics", answers7);
Game.AddOption("Enable music only in the first instance?", "", "Mus", answers3);
Game.AddOption("For LAN and only for Guest PC, select the last 1-3 digits of the host IP", "", "lan", answers6);
Game.AddOption("Swap shoulder and trigger buttons (useful for Playstation controllers)", "", "pscontrollers", answers5);
Game.AddOption("Select the FPS Cap the game will use", "", "FPS", answers4);
Game.KillMutexType = "Mutant";
Game.KillMutex = ["iw4x_mutex"];
Game.FileSymlinkExclusions = ["d3d9.dll", "d3d9.ini", "Xinputplus.ini", "xinput1_4.dll", "xinput1_3.dll", "iw4x_config.cfg", "iw4x.dll", "guid.dat", "iw4x.stat", "nodes.dat"];
Game.DirExclusions = ["miles"];
Game.DirSymlinkCopyInstead = ["userraw", "logs"];
Game.DirSymlinkCopyInsteadIncludeSubFolders = true;
Game.SymlinkGame = true;
Game.SymlinkExe = false;
Game.SymlinkFolders = false;
Game.KeepSymLinkOnExit = true;
Game.SupportsKeyboard = true;
Game.UseNucleusEnvironment = true;
Game.HandlerInterval = 100;
Game.ExecutableName = "iw4x.exe";
Game.NeedsSteamEmulation = false;
Game.SteamID = "";
Game.GUID = "IW4x";
Game.GameName = "IW4x";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.HideTaskbar = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "IW4x - Multiplayer";
Game.HasDynamicWindowTitle = true;
Game.HookFocus = true;
Game.FakeFocus = false;
Game.SendFakeFocusMsg = false;
Game.PreventWindowDeactivation = false;
Game.KeyboardPlayerSkipPreventWindowDeactivate = false;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.InjectHookXinput = false;
Game.BlockRawInput = false;
Game.Hook.CustomDllEnabled = false;
Game.Hook.UseAlpha8CustomDll = false;
Game.SetForegroundWindowElsewhere = true;
Game.ProcessChangesAtEnd = false;
Game.KillProcessesOnClose = ["start", "Prompt", "Prompt2", "Prompt3", "connect", "F2 Host", "F2 Guest", "F3 Restart", "cmd"];
Game.DontResize = false;
Game.DontRemoveBorders = false;
Game.DontReposition = false;
Game.ResetWindows = true;
Game.Description =
"Requires a copy of Call of Duty Modern Warfare 2 in English (support will only be provided for the original Steam version), Nucleus v2.1.2 and above, IW4x client, and preferably the IW4x DLC map pack. Go to https://xlabs.dev/ for a guide on how to setup IW4x, and to download both client and DLC maps. Once all the instances have finished resizing and repositioning, have the first player create a game and the other players join by pressing F2. If two or more instances are using mouse/keyboard, you will need to lock input by pressing the end key. Press the end key again to unlock the input. Please note that if the input is locked then F2 will not work so only lock input by pressing the end key once everyone is connected to the match. To select maps with controller, you will need to place your mouse pointer over the map list. For this reason, if you're using a mix of controllers and mouse/keyboard, it is advisable to let the person using the mouse and keyboard host the match so that they can use the mouse to select the desired map even after input is locked. Online play on IW4x servers also works but if you want to connect to servers, you will need to select No under the Launch bot mod option. To play over LAN, guest PC will need to select the last 1-3 digits of the Host PC and press F2 once all instances have finished positioning/resizing and host PC has started a match. Spec Ops mode is currently not supported.";
Game.SupportsMultipleKeyboardsAndMice = true;
Game.Play = function() {
// Deprecated options
Game.HookSetCursorPos = false;
Game.HookGetCursorPos = false;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = false;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;
Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.DrawFakeMouseCursor = false;
Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = false;
Game.LockInputToggleKey = 0x23;
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\logs\\crash.log"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\logs\\crash.log"));
}
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods";
System.IO.Directory.CreateDirectory(filePath);
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK";
System.IO.Directory.CreateDirectory(filePath);
var filePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK\\Global";
System.IO.Directory.CreateDirectory(filePath);
var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players");
System.IO.Directory.CreateDirectory(filePath);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "d3d9.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "d3d9.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\iw4x.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "iw4x.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\iw4x-sp.exe");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "iw4x-sp.exe");
System.IO.File.Copy(savePkgOrigin, savePath, true);
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "iw4x_config.cfg");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Mods\\SpecialK\\Global\\osd.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "osd.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var lan = Context.Options["lan"];
if (lan == "No") {
var txtPath = Game.Folder + "\\Local IP.txt";
var dict = ["" + Context.LocalIP + ""];
Context.WriteTextFile(txtPath, dict);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\start.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\F2 Host.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt2.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt3.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\F3 Restart.exe"], false, 0);
}
if (lan > 0) {
var txtPath = Game.Folder + "\\Local IP.txt";
var dict = ["192.168.1." + lan + " "];
Context.WriteTextFile(txtPath, dict);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\start.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\F2 Guest.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt2.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\Prompt3.exe"], false, 10);
Context.RunAdditionalFiles([Context.ScriptFolder + "\\F3 Restart.exe"], false, 0);
}
var Unlock = Context.Options["Unlock"];
if (Unlock == "No") {
}
if (Unlock == "Yes") {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x.stat");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "iw4x.stat");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
var FPS = Context.Options["FPS"];
var Graphics = Context.Options["Graphics"];
if (Graphics == "Low") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "3"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"',
Context.FindLineNumberInTextFile(txtPath, "seta r_rendererPreference", Nucleus.SearchType.StartsWith) + '|seta r_rendererPreference "Shader model 2.0"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_outputConfiguration", Nucleus.SearchType.StartsWith) + '|seta snd_outputConfiguration "Stereo"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "Mid") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "0"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"',
Context.FindLineNumberInTextFile(txtPath, "seta r_rendererPreference", Nucleus.SearchType.StartsWith) + '|seta r_rendererPreference "Shader model 2.0"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_outputConfiguration", Nucleus.SearchType.StartsWith) + '|seta snd_outputConfiguration "Stereo"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "High") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"',
Context.FindLineNumberInTextFile(txtPath, "seta r_rendererPreference", Nucleus.SearchType.StartsWith) + '|seta r_rendererPreference "Shader model 2.0"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_outputConfiguration", Nucleus.SearchType.StartsWith) + '|seta snd_outputConfiguration "Stereo"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Graphics == "Extra") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aaSamples", Nucleus.SearchType.StartsWith) + '|seta r_aaSamples "4"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_enable", Nucleus.SearchType.StartsWith) + '|seta sm_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta ragdoll_enable", Nucleus.SearchType.StartsWith) + '|seta ragdoll_enable "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip", Nucleus.SearchType.StartsWith) + '|seta r_picmip "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_bump", Nucleus.SearchType.StartsWith) + '|seta r_picmip_bump "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_manual", Nucleus.SearchType.StartsWith) + '|seta r_picmip_manual "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_picmip_spec", Nucleus.SearchType.StartsWith) + '|seta r_picmip_spec "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_specular", Nucleus.SearchType.StartsWith) + '|seta r_specular "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_zFeather", Nucleus.SearchType.StartsWith) + '|seta r_zFeather "1"',
Context.FindLineNumberInTextFile(txtPath, "seta sm_maxLights", Nucleus.SearchType.StartsWith) + '|seta sm_maxLights "4"',
Context.FindLineNumberInTextFile(txtPath, "seta r_rendererPreference", Nucleus.SearchType.StartsWith) + '|seta r_rendererPreference "Shader model 2.0"',
Context.FindLineNumberInTextFile(txtPath, "seta snd_outputConfiguration", Nucleus.SearchType.StartsWith) + '|seta snd_outputConfiguration "Stereo"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
Context.CopyScriptFolder(Context.GetFolder(Nucleus.Folder.InstancedGameFolder));
var Mus = Context.Options["Mus"];
if (Mus == "Yes") {
if (Context.PlayerID == 0) {
var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles");
System.IO.Directory.CreateDirectory(filePath);
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\milesEq.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mpthree asi.file")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mpthree asi.file");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mpthree asi.file");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdolby.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdolby.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssdolby.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "miles\\mssds3d.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssds3d.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssds3d.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdsp.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdsp.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssdsp.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\msseax.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssmp3.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssogg.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssogg.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssogg.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msssrs.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msssrs.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\msssrs.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssvoice.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
} else {
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt"));
}
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssds3d.flt"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\mssds3d.flt"));
}
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\\\mssdsp.flt"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdsp.flt"));
}
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt"));
}
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi"));
}
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi"));
}
}
}
if (Mus == "No") {
var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles");
System.IO.Directory.CreateDirectory(filePath);
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\milesEq.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\milesEq.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mpthree asi.file")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mpthree asi.file");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mpthree asi.file");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdolby.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdolby.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssdolby.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "miles\\mssds3d.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssds3d.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssds3d.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdsp.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssdsp.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssdsp.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msseax.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\msseax.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssmp3.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssmp3.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssogg.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssogg.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssogg.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msssrs.flt")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\msssrs.flt");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\msssrs.flt");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\miles\\mssvoice.asi");
var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "miles\\mssvoice.asi");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
}
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.ini";
var dict = [Context.FindLineNumberInTextFile(txtPath, "SlotReassignment=", Nucleus.SearchType.StartsWith) + "|SlotReassignment=" + Context.PlayerID + ""];
Context.ReplaceLinesInTextFile(txtPath, dict);
var botmod = Context.Options["botmod"];
if (botmod == "Yes") {
var Skill = Context.Options["Skill"];
var Bots = Context.Options["Bots"];
var Args = (Context.Args =
" +set fs_game mods/bots +set bots_skill " +
Skill +
" +set bots_manage_fill " +
Bots +
" +set bots_main_waitForHostTime 360 +exec z_svr_bots.cfg +sv_securityLevel 1 +r_fullscreen 0 +nosteam +r_fog 0 ");
Context.StartArguments = Args;
}
var botmod = Context.Options["botmod"];
if (botmod == "No") {
var Skill = Context.Options["Skill"];
var Bots = Context.Options["Bots"];
var Args = (Context.Args = " +set bots_skill " + Skill + " +set bots_manage_fill " + Bots + " +exec z_svr_bots.cfg +r_fullscreen 0 +nosteam +r_fog 0 ");
Context.StartArguments = Args;
}
var pscontrollers = Context.Options["pscontrollers"];
if (pscontrollers == "Default") {
}
if (pscontrollers == "Yes") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta gpad_buttonConfig", Nucleus.SearchType.StartsWith) + '|seta gpad_buttonConfig "buttons_default"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LSHLDR "+speed_throw"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RSHLDR "+attack"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LTRIG "+smoke"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RTRIG "+frag"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var pscontrollers = Context.Options["pscontrollers"];
if (pscontrollers == "No") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta gpad_buttonConfig", Nucleus.SearchType.StartsWith) + '|seta gpad_buttonConfig "buttons_default"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LSHLDR "+smoke"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RSHLDR", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RSHLDR "+frag"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_LTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_LTRIG "+speed_throw"',
Context.FindLineNumberInTextFile(txtPath, "bind BUTTON_RTRIG", Nucleus.SearchType.StartsWith) + '|bind BUTTON_RTRIG "+attack"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var FPS = Context.Options["FPS"];
if (Context.AspectRatioDecimal < 1.2) {
Game.DontReposition = true;
Game.DontResize = true;
Game.DontRemoveBorders = true;
Game.Hook.ResWidth = Context.Width;
Game.Hook.ResHeight = Context.Width / 1.33333;
Context.HideDesktop();
var FPS = Context.Options["FPS"];
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "' + Context.Width + "x" + Context.Width / 1.33333 + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "' + Context.Width + "x" + Context.Width / 1.33333 + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_displayMode", Nucleus.SearchType.StartsWith) + '|seta r_displayMode "windowed (no border)"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aspectRatio", Nucleus.SearchType.StartsWith) + '|seta r_aspectRatio "custom"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customAspectRatio", Nucleus.SearchType.StartsWith) + '|seta r_customAspectRatio "' + Context.AspectRatioDecimal + '"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta intro", Nucleus.SearchType.StartsWith) + '|seta intro "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta vid_ypos", Nucleus.SearchType.StartsWith) + '|seta vid_ypos "' + (Context.Height - Context.Width / 1.33333) / 2 + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
if (Context.PlayerID == 0) {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta vid_xpos", Nucleus.SearchType.StartsWith) + '|seta vid_xpos "0"',
Context.FindLineNumberInTextFile(txtPath, "seta vid_ypos", Nucleus.SearchType.StartsWith) + '|seta vid_ypos "' + (Context.Height - Context.Width / 1.33333) / 2 + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Context.PlayerID == 1) {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta vid_xpos", Nucleus.SearchType.StartsWith) + '|seta vid_xpos "' + Context.Width + '"',
Context.FindLineNumberInTextFile(txtPath, "seta vid_ypos", Nucleus.SearchType.StartsWith) + '|seta vid_ypos "' + (Context.Height - Context.Width / 1.33333) / 2 + '"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
} else {
Game.DontReposition = false;
Game.DontResize = false;
Game.DontRemoveBorders = true;
Game.Hook.ResWidth = Context.Width;
Game.Hook.ResHeight = Context.Height;
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta com_maxfps", Nucleus.SearchType.StartsWith) + '|seta com_maxfps "' + FPS + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_mode", Nucleus.SearchType.StartsWith) + '|seta r_mode "' + Context.Width + "x" + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customMode", Nucleus.SearchType.StartsWith) + '|seta r_customMode "' + Context.Width + "x" + Context.Height + '"',
Context.FindLineNumberInTextFile(txtPath, "seta r_displayMode", Nucleus.SearchType.StartsWith) + '|seta r_displayMode "windowed (no border)"',
Context.FindLineNumberInTextFile(txtPath, "seta r_aspectRatio", Nucleus.SearchType.StartsWith) + '|seta r_aspectRatio "custom"',
Context.FindLineNumberInTextFile(txtPath, "seta r_customAspectRatio", Nucleus.SearchType.StartsWith) + '|seta r_customAspectRatio "' + Context.AspectRatioDecimal + '"',
Context.FindLineNumberInTextFile(txtPath, "seta name", Nucleus.SearchType.StartsWith) + '|seta name "' + Context.Nickname + '"',
Context.FindLineNumberInTextFile(txtPath, "seta intro", Nucleus.SearchType.StartsWith) + '|seta intro "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_vsync", Nucleus.SearchType.StartsWith) + '|seta r_vsync "1"',
Context.FindLineNumberInTextFile(txtPath, "seta r_useD3D9Ex", Nucleus.SearchType.StartsWith) + '|seta r_useD3D9Ex "0"',
Context.FindLineNumberInTextFile(txtPath, "seta r_dof_enable", Nucleus.SearchType.StartsWith) + '|seta r_dof_enable "0"',
Context.FindLineNumberInTextFile(txtPath, "seta vid_xpos", Nucleus.SearchType.StartsWith) + '|seta vid_xpos ""',
Context.FindLineNumberInTextFile(txtPath, "seta vid_ypos", Nucleus.SearchType.StartsWith) + '|seta vid_ypos ""'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Player.IsKeyboardPlayer) {
Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;
Game.ProtoInput.FindWindowHook = true;
Game.ProtoInput.RegisterRawInputHook = false;
Game.ProtoInput.GetRawInputDataHook = true;
Game.ProtoInput.MessageFilterHook = false;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = false;
Game.ProtoInput.ClipCursorHook = false;
Game.ProtoInput.ClipCursorHookCreatesFakeClip = false;
Game.ProtoInput.FocusHooks = false;
Game.ProtoInput.DrawFakeCursor = false;
Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = false;
Game.ProtoInput.MouseButtonFilter = false;
Game.ProtoInput.KeyboardButtonFilter = true;
Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.EnableFocusMessageLoop = false;
Game.ProtoInput.FocusLoopIntervalMilliseconds = 0;
Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [];
Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];
if (System.IO.File.Exists((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll"))) {
System.IO.File.Delete((Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\d3d9.dll"));
}
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta gpad_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_enabled "0"',
Context.FindLineNumberInTextFile(txtPath, "seta gpad_lockon_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_lockon_enabled "0"',
Context.FindLineNumberInTextFile(txtPath, "seta gpad_slowdown_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_slowdown_enabled "0"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
Game.PauseBetweenProcessGrab = 20;
Game.PauseBetweenStarts = 5;
} else {
Game.PauseBetweenProcessGrab = 15;
Game.PauseBetweenStarts = 5;
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\players\\iw4x_config.cfg";
var dict = [
Context.FindLineNumberInTextFile(txtPath, "seta gpad_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_enabled "1"',
Context.FindLineNumberInTextFile(txtPath, "seta gpad_lockon_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_lockon_enabled "1"',
Context.FindLineNumberInTextFile(txtPath, "seta gpad_slowdown_enabled", Nucleus.SearchType.StartsWith) + '|seta gpad_slowdown_enabled "1"'
];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
Game.ProtoInput.OnInputLocked = function() {
if (Context.HasKeyboardPlayer) {
for (var i = 0; i < PlayerList.Count; i++) {
var player = PlayerList[i];
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.RegisterRawInputHookID);
ProtoInput.StartFocusMessageLoop(player.ProtoInputInstanceHandle, 5, true, true, true, true, true);
System.Threading.Thread.Sleep(1000);
ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, false);
ProtoInput.StopFocusMessageLoop(player.ProtoInputInstanceHandle);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.EnableMessageBlock(player.ProtoInputInstanceHandle, 0x0008);
}
}
};
Game.ProtoInput.OnInputUnlocked = function() {
for (var i = 0; i < PlayerList.Count; i++) {
var player = PlayerList[i];
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);
ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, false);
ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, true);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
}
};
};