script that shows fps?
i haven't played t2 for about 2 years now, maybe longer
but i installed today since i was getting bored of tf2
would someone please refresh my memory as to what's a very nice small little script that shows fps and ping?
typing out show ("$fps::real"); every time i log in is tedious
but i installed today since i was getting bored of tf2
would someone please refresh my memory as to what's a very nice small little script that shows fps and ping?
typing out show ("$fps::real"); every time i log in is tedious
Comments
or go here.
www.tribaloutpost.com
// #name = FpsHud // #version = 1.1 // #date = 2001-09-25 // #author = Runar // #credits = Crunchy, who's things i shamelessly copies // #email = runar@vsdn.org // #web = http://www.vsdn.org // #description = Hud that show frames per second // #status = Release 2 // #Edited by Anakha 2002-12-21 // exec("scripts/autoexec/fpshud.cs"); if(!isObject(FpsHud)) { new ScriptObject(FpsHud) { class = FpsHud; ScheduleId = 0; LabelColor = "222 222 222"; TextColor = "255 255 255"; Gui = "FpsHudGui"; }; } function FpsHud::Setup(%this) { new GuiControlProfile ("fpsHudLabelProfile") { FontType = "Verdana"; FontSize = 12; fontColor = %this.LabelColor; justify = "left"; }; new GuiControlProfile ("fpsHudTextProfile") { FontType = "Verdana"; FontSize = 12; fontColor = %this.TextColor; justify = "left"; }; } function FpsHud::Create(%this) { %this.Destroy(); %x = getWord(hudClusterBack.position, 0)-43-8; %y = getWord(hudClusterBack.position, 1); new ShellFieldCtrl(%this.Gui) { profile = "FrostyTransGui_HudProfile"; horizSizing = "left"; vertSizing = "bottom"; position = %x SPC %y; extent = "80 16"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl() { profile = "fpsHudLabelProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "0 0"; extent = "35 16"; visible = "1"; text = "FPS:"; }; }; %this.Gui.text = new GuiTextCtrl() { profile = "fpsHudTextProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "31 0"; extent = "40 16"; visible = "1"; }; %this.Gui.add(%this.Gui.text); playGui.add(%this.Gui); } function FpsHud::Update(%this, %none) { if(%this.ScheduleId != 0) cancel(%this.ScheduleId); if(isObject(%this.Gui)) { %this.Gui.text.setValue(mFloor($fps::real)); %this.ScheduleId = %this.schedule(1000, Update); } } function FpsHud::Destroy(%this) { if(%this.ScheduleId != 0) cancel(%this.ScheduleId); if(isObject(%this.Gui)) { playGui.remove(%this.Gui); %this.Gui.delete(); } } // Packaged parented functions package FpsHudPkg { function clientCmdTogglePlayHuds(%val) { FpsHudGui.setVisible(%val); parent::clientCmdTogglePlayHuds(%val); } function DispatchLaunchMode() { FpsHud.Setup(); parent::DispatchLaunchMode(); } function LoadingGui::onWake(%this) { if (!$FpsHudCreated) { FpsHud.Create(); if (isObject(HudMover)) hudmover::addhud(FpsHudGui, "FpsHud"); $FpsHudCreated = true; FpsHud.Update(); } parent::onWake(%this); } }; activatePackage(FpsHudPkg);and its brother script:
// #name = pingHud // #version = 1.1 // #date = 2001-09-27 // #author = Runar // #credits = Crunchy, who's things i shamelessly copies // #email = runar@vsdn.org // #web = http://www.vsdn.org // #description = Hud that uses the built in netmeter // #status = Release 2 // #Edited by Anakha 2002-12-21 // exec("scripts/autoexec/pinghud.cs"); if(!isObject(PingHud)) { new ScriptObject(PingHud) { class = PingHud; ScheduleId = 0; Counter = 0; Sum = 0; LabelColor = "222 222 222"; TextColor = "255 255 255"; Gui = "PingHudGui"; }; } function PingHud::Setup(%this) { new GuiControlProfile ("PingHudLabelProfile") { FontType = "Verdana"; FontSize = 12; fontColor = %this.LabelColor; justify = "left"; }; new GuiControlProfile ("PingHudTextProfile") { FontType = "Verdana"; FontSize = 12; fontColor = %this.TextColor; justify = "left"; }; } function PingHud::Create(%this) { %this.Destroy(); %x = getWord(hudClusterBack.position, 0)-43-8; %y = getWord(hudClusterBack.position, 1)+20; new ShellFieldCtrl(%this.Gui) { profile = "FrostyTransGui_HudProfile"; horizSizing = "left"; vertSizing = "bottom"; position = %x SPC %y; extent = "80 16"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl() { profile = "PingHudLabelProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "40 16"; visible = "1"; text = "Ping:"; }; }; %this.Gui.text = new GuiTextCtrl() { profile = "pingHudTextProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "28 0"; extent = "40 16"; visible = "1"; }; %this.Gui.add(%this.Gui.text); playGui.add(%this.Gui); } function pingHud::Update(%this, %ping) { if(isObject(%this.Gui)) %this.Gui.text.setValue(%ping > 999 ? 999 : %ping); } function PingHud::Destroy(%this) { if(%this.ScheduleId != 0) cancel(%this.ScheduleId); if(isObject(%this.Gui)) { playGui.remove(%this.Gui); %this.Gui.delete(); } } function PingHud::Calc(%this, %ping) { %this.Sum = %this.Sum + mFormatFloat(%ping, "%4.0f"); if(%this.Counter++ == 20) { %this.Update(mFormatFloat(%this.Sum / 20, "%4.0f")); %this.Counter = 0; %this.Sum = 0; } } package pingHud { function NetBarHud::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes) { parent::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes); PingHud.Calc(%ping); } function clientCmdTogglePlayHuds(%val) { parent::clientCmdTogglePlayHuds(%val); pingHudGui.setVisible(%val); } function DispatchLaunchMode() { PingHud.Setup(); parent::DispatchLaunchMode(); } function LoadingGui::onWake(%this) { if(!$pingHudCreated) { pingHud.Create(); if(isObject(HudMover)) hudmover::addhud(PingHudGui, "PingHud"); $pingHudCreated = true; } parent::onWake(%this); } }; activatePackage(pingHud);