I join to my server and this code appears in full screen:
https://drive.google.com/open?id=0B2mPX ... WNRc1VqU3M

And this is all code error. I copied with Crtl+V in console.
And now the tachometer occupies a quarter of a screen.
Then I have join to other servers and the same thing happens.
Code: Select all
/*
* ==================================
* Function: Tachmeter @ plugin.tachometer.php
* Authors: undef.de, reaby
* Website: http://www.undef.name
* License: GPLv3
* ==================================
*/
#Include "TextLib" as TextLib
#Include "MathLib" as MathLib
Text PadString (Text _String, Integer _MaxLength) {
declare Text String = _String;
while (TextLib::Length(String) < _MaxLength) {
String = "0"^ String;
}
if (TextLib::Length(String) > _MaxLength) {
String = TextLib::SubString(String, (TextLib::Length(String) - _MaxLength), _MaxLength);
}
return String;
}
Integer Blink (Text _ChildId, Integer _NextChange, Boolean _BlinkSpeed) {
declare CMlQuad Container <=> (Page.GetFirstChild(_ChildId) as CMlQuad);
declare Vec3 ColorDefault = TextLib::ToColor("888888");
declare Vec3 ColorBlink = TextLib::ToColor("FFF500");
if (CurrentTime >= _NextChange) {
if (Container.ModulateColor == ColorBlink) {
Container.ModulateColor = ColorDefault;
}
else {
Container.ModulateColor = ColorBlink;
}
if (_BlinkSpeed == True) {
return (CurrentTime + 250);
}
else {
return (CurrentTime + 500);
}
}
return _NextChange;
}
main() {
// Declarations
// declare persistent Boolean PersistentStorage_TachometerStatisticsStatus = False;
// declare persistent Boolean PersistentStorage_TachometerSoundStatus = True;
// declare persistent Integer PersistentStorage_TachometerCurrentVelocityUnit = 0;
// declare persistent Integer PersistentStorage_TachometerCurrentModulateColor = 0;
declare Boolean TachometerStatisticsStatus = False;
declare Boolean TachometerSoundStatus = True;
declare Integer TachometerCurrentVelocityUnit = 0;
declare Integer TachometerCurrentModulateColor = 0;
declare netread Integer Net_LibUI_SettingsUpdate for Teams[0];
declare netread Text[Text] Net_LibUI_Settings for Teams[0];
declare CMlFrame FrameTachometer <=> (Page.GetFirstChild("FrameTachometer") as CMlFrame);
declare CMlFrame FrameSpeedStatistic <=> (Page.GetFirstChild("FrameSpeedStatistic") as CMlFrame);
declare CMlQuad QuadTachometer <=> (Page.GetFirstChild("QuadTachometer") as CMlQuad);
declare CMlQuad QuadTachoneedle <=> (Page.GetFirstChild("QuadTachoneedle") as CMlQuad);
declare CMlQuad QuadTachoscale <=> (Page.GetFirstChild("QuadTachoscale") as CMlQuad);
declare CMlQuad QuadTachoscaleOverlay <=> (Page.GetFirstChild("QuadTachoscaleOverlay") as CMlQuad);
declare CMlQuad QuadTachoscale01 <=> (Page.GetFirstChild("QuadTachoscale01") as CMlQuad);
declare CMlQuad QuadTachoscale02 <=> (Page.GetFirstChild("QuadTachoscale02") as CMlQuad);
declare CMlQuad QuadTachoscale03 <=> (Page.GetFirstChild("QuadTachoscale03") as CMlQuad);
declare CMlQuad QuadTachoscale04 <=> (Page.GetFirstChild("QuadTachoscale04") as CMlQuad);
declare CMlQuad QuadTachoscale05 <=> (Page.GetFirstChild("QuadTachoscale05") as CMlQuad);
declare CMlQuad QuadTachoscale06 <=> (Page.GetFirstChild("QuadTachoscale06") as CMlQuad);
declare CMlQuad QuadTachoscale07 <=> (Page.GetFirstChild("QuadTachoscale07") as CMlQuad);
declare CMlQuad QuadTachoscale08 <=> (Page.GetFirstChild("QuadTachoscale08") as CMlQuad);
declare CMlQuad QuadTachoscale09 <=> (Page.GetFirstChild("QuadTachoscale09") as CMlQuad);
declare CMlQuad QuadTachoscale10 <=> (Page.GetFirstChild("QuadTachoscale10") as CMlQuad);
declare CMlQuad QuadTachoscale11 <=> (Page.GetFirstChild("QuadTachoscale11") as CMlQuad);
declare CMlQuad QuadTachoscale12 <=> (Page.GetFirstChild("QuadTachoscale12") as CMlQuad);
declare CMlLabel LabelVelocityUnit <=> (Page.GetFirstChild("LabelVelocityUnit") as CMlLabel);
declare CMlLabel LabelSpeed <=> (Page.GetFirstChild("LabelSpeed") as CMlLabel);
declare CMlLabel LabelDistance1 <=> (Page.GetFirstChild("LabelDistance1") as CMlLabel);
declare CMlLabel LabelDistance2 <=> (Page.GetFirstChild("LabelDistance2") as CMlLabel);
declare CMlLabel LabelDistance3 <=> (Page.GetFirstChild("LabelDistance3") as CMlLabel);
declare CMlLabel LabelDistance4 <=> (Page.GetFirstChild("LabelDistance4") as CMlLabel);
declare CMlLabel LabelDistance5 <=> (Page.GetFirstChild("LabelDistance5") as CMlLabel);
declare CMlLabel LabelDistance6 <=> (Page.GetFirstChild("LabelDistance6") as CMlLabel);
declare CMlLabel LabelGear <=> (Page.GetFirstChild("LabelGear") as CMlLabel);
declare CMlQuad QuadIconStatistics <=> (Page.GetFirstChild("QuadIconStatistics") as CMlQuad);
declare CMlQuad QuadIconSounds <=> (Page.GetFirstChild("QuadIconSounds") as CMlQuad);
declare CMlQuad QuadIconLights <=> (Page.GetFirstChild("QuadIconLights") as CMlQuad);
declare CMlQuad QuadIconFuel <=> (Page.GetFirstChild("QuadIconFuel") as CMlQuad);
declare CMlQuad QuadIconTemperature <=> (Page.GetFirstChild("QuadIconTemperature") as CMlQuad);
declare SoundDriveBackward = Audio.CreateSound("http://maniacdn.net/undef.de/uaseco/tachometer/templates/classic2017/biep-biep-biep.ogg", 1.0, False, True, False);
declare SoundGearShift = Audio.CreateSound("http://maniacdn.net/undef.de/uaseco/tachometer/templates/classic2017/gear-shift.ogg", 1.0, False, False, False);
declare Text LastGear = "P";
declare Text[] VelocityUnits = ["KPH", "KP/H", "KMH", "KM/H", "MPH", "MP/H", "MIH", "MI/H", "SPH", "SP/H"];
declare Text[] ModulateColors = ["777777", "555555", "FFFFFF", "FEFFC5", "ACC720", "005893", "FFF700", "FFA700", "E74F3C", "F74BD3"];
declare Integer RefreshInterval = 100;
declare Integer RefreshTime = CurrentTime;
declare Integer MeasuredTopSpeed = 0;
declare Real MeasuredTopAltitude = 0.0;
declare Real MeasuredTopRpm = 0.0;
declare Integer TimeCount = 1;
declare PrevSettingsUpdate = -1;
declare CutOffTimeLimit = -1;
// Setup to the stored values
LabelVelocityUnit.Value = VelocityUnits[TachometerCurrentVelocityUnit];
QuadTachoscale.ModulateColor = TextLib::ToColor(ModulateColors[TachometerCurrentModulateColor]);
// Turn statistics icon on/off
if (TachometerStatisticsStatus == True) {
QuadIconStatistics.ModulateColor = TextLib::ToColor("50B7FF");
}
else {
QuadIconStatistics.ModulateColor = TextLib::ToColor("FFFFFF");
}
// Turn sounds on/off
if (TachometerSoundStatus == True) {
QuadIconSounds.ModulateColor = TextLib::ToColor("FFFFFF");
}
else {
QuadIconSounds.ModulateColor = TextLib::ToColor("FF0000");
}
// Turn lights icon on
declare Text MapMood = "Day";
if (MapMood == "Sunset" || MapMood == "Night") {
QuadIconLights.ModulateColor = TextLib::ToColor("50B7FF");
}
else {
QuadIconLights.ModulateColor = TextLib::ToColor("888888");
}
// Setup Fuel and Temperature display
declare Integer RestPlayTime = -1;
declare Integer BlinkNextChangeFuel = 0;
declare Integer BlinkNextChangeTemp = 0;
// Settings
FrameTachometer.RelativeScale = 0.5300;
SoundDriveBackward.Volume = 1.0;
SoundGearShift.Volume = 1.0;
QuadTachoscale01.Opacity = 0.0;
QuadTachoscale02.Opacity = 0.0;
QuadTachoscale03.Opacity = 0.0;
QuadTachoscale04.Opacity = 0.0;
QuadTachoscale05.Opacity = 0.0;
QuadTachoscale06.Opacity = 0.0;
QuadTachoscale07.Opacity = 0.0;
QuadTachoscale08.Opacity = 0.0;
QuadTachoscale09.Opacity = 0.0;
QuadTachoscale10.Opacity = 0.0;
QuadTachoscale11.Opacity = 0.0;
QuadTachoscale12.Opacity = 0.0;
LabelVelocityUnit.Opacity = 0.65;
declare Text[] QuadTachoscaleIds = [
"QuadTachoscale01",
"QuadTachoscale02",
"QuadTachoscale03",
"QuadTachoscale04",
"QuadTachoscale05",
"QuadTachoscale06",
"QuadTachoscale07",
"QuadTachoscale08",
"QuadTachoscale09",
"QuadTachoscale10",
"QuadTachoscale11",
"QuadTachoscale12"
];
declare CMlGraph GraphStatistic <=> (Page.GetFirstChild("GraphStatistic") as CMlGraph);
GraphStatistic.CoordsMin = <0.0, -1200.0>;
GraphStatistic.CoordsMax = <720.0, 7200.0>;
declare CMlGraphCurve[] Curves =
[GraphStatistic.AddCurve(), GraphStatistic.AddCurve()]; Curves[0].Color
= <0.9, 0.9, 0.9>; Curves[1].Color
= <0.0, 7.0, 0.0>;
declare CMlLabel LabelSpeedStatistic <=> (Page.GetFirstChild("LabelSpeedStatistic") as CMlLabel);
declare CMlLabel LabelAltitudeStatistic <=> (Page.GetFirstChild("LabelAltitudeStatistic") as CMlLabel);
while (True) {
yield;
if (!PageIsVisible || InputPlayer == Null) {
continue;
}
// Hide the Widget for Spectators (also temporary one)
if (InputPlayer.IsSpawned == False) {
SoundGearShift.Stop();
SoundDriveBackward.Stop();
FrameTachometer.Hide();
continue;
}
else {
FrameTachometer.Show();
}
if (PrevSettingsUpdate != Net_LibUI_SettingsUpdate) {
PrevSettingsUpdate = Net_LibUI_SettingsUpdate;
foreach (SettingName => SettingValue in Net_LibUI_Settings) {
switch (SettingName) {
case "TMUIModule_Countdown_CutOffTimeLimit": {
CutOffTimeLimit = TextLib::ToInteger(SettingValue);
}
}
}
}
RestPlayTime = (CutOffTimeLimit - GameTime + 1);
//log(MeasuredTopRpm ^", "^ InputPlayer.EngineTurboRatio ^", "^ InputPlayer.StuntLast ^", "^ InputPlayer.StuntPoints);
// Update Speed display
LabelSpeed.Value = ""^ InputPlayer.DisplaySpeed;
// Calculate the rotation for the Needle
declare Real NeedleRotation = ((InputPlayer.EngineRpm / 12000.0) * 239.6) + 59.6;
if (InputPlayer.EngineRpm >= 12000.0) {
NeedleRotation = 299.2;
}
if (InputPlayer.RaceState != CTmMlPlayer::ERaceState::Finished && RestPlayTime >= 0 && RestPlayTime <= 15000) {
BlinkNextChangeFuel = Blink("QuadIconFuel", BlinkNextChangeFuel, True);
BlinkNextChangeTemp = Blink("QuadIconTemperature", BlinkNextChangeTemp, True);
}
else if (InputPlayer.RaceState != CTmMlPlayer::ERaceState::Finished && RestPlayTime >= 0 && RestPlayTime <= 30000) {
BlinkNextChangeFuel = Blink("QuadIconFuel", BlinkNextChangeFuel, True);
BlinkNextChangeTemp = Blink("QuadIconTemperature", BlinkNextChangeTemp, False);
}
else if (InputPlayer.RaceState != CTmMlPlayer::ERaceState::Finished && RestPlayTime >= 0 && RestPlayTime <= 60000) {
BlinkNextChangeFuel = Blink("QuadIconFuel", BlinkNextChangeFuel, False);
}
else {
QuadIconFuel.ModulateColor = TextLib::ToColor("FFFFFF");
QuadIconTemperature.ModulateColor = TextLib::ToColor("FFFFFF");
}
// Store TopSpeed
if (InputPlayer.DisplaySpeed > MeasuredTopSpeed) {
MeasuredTopSpeed = InputPlayer.DisplaySpeed;
}
// Store TopRpm
if (InputPlayer.EngineRpm > MeasuredTopRpm) {
MeasuredTopRpm = InputPlayer.EngineRpm;
}
if (CurrentTime > RefreshTime) {
// Check for max. width and reset if required
if (TimeCount >= GraphStatistic.CoordsMax.X || InputPlayer.RaceState == CTmMlPlayer::ERaceState::BeforeStart) {
declare ColorSpeed = Curves[0].Color;
declare ColorAltitude = Curves[1].Color;
GraphStatistic.RemoveCurve(Curves[0]);
GraphStatistic.RemoveCurve(Curves[1]);
Curves = [GraphStatistic.AddCurve(), GraphStatistic.AddCurve()];
Curves[0].Color = ColorSpeed;
Curves[1].Color = ColorAltitude;
if (InputPlayer.RaceState == CTmMlPlayer::ERaceState::BeforeStart) {
MeasuredTopSpeed = 0;
MeasuredTopAltitude = 0.0;
}
TimeCount = 1;
}
// Store current Speed at timestamp
Curves[0].Points.add(<(TimeCount + 0.00001), (InputPlayer.Speed * 3.6)>);
// Compensate differences and store current Altitude
declare Real Altitude = InputPlayer.Position.Y;
if (Map.CollectionName == "Canyon") {
Altitude += 0.005517;
}
else if (Map.CollectionName == "Stadium") {
Altitude -= 9.01413;
}
else if (Map.CollectionName == "Valley") {
Altitude -= 2.00138;
}
Curves[1].Points.add(<(TimeCount + 0.00001), (Altitude * 3)>);
// Store TopAltitude
if (Altitude > MeasuredTopAltitude) {
MeasuredTopAltitude = Altitude;
}
// Build new label
LabelSpeedStatistic.Value = "Top speed: "^ MeasuredTopSpeed ^" "^ TextLib::ToLowerCase(VelocityUnits[TachometerCurrentVelocityUnit]);
LabelAltitudeStatistic.Value = "Top altitude: "^ MathLib::FloorInteger(MeasuredTopAltitude) ^" m";
// Reset RefreshTime and update Counter
RefreshTime = (CurrentTime + RefreshInterval);
TimeCount += 1;
}
// Let the needle tremble a little bit depending on speed
// QuadTachoneedle.RelativeRotation = NeedleRotation + MathLib::Rand(0.0, MathLib::Abs((((InputPlayer.Speed * 3.6) / 1000.0) * 4)));
QuadTachoneedle.RelativeRotation = NeedleRotation + MathLib::Rand(0.0, MathLib::Abs(((InputPlayer.EngineRpm / 8000.0) * 2)));
// Update RPM Indicators
declare Real CurrentRpm = MathLib::Abs(InputPlayer.EngineRpm / 10);
declare Integer ActiveId = MathLib::FloorInteger(CurrentRpm / 100.0) % 100;
declare Integer Index = 0;
for (Index, 0, ActiveId - 1) {
declare CMlQuad QuadActive <=> (Page.GetFirstChild(QuadTachoscaleIds[Index]) as CMlQuad);
QuadActive.Opacity = 1.0;
}
declare CMlQuad ActiveQuad <=> (Page.GetFirstChild(QuadTachoscaleIds[ActiveId]) as CMlQuad);
ActiveQuad.Opacity = 0.01 * (CurrentRpm - (ActiveId * 100));
for (Index, ActiveId + 1, 11) {
declare CMlQuad QuadActive <=> (Page.GetFirstChild(QuadTachoscaleIds[Index]) as CMlQuad);
QuadActive.Opacity = 0.0;
}
// Update Distance
declare CurrentDistance = PadString( TextLib::ToText( MathLib::NearestInteger(InputPlayer.Distance / 10) ), 6);
LabelDistance1.Value = TextLib::SubString(CurrentDistance, 0, 1);
LabelDistance2.Value = TextLib::SubString(CurrentDistance, 1, 1);
LabelDistance3.Value = TextLib::SubString(CurrentDistance, 2, 1);
LabelDistance4.Value = TextLib::SubString(CurrentDistance, 3, 1);
LabelDistance5.Value = TextLib::SubString(CurrentDistance, 4, 1);
LabelDistance6.Value = TextLib::SubString(CurrentDistance, 5, 1);
if (InputPlayer.EngineCurGear == 0 && (InputPlayer.Speed * 3.6) > 0.0) {
if (LastGear != "N") {
LastGear = "N";
if (TachometerSoundStatus == True) {
SoundDriveBackward.Stop();
SoundGearShift.Stop();
SoundGearShift.Play();
}
}
LabelGear.Value = "N";
}
else if (InputPlayer.DisplaySpeed == 0) {
if (LastGear != "P") {
LastGear = "P";
if (TachometerSoundStatus == True) {
SoundDriveBackward.Stop();
SoundGearShift.Stop();
SoundGearShift.Play();
}
}
LabelGear.Value = "P";
}
else if ((InputPlayer.Speed * 3.6) > 0.0) {
if (LastGear != "D") {
LastGear = "D";
if (TachometerSoundStatus == True) {
SoundDriveBackward.Stop();
SoundGearShift.Stop();
SoundGearShift.Play();
}
}
// Calculate s gear
LabelGear.Value = ""^ InputPlayer.EngineCurGear;
}
else if ((InputPlayer.Speed * 3.6) <= -0.1) {
if (LastGear != "R") {
LastGear = "R";
if (TachometerSoundStatus == True) {
SoundGearShift.Stop();
SoundGearShift.Play();
SoundDriveBackward.Play();
}
}
LabelGear.Value = "R";
}
// Check for MouseEvents
foreach (Event in PendingEvents) {
switch (Event.Type) {
case CMlEvent::Type::MouseOver : {
if (Event.ControlId == "QuadIconStatistics") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 2, 1.0);
QuadIconStatistics.ModulateColor = TextLib::ToColor("00AA00");
}
else if (Event.ControlId == "QuadIconSounds") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 2, 1.0);
QuadIconSounds.ModulateColor = TextLib::ToColor("00AA00");
}
else if (Event.ControlId == "LabelVelocityUnit") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 2, 1.0);
LabelVelocityUnit.TextColor = TextLib::ToColor("00AA00");
LabelVelocityUnit.Opacity = 1.0;
}
// else if (Event.ControlId == "QuadTachoscale") {
// Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 2, 1.0);
// }
}
case CMlEvent::Type::MouseOut : {
if (Event.ControlId == "QuadIconStatistics") {
if (TachometerStatisticsStatus == True) {
QuadIconStatistics.ModulateColor = TextLib::ToColor("50B7FF");
}
else {
QuadIconStatistics.ModulateColor = TextLib::ToColor("FFFFFF");
}
}
else if (Event.ControlId == "QuadIconSounds") {
if (TachometerSoundStatus == True) {
QuadIconSounds.ModulateColor = TextLib::ToColor("FFFFFF");
}
else {
QuadIconSounds.ModulateColor = TextLib::ToColor("FF0000");
}
}
else if (Event.ControlId == "LabelVelocityUnit") {
LabelVelocityUnit.TextColor = TextLib::ToColor("FFFFFF");
LabelVelocityUnit.Opacity = 0.65;
}
}
case CMlEvent::Type::MouseClick : {
if (Event.ControlId == "QuadIconStatistics") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 0, 1.0);
if (TachometerStatisticsStatus == True) {
TachometerStatisticsStatus = False;
QuadIconStatistics.ModulateColor = TextLib::ToColor("00AA00");
}
else {
TachometerStatisticsStatus = True;
QuadIconStatistics.ModulateColor = TextLib::ToColor("FFFFFF");
}
}
else if (Event.ControlId == "QuadIconSounds") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 0, 1.0);
if (TachometerSoundStatus == True) {
SoundGearShift.Stop();
SoundDriveBackward.Stop();
TachometerSoundStatus = False;
QuadIconSounds.ModulateColor = TextLib::ToColor("FF0000");
}
else {
TachometerSoundStatus = True;
QuadIconSounds.ModulateColor = TextLib::ToColor("FFFFFF");
}
}
else if (Event.ControlId == "LabelVelocityUnit") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 0, 1.0);
TachometerCurrentVelocityUnit += 1;
if (TachometerCurrentVelocityUnit > (VelocityUnits.count - 1)) {
TachometerCurrentVelocityUnit = 0;
}
LabelVelocityUnit.Value = VelocityUnits[TachometerCurrentVelocityUnit];
}
else if (Event.ControlId == "QuadTachoscale") {
Audio.PlaySoundEvent(CAudioManager::ELibSound::Valid, 0, 1.0);
TachometerCurrentModulateColor += 1;
if (TachometerCurrentModulateColor > (ModulateColors.count - 1)) {
TachometerCurrentModulateColor = 0;
}
QuadTachoscale.ModulateColor = TextLib::ToColor(ModulateColors[TachometerCurrentModulateColor]);
}
}
}
}
// Change visibility for the Statistics
FrameSpeedStatistic.Visible = TachometerStatisticsStatus;
}
}
Code: Select all
>Dedicated: ManiaPlanet/3.3.0 build 2017-08-02_17_02, using Method-API 2013-04-16, ModeScript-API 2.1.1
> MatchSettings: matchsettings_f1.txt
> Ports: Connections 2352, P2P 3452, XmlRpc 5002
> Network: Send 0 KB, Receive 0 KB
> Uptime: 7 hours 12 minutes 27 seconds
> -----------------------------------------------------------------------------------
> UASECO: Version 0.9.5 build 2017-06-08, running on 127.0.0.1:5002,
> based upon the work of the authors and projects of:
> - Xymph (XAseco2),
> - Florian Schnell, AssemblerManiac and many others (ASECO),
> - Kremsy (MPASECO)
> Author: undef.de (UASECO)
> Website: https://www.UASECO.org