Decompiled source of FusionBitsGiver v1.0.1

FusionBitGiver.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using FusionBitGiver;
using LabFusion.SDK.Points;
using MelonLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "Fusion Bit Giver", "1.0.0", "zeris", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("FusionBitGiver")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FusionBitGiver")]
[assembly: AssemblyTitle("FusionBitGiver")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FusionBitGiver;

public class Main : MelonMod
{
	private const int BitsToGive = 100000000;

	private const int MaxGives = 10;

	private const float Cooldown = 1f;

	private float _timer = 0f;

	private int _giveCount = 0;

	private bool _started = false;

	public override void OnInitializeMelon()
	{
		MelonLogger.Msg("Fusion Bit Giver loaded. Bits will be given in a few seconds...");
		_timer = 3f;
	}

	public override void OnUpdate()
	{
		if (_giveCount < 10)
		{
			_timer += Time.deltaTime;
			if (_timer >= (_started ? 1f : 3f))
			{
				_started = true;
				_timer = 0f;
				GiveBits();
				_giveCount++;
				MelonLogger.Msg($"Bit give {_giveCount}/{10} complete.");
			}
		}
	}

	private void GiveBits()
	{
		try
		{
			PointItemManager.RewardBits(100000000, true);
			MelonLogger.Msg($"Successfully gave {100000000:N0} bits!");
			MelonLogger.Msg($"Current total: {PointItemManager.GetBitCount():N0}");
		}
		catch (Exception value)
		{
			MelonLogger.Error($"Failed to give bits: {value}");
		}
	}
}