using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Net.Sockets; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using Il2Cpp; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppPhoton.Pun; using Il2CppRUMBLE.Combat.ShiftStones; using Il2CppRUMBLE.Managers; using Il2CppRUMBLE.MoveSystem; using Il2CppRUMBLE.Players; using Il2CppRUMBLE.Pools; using Il2CppRUMBLE.Utilities; using Il2CppSystem.Collections.Generic; using Il2CppTMPro; using MelonLoader; using RumbleModUI; using RumbleModdingAPI.RMAPI; using TwitchChatInGame; using TwitchTools; using UnityEngine; using UnityEngine.UI; [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), "TwitchChatInGame", "1.3.3", "UlvakSkillz", null)] [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")] [assembly: MelonColor(255, 195, 0, 255)] [assembly: MelonAuthorColor(255, 195, 0, 255)] [assembly: VerifyLoaderVersion(0, 7, 0, true)] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("TwitchChatInGame")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6d46cef5628624582e816efbc40c62bdc3802da5")] [assembly: AssemblyProduct("TwitchChatInGame")] [assembly: AssemblyTitle("TwitchChatInGame")] [assembly: AssemblyVersion("1.0.0.0")] namespace TwitchTools { public class TwitchChatHandle : IDisposable { private bool exit = false; private string channel; private string read; private TcpClient tcpClient; private StreamReader inputStream; private StreamWriter outputStream; private Thread pingThread; public TwitchChatHandle(string oauth, string channel) { this.channel = channel; tcpClient = new TcpClient("irc.twitch.tv", 6667); inputStream = new StreamReader(tcpClient.GetStream()); outputStream = new StreamWriter(tcpClient.GetStream()); outputStream.WriteLine("PASS " + oauth); outputStream.WriteLine("NICK bot"); outputStream.WriteLine("USER bot 8 * :bot"); outputStream.WriteLine("JOIN #" + channel); outputStream.Flush(); pingThread = new Thread((ThreadStart)delegate { AutoPing(); }); pingThread.Start(); } public TwitchChatEntry Read() { while (true) { if (exit) { return null; } read = TcpRead(); if (read == null) { Thread.Sleep(100); } else if (read.Contains("PRIVMSG")) { break; } } int num = read.IndexOf(":") + 1; int num2 = read.IndexOf("!"); int num3 = num2 - num; if (num3 < 1) { return null; } string sender = read.Substring(num, num3); num = read.IndexOf(":", 1) + 1; string message = read.Substring(num); return new TwitchChatEntry(sender, message); } public bool Write(string chatMessage) { return TcpWrite(":bot!bot@bot.tmi.twitch.tv PRIVMSG #" + channel + " :" + chatMessage); } private string TcpRead() { try { return inputStream.ReadLine(); } catch { return null; } } private bool TcpWrite(string text) { try { outputStream.WriteLine(text); outputStream.Flush(); return true; } catch { return false; } } private void AutoPing() { while (!exit) { if (!TcpWrite("PING irc.twitch.tv")) { Thread.Sleep(100); continue; } int num; for (num = 0; num < 300; num++) { if (exit) { return; } Thread.Sleep(1000); num++; } } } public void Dispose() { exit = true; pingThread.Join(); inputStream.Dispose(); outputStream.Dispose(); tcpClient.Dispose(); } } public class TwitchChatEntry { public readonly string Sender; public readonly string Message; public TwitchChatEntry(string sender, string message) { Sender = sender; Message = message; } } } namespace TwitchChatInGame { public static class BuildInfo { public const string ModName = "TwitchChatInGame"; public const string ModVersion = "1.3.3"; public const string Author = "UlvakSkillz"; } public class ChatCommand { public string[] commands; private Func functionToRun; public bool commandRan = false; public bool running = true; public ChatCommand(string[] newCommands, Func newFunctionToRun) { commands = newCommands; functionToRun = newFunctionToRun; } public void RunCheck() { if (!running) { return; } string[] array = commands; foreach (string value in array) { if (Main.chatEntries[0].Message.ToLower().Contains(value)) { try { functionToRun(); } catch { } commandRan = true; break; } } } } public class Main : MelonMod { [RegisterTypeInIl2Cpp] public class HandChecker : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HandChecker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 1; return true; case 1: <>1__state = -1; try { if (!toggling && <>4__this.handTouching) { MelonCoroutines.Start(ToggleChat(!activeScreen.active)); } } catch { } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private bool onLeft; private bool handTouching = false; public HandChecker() { try { onLeft = ((((Object)((Component)this).transform.parent).name == "Bone_HandAlpha_L") ? true : false); } catch { Object.Destroy((Object)(object)this); } } private void OnTriggerEnter(Collider other) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Invalid comparison between Unknown and I4 try { if (handTouching || toggling || !showScreen || (Object)(object)activeScreen == (Object)null || (onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_R") || (!onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_L") || (int)((Component)((Component)other).transform.parent.parent.parent.parent.parent.parent.parent.parent.parent).GetComponent().controllerType != 1) { return; } } catch { return; } if (tapToSwitch && toggleableChat && !activeScreen.active && ((onLeft && whereToPinChat == 2) || (!onLeft && whereToPinChat == 1))) { whereToPinChat = (onLeft ? 1 : 2); TwitchChatInGame.Settings[1].Value = whereToPinChat; TwitchChatInGame.Settings[1].SavedValue = whereToPinChat; SetActiveScreenTransform(); MelonCoroutines.Start(ToggleChat(active: true)); } else if (toggleableChat && ((whereToPinChat == 1 && ((Object)((Component)other).gameObject).name == "Bone_HandAlpha_R") || (whereToPinChat == 2 && ((Object)((Component)other).gameObject).name == "Bone_HandAlpha_L"))) { handTouching = true; MelonCoroutines.Start(waitForHoldPress()); } } [IteratorStateMachine(typeof(d__4))] private IEnumerator waitForHoldPress() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } private void OnTriggerExit(Collider other) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 try { if ((onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_R") || (!onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_L") || (int)((Component)((Component)other).transform.parent.parent.parent.parent.parent.parent.parent.parent.parent).GetComponent().controllerType != 1) { return; } } catch { return; } handTouching = false; } } [CompilerGenerated] private sealed class <>c__DisplayClass75_0 { public TwitchChatEntry chatEntry; public bool chatRead; internal void b__0() { chatEntry = chat.Read(); chatEntries.Add(chatEntry); chatRead = true; } } [CompilerGenerated] private sealed class d__71 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private WaitForFixedUpdate <>2__current; private Transform 5__1; private GameObject[] 5__2; WaitForFixedUpdate IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__71(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; activeScreen = Object.Instantiate(screen); <>2__current = new WaitForFixedUpdate(); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = activeScreen.transform.GetChild(1); 5__1.localPosition = new Vector3(215f, -380f, 0f); chatTMP = ((Component)5__1).GetComponent(); rawImage = ((Component)activeScreen.transform.GetChild(0)).GetComponent(); SetActiveScreenTransform(); activeScreen.SetActive(lastKnownScreenActiveState); 5__2 = (GameObject[])(object)new GameObject[2]; 5__2[0] = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)5__2[0]).name = "TwitchChatToggle"; 5__2[0].layer = 22; Object.DestroyImmediate((Object)(object)5__2[0].GetComponent()); ((Collider)5__2[0].GetComponent()).isTrigger = true; 5__2[0].transform.parent = Singleton.instance.localPlayer.Controller.PlayerScaling.rigDefinition.LeftHandDefinition.Transform; 5__2[0].transform.localPosition = new Vector3(0.03f, 0f, 0f); 5__2[0].transform.localRotation = Quaternion.Euler(0f, 0f, 0f); 5__2[0].transform.localScale = new Vector3(0.075f, 0.075f, 0.075f); 5__2[0].AddComponent(); 5__2[1] = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)5__2[1]).name = "TwitchChatToggle"; 5__2[1].layer = 22; Object.DestroyImmediate((Object)(object)5__2[1].GetComponent()); ((Collider)5__2[1].GetComponent()).isTrigger = true; 5__2[1].transform.parent = Singleton.instance.localPlayer.Controller.PlayerScaling.rigDefinition.RightHandDefinition.Transform; 5__2[1].transform.localPosition = new Vector3(-0.03f, 0f, 0f); 5__2[1].transform.localRotation = Quaternion.Euler(0f, 0f, 0f); 5__2[1].transform.localScale = new Vector3(0.075f, 0.075f, 0.075f); 5__2[1].AddComponent(); MelonCoroutines.Start(ScreenFade()); MelonCoroutines.Start(MoveScreenIfNeeded()); UpdateChatLog(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__72 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Transform 5__1; private int 5__2; private float 5__3; private int 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__72(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = null; goto IL_008e; case 1: <>1__state = -1; goto IL_008e; case 2: { <>1__state = -1; break; } IL_008e: while ((Object)(object)5__1 == (Object)null) { try { 5__1 = ((Component)Singleton.instance.localPlayer.Controller.PlayerCamera).transform; } catch { } if ((Object)(object)5__1 == (Object)null) { <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; } } CreateScreenSpots(); break; } if ((Object)(object)activeScreen != (Object)null && whereToPinChat == 0) { try { if (showScreen) { activeScreen.SetActive(true); UpdateChatLog(); } 5__2 = -1; 5__3 = 1000f; 5__4 = 0; while (5__4 < screenSpots.Count) { 5__5 = Vector3.Distance(((Component)5__1).transform.position, screenSpots[5__4].transform.position); if (5__5 < 5__3) { 5__2 = 5__4; 5__3 = 5__5; } 5__4++; } if (screenSpots.Count > 0 && (Object)(object)((Component)activeScreen.transform.parent).gameObject != (Object)(object)screenSpots[5__2]) { activeScreen.transform.parent = screenSpots[5__2].transform; activeScreen.transform.localPosition = (overrideChatPosition ? overridePosition : Vector3.zero); activeScreen.transform.localRotation = (overrideChatRotation ? overrideRotation : Quaternion.identity); activeScreen.transform.localScale = (Vector3)(overrideChatScale ? overrideScale : new Vector3(0.005f, 0.005f, 0.005f)); } } catch { } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__69 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private bool 5__1; private List.Enumerator <>s__2; private string 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__69(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__2 = default(List.Enumerator); 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Log("Starting Process Chat"); break; case 1: <>1__state = -1; break; } while (fileFound) { if (chatEntries.Count > 0) { try { if (!(chatEntries[0].Sender == "")) { } } catch { chatEntries.RemoveAt(0); continue; } Log(chatEntries[0].Sender + ": " + chatEntries[0].Message); 5__1 = true; if (blacklistedNames.Contains(chatEntries[0].Sender.ToLower())) { 5__1 = false; } else { <>s__2 = blacklistedWords.GetEnumerator(); try { while (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if (chatEntries[0].Message.ToLower().Contains(5__3)) { 5__1 = false; break; } 5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } <>s__2 = default(List.Enumerator); } if (5__1) { CheckCommands(); UpdateChatLog(addMsgToLog: true); } chatEntries.RemoveAt(0); continue; } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__75 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; private <>c__DisplayClass75_0 <>8__1; private Thread 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__75(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; goto IL_00a3; } <>1__state = -1; Log("Starting Listening to Chat"); goto IL_00c4; IL_00a3: if (!<>8__1.chatRead) { <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; } <>8__1 = null; 5__2 = null; goto IL_00c4; IL_00c4: if (fileFound) { <>8__1 = new <>c__DisplayClass75_0(); <>8__1.chatEntry = null; <>8__1.chatRead = false; 5__2 = new Thread((ThreadStart)delegate { <>8__1.chatEntry = chat.Read(); chatEntries.Add(<>8__1.chatEntry); <>8__1.chatRead = true; }); 5__2.Start(); goto IL_00a3; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__64 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__64(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; MelonCoroutines.Stop(<>4__this.processEntriesCoroutine); MelonCoroutines.Stop(<>4__this.readEntriesCoroutine); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; chat.Dispose(); <>4__this.TwitchFileCheck(); if (fileFound) { while (chatEntries.Count > 0) { chatEntries.RemoveAt(0); } Log("Restarting Twitch Bot"); <>4__this.readEntriesCoroutine = MelonCoroutines.Start(<>4__this.ReadEntries()); <>4__this.processEntriesCoroutine = MelonCoroutines.Start(ProcessEntries()); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__74 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Transform 5__1; private Vector3 5__2; private Vector3 5__3; private float 5__4; private float 5__5; private float 5__6; private float 5__7; private Vector3 5__8; private Vector3 5__9; private float 5__10; private float 5__11; private float 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__74(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = ((Component)Singleton.instance.localPlayer.Controller.PlayerCamera).transform; break; case 1: <>1__state = -1; if ((Object)(object)activeScreen == (Object)null || (Object)(object)5__1 == (Object)null) { return false; } break; } if ((Object)(object)activeScreen != (Object)null && (Object)(object)5__1 != (Object)null) { try { Vector3 val = 5__1.forward; 5__2 = ((Vector3)(ref val)).normalized; val = activeScreen.transform.position - 5__1.position; 5__3 = ((Vector3)(ref val)).normalized; 5__4 = Vector3.Dot(5__2, 5__3); 5__5 = Mathf.Acos(5__4) * Mathf.Rad2Deg; 5__6 = 0f; if (5__5 <= 20f) { 5__6 = 1f; } else if (5__5 >= 45f) { 5__6 = 0f; } else { 5__6 = 1.8f - 0.04f * 5__5; } 5__7 = -1f; if ((Object)(object)activeScreen.transform.parent == (Object)null) { 5__7 = -1f; } else if (((Object)activeScreen.transform.parent).name == "Bone_HandAlpha_L") { 5__7 = -1f; } else if (((Object)activeScreen.transform.parent).name == "Bone_HandAlpha_R") { 5__7 = 1f; } val = activeScreen.transform.forward * 5__7; 5__8 = ((Vector3)(ref val)).normalized; val = ((Component)5__1).transform.position - activeScreen.transform.position; 5__9 = ((Vector3)(ref val)).normalized; 5__10 = Vector3.Dot(5__8, 5__9); 5__11 = Mathf.Acos(5__10) * Mathf.Rad2Deg; if (5__11 >= 90f) { 5__6 = 0f; } else if (5__11 > 60f) { 5__12 = 3f - 1f / 30f * 5__11; if (5__6 > 5__12) { 5__6 = 5__12; } } ((Graphic)rawImage).color = new Color(((Graphic)rawImage).color.r, ((Graphic)rawImage).color.g, ((Graphic)rawImage).color.b, 5__6); ((Graphic)chatTMP).color = new Color(((Graphic)chatTMP).color.r, ((Graphic)chatTMP).color.g, ((Graphic)chatTMP).color.b, 5__6); } catch { return false; } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__58 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__58(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Time.timeScale = 0.5f; <>2__current = (object)new WaitForSecondsRealtime(5f); <>1__state = 1; return true; case 1: <>1__state = -1; Time.timeScale = 1f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__59 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; private Transform 5__1; private List 5__2; private List 5__3; private int 5__4; private int 5__5; private float 5__6; private int 5__7; private float 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__59(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; SpawnStruct("!ball", "SpawnBall"); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = ((Component)Singleton.instance.localPlayer.Controller).transform.GetChild(2).GetChild(0).GetChild(0); 5__2 = ((Il2CppArrayBase>)(object)Singleton.instance.availablePools)[Singleton.instance.GetPoolIndex("Ball")].PooledObjects; 5__3 = new List(); 5__4 = 0; while (5__4 < 5__2.Count) { if (((Component)((Component)5__2[5__4]).transform).gameObject.active) { 5__3.Add(5__2[5__4]); } 5__4++; } if (5__3.Count > 0) { 5__5 = -1; 5__6 = 100f; 5__7 = 0; while (5__7 < 5__3.Count) { 5__8 = Vector2.Distance(new Vector2(((Component)5__3[5__7]).transform.position.x, ((Component)5__3[5__7]).transform.position.z), new Vector2(((Component)5__1).transform.position.x, ((Component)5__1).transform.position.z)); if (5__8 < 5__6) { 5__5 = 5__7; 5__6 = 5__8; } 5__7++; } ((Component)5__3[5__5]).gameObject.GetComponent().AddForce((5__1.position - ((Component)5__3[5__5]).gameObject.transform.position) * 15f, (ForceMode)2); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__56 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool active; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__56(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; toggling = true; originalScale = activeScreen.transform.localScale; if (active) { activeScreen.transform.localScale = Vector3.zero; } activeScreen.SetActive(true); UpdateChatLog(); 5__1 = 0; break; case 1: <>1__state = -1; 5__1++; break; } if (5__1 < 40) { try { if (active) { Transform transform = activeScreen.transform; transform.localScale += originalScale / 40f; } else { Transform transform2 = activeScreen.transform; transform2.localScale -= originalScale / 40f; } } catch { goto IL_012a; } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; } goto IL_012a; IL_012a: try { activeScreen.SetActive(active); lastKnownScreenActiveState = active; activeScreen.transform.localScale = originalScale; } catch { } toggling = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static string currentScene = "Loader"; private static string FILEPATH = "UserData\\TwitchChatInGame"; private static string FILENAME = "ConnectionInfo.txt"; private static string OVERRIDEFILENAME = "PositionOverride.txt"; private static string RESPONSESFILENAME = "Responses.txt"; private static string BLACKLISTEDNAMESFILENAME = "BlackListedNames.txt"; private static string BLACKLISTEDWORDSFILENAME = "BlackListedWords.txt"; private static List blacklistedNames = new List(); private static List blacklistedWords = new List(); private static string[] responsesFileText; private static string[] connectionInfo; private static TwitchChatHandle chat; public static List chatEntries = new List(); private static bool fileFound = false; private static Mod TwitchChatInGame = new Mod(); private static List commands = new List(); private static GameObject screen; public static GameObject activeScreen; private static TextMeshProUGUI chatTMP; private static RawImage rawImage; private static bool showScreen = true; private static int whereToPinChat = 0; private static Vector3 overridePosition; private static Vector3 overrideScale; private static Quaternion overrideRotation; private static bool overrideChatPosition = false; private static bool overrideChatRotation = false; private static bool overrideChatScale = false; private static bool toggleableChat = true; private static bool tapToSwitch = true; private static bool chatResponses = true; private static bool blockChatCommands = false; private static float spawningCooldownTime = 3f; private static string chatBackgroundColor = "FFFFFF"; private static string chatTextColor = "000000"; private static DateTime lastBall = DateTime.Now; private static DateTime lastPillar = DateTime.Now; private static DateTime lastCube = DateTime.Now; private static DateTime lastWall = DateTime.Now; private static DateTime lastSlow = DateTime.Now; private static DateTime lasttoggleChat = DateTime.Now; private static List chatLog = new List(); private static bool lastKnownScreenActiveState = false; private static bool toggling = false; private static Vector3 originalScale; private static List screenSpots = new List(); private static GameObject screenSpotsParent; private object processEntriesCoroutine; private object readEntriesCoroutine; private bool gymInit = false; public override void OnLateInitializeMelon() { TwitchChatInGame.ModName = "TwitchChatInGame"; TwitchChatInGame.ModVersion = "1.3.3"; TwitchChatInGame.SetFolder("TwitchChatInGame"); TwitchChatInGame.ModSaved += Save; UI.instance.UI_Initialized += UIInit; FileInitialization(); ModInitialization(); Actions.onMapInitialized += MapInit; } private void MapInit(string map) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) Time.timeScale = 1f; currentScene = map; if (map == "Gym" && !gymInit) { GameObject val = Object.Instantiate(MountainRank.GetGameObject()); val.SetActive(true); ((Object)val).name = "chat"; val.transform.parent = screen.transform; val.transform.localScale = Vector3.one; TextMeshProUGUI component = val.GetComponent(); ((TMP_Text)component).text = ""; ((TMP_Text)component).alignment = (TextAlignmentOptions)257; ((TMP_Text)component).enableAutoSizing = true; ((TMP_Text)component).fontSize = 72f; ((TMP_Text)component).fontSizeMax = 72f; ((TMP_Text)component).fontSizeMin = 18f; ((TMP_Text)component).enableWordWrapping = true; val.GetComponent().anchoredPosition = new Vector2(0f, -25f); val.GetComponent().sizeDelta = new Vector2(450f, 750f); val.transform.localPosition = new Vector3(225f, -400f, 0f); gymInit = true; } MelonCoroutines.Start((IEnumerator)CreateScreen()); } private void ModInitialization() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Expected O, but got Unknown TwitchChatInGame.AddToList("Show Chat", true, 0, "Toggles ChatBox On/Off", new Tags()); TwitchChatInGame.AddToList("Where To Pin Chat", 1, $"0: Environment{Environment.NewLine}1: Left Hand{Environment.NewLine}2: Right Hand", new Tags()); TwitchChatInGame.AddToList("Chat Position Override", false, 0, "Toggles using the Chatbox Position Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags()); TwitchChatInGame.AddToList("Chat Rotation Override", false, 0, "Toggles using the Chatbox Rotation Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags()); TwitchChatInGame.AddToList("Chat Scale Override", false, 0, "Toggles using the Chatbox Scale Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags()); TwitchChatInGame.AddToList("Chat Tap To Toggle", true, 0, "Toggles the Chatbox On/Off by Tapping the Back of the Wrist of the Hand that Chat is On", new Tags()); TwitchChatInGame.AddToList("Chat Tap To Switch", true, 0, "Toggles the Changing of what Hand the Chatbox is on by Tapping the Back of any Wrist while the Chatbox is Toggled OFF (From Setting Above this One)", new Tags()); TwitchChatInGame.AddToList("Chat Background Color", "FFFFFF", "Sets The Background Color to the Supplied Color", new Tags()); TwitchChatInGame.AddToList("Chat Text Color", "000000", "Sets The Text Color to the Supplied Color", new Tags()); TwitchChatInGame.AddToList("Chat Response Messages", true, 0, "Toggles The Bot Responding to Messages", new Tags()); TwitchChatInGame.AddToList("Block All Commands", false, 0, "Blocks all of the Chat Commands without needing to Toggle Each one Off", new Tags()); TwitchChatInGame.AddToList("Summon Commands CD", 3f, "Sets the Cooldown Time for !ball !pillar !cube !wall", new Tags()); TwitchChatInGame.AddToList("Reconnect Twitch", false, 0, "Reconnects to Twitch (For Settings Setup or Bot Timeout)", new Tags { DoNotSave = true }); commands.Add(new ChatCommand(new string[1] { "!commands" }, delegate { string text6 = responsesFileText[0]; string text7 = ""; bool flag = true; for (int l = 1; l < commands.Count; l++) { for (int m = 0; m < commands[l].commands.Length; m++) { if (commands[l].running) { if (!flag) { text7 += ", "; } else { flag = false; } text7 += commands[l].commands[m]; } } } text6 = text6.Replace("{commands}", text7); Write(text6, overrideResponses: true); return null; })); commands.Add(new ChatCommand(new string[1] { "!aniyogev" }, delegate { Write(responsesFileText[1]); return null; })); commands.Add(new ChatCommand(new string[1] { "!shiftstones" }, delegate { string text4 = responsesFileText[2]; string text5 = ""; PlayerShiftstoneSystem playerShiftstones = Singleton.instance.localPlayer.Controller.PlayerShiftstones; string[] array3 = new string[2]; try { array3[0] = ((Il2CppArrayBase)(object)playerShiftstones.shiftStoneSockets)[0].assignedShifstone.StoneName; } catch { } try { array3[1] = ((Il2CppArrayBase)(object)playerShiftstones.shiftStoneSockets)[1].assignedShifstone.StoneName; } catch { } if (array3[0] != null) { text5 += array3[0]; } if (array3[1] != null) { text5 = text5 + " and " + array3[1]; } if (array3[0] == null && array3[1] == null) { text5 += "No Shiftstones"; } text4 = text4.Replace("{shiftstones}", text5); Write(text4); return null; })); commands.Add(new ChatCommand(new string[1] { "!bp" }, delegate { int battlePoints2 = Singleton.instance.localPlayer.Data.GeneralData.BattlePoints; string msg5 = responsesFileText[3].Replace("{bp}", battlePoints2.ToString()); Write(msg5); return null; })); commands.Add(new ChatCommand(new string[1] { "!region" }, delegate { string fixedRegion = Singleton.instance.networkConfig.FixedRegion; List list2 = new List { "asia", "au", "cae", "eu", "in", "jp", "ru", "rue", "za", "sa", "kr", "us", "usw" }; string[] array2 = new string[13] { "Asia", "Australia", "Canada", "Europe", "India", "Japan", "Russia", "Russia, East", "South Africa", "South America", "South Korea", "USA, East", "USA, West" }; string msg4 = responsesFileText[4].Replace("{region}", array2[list2.IndexOf(fixedRegion)]); Write(msg4); return null; })); commands.Add(new ChatCommand(new string[2] { "!opponent", "!opponents" }, delegate { if (Singleton.instance.AllPlayers.Count > 1 && (currentScene == "Map0" || currentScene == "Map1")) { string publicUsername = Singleton.instance.AllPlayers[1].Data.GeneralData.PublicUsername; int battlePoints = Singleton.instance.AllPlayers[1].Data.GeneralData.BattlePoints; string msg3 = responsesFileText[5].Replace("{otherplayer}", publicUsername).Replace("{otherbp}", battlePoints.ToString()); Write(msg3); } else { Write("@" + chatEntries[0].Sender + ", I am currently not fighting anyone."); } return null; })); commands.Add(new ChatCommand(new string[2] { "!hp", "!hps" }, delegate { string[] array = responsesFileText[6].Split("|"); string text3 = array[0].Replace("{hp}", Singleton.instance.localPlayer.Data.HealthPoints.ToString()); for (int k = 1; k < Singleton.instance.AllPlayers.Count; k++) { Player val = Singleton.instance.AllPlayers[k]; text3 += array[1].Replace("{otherplayer}", Singleton.instance.AllPlayers[k].Data.GeneralData.PublicUsername).Replace("{otherhp}", Singleton.instance.AllPlayers[k].Data.HealthPoints.ToString()); } Write(text3); return null; })); commands.Add(new ChatCommand(new string[1] { "!mods" }, delegate { string text = responsesFileText[7]; List list = new List(); string text2 = ""; for (int j = 0; j < Mods.getMyMods().Count; j++) { if (j != 0) { text2 += ", "; } if (j == Mods.getMyMods().Count - 1) { text2 += " and "; } text2 += Mods.getMyMods()[j].ModName; } Write(text.Replace("{mods}", text2)); return null; })); commands.Add(new ChatCommand(new string[1] { "!ball" }, delegate { if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient)) { MelonCoroutines.Start(ThrowBall()); } else { Write("@" + chatEntries[0].Sender + ", use !ball only inside the Gym!"); } return null; })); commands.Add(new ChatCommand(new string[1] { "!pillar" }, delegate { SpawnStruct("!pillar", "SpawnPillar"); return null; })); commands.Add(new ChatCommand(new string[1] { "!cube" }, delegate { SpawnStruct("!cube", "SpawnCube"); return null; })); commands.Add(new ChatCommand(new string[1] { "!wall" }, delegate { SpawnStruct("!wall", "SpawnWall"); return null; })); commands.Add(new ChatCommand(new string[1] { "!slow" }, delegate { if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient)) { if ((DateTime.Now - lastSlow).TotalSeconds > 5.0) { lastSlow = DateTime.Now; MelonCoroutines.Start(SlowDownTime()); string msg2 = responsesFileText[12]; Write(msg2); } } else { Write("@" + chatEntries[0].Sender + ", use !slow only inside the Gym!"); } return null; })); commands.Add(new ChatCommand(new string[1] { "!togglechat" }, delegate { if (!toggling && whereToPinChat != 0 && (DateTime.Now - lasttoggleChat).TotalSeconds > 5.0) { lasttoggleChat = DateTime.Now; MelonCoroutines.Start(ToggleChat(!activeScreen.active)); string msg = responsesFileText[13]; Write(msg); } return null; })); for (int i = 0; i < commands.Count; i++) { TwitchChatInGame.AddToList(commands[i].commands[0], true, 0, "Toggles On/Off " + commands[i].commands[0] + " Command", new Tags()); } TwitchChatInGame.GetFromFile(); Save(); screen = Object.Instantiate(AssetBundles.LoadAssetFromStream((MelonMod)(object)this, "TwitchChatInGame.twitchchat", "Canvas")); ((Object)screen).name = "TwitchScreen"; screen.SetActive(false); Object.DontDestroyOnLoad((Object)(object)screen); if (fileFound) { Log("Starting Twitch Bot"); readEntriesCoroutine = MelonCoroutines.Start(ReadEntries()); processEntriesCoroutine = MelonCoroutines.Start(ProcessEntries()); } } private void FileInitialization() { //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) if (!Directory.Exists(FILEPATH)) { Directory.CreateDirectory(FILEPATH); } blacklistedNames.Clear(); if (!File.Exists(FILEPATH + "\\" + BLACKLISTEDNAMESFILENAME)) { saveFile("", FILEPATH + "\\" + BLACKLISTEDNAMESFILENAME); } string[] array = ReadFileText(FILEPATH, BLACKLISTEDNAMESFILENAME); string[] array2 = array; foreach (string text in array2) { blacklistedNames.Add(text.ToLower()); } blacklistedWords.Clear(); if (!File.Exists(FILEPATH + "\\" + BLACKLISTEDWORDSFILENAME)) { saveFile("", FILEPATH + "\\" + BLACKLISTEDWORDSFILENAME); } string[] array3 = ReadFileText(FILEPATH, BLACKLISTEDWORDSFILENAME); string[] array4 = array3; foreach (string text2 in array4) { blacklistedWords.Add(text2.ToLower()); } if (!File.Exists(FILEPATH + "\\" + RESPONSESFILENAME)) { string textToSave = "!commands|@{sender}, The Commands are: {commands}." + Environment.NewLine + "!aniyogev|@{sender}, I too wish AniYogev was here!" + Environment.NewLine + "!shiftstones|@{sender}, I am currently wearing {shiftstones}." + Environment.NewLine + "!bp|@{sender}, I currently have {bp} BP." + Environment.NewLine + "!region|@{sender}, I am Currently in {region}." + Environment.NewLine + "!opponent|@{sender}, I am currently fighting {otherplayer}, they have {otherbp} BP." + Environment.NewLine + "!hp|@{sender}, I currently have {hp} Health.| {otherplayer} has {otherhp} Health." + Environment.NewLine + "!mods|@{sender}, my Mods are: {mods}." + Environment.NewLine + "!ball|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!pillar|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!cube|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!wall|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!slow|@{sender} activated Slow Mo Time!" + Environment.NewLine + "!togglechat|@{sender}, are you trying to be Sneaky?"; saveFile(textToSave, FILEPATH + "\\" + RESPONSESFILENAME); fileFound = false; } responsesFileText = ReadFileText(FILEPATH, RESPONSESFILENAME); for (int k = 0; k < responsesFileText.Length; k++) { string[] array5 = responsesFileText[k].Split("|"); responsesFileText[k] = array5[1]; if (array5.Length > 2) { ref string reference = ref responsesFileText[k]; reference = reference + "|" + array5[2]; } } if (!File.Exists(FILEPATH + "\\" + OVERRIDEFILENAME)) { string textToSave2 = $"0 0 0{Environment.NewLine}0 0 0{Environment.NewLine}0.075 0.075 0.075{Environment.NewLine}{Environment.NewLine}--------------------------------------------------{Environment.NewLine}Line 1, Position (x y z){Environment.NewLine}Line 2, Rotation (x y z){Environment.NewLine}Line 3, Scale (x y z){Environment.NewLine}Put Spaces Between Each Number{Environment.NewLine}Save to Update Override while Game is open"; saveFile(textToSave2, FILEPATH + "\\" + OVERRIDEFILENAME); fileFound = false; } try { string[] array6 = ReadFileText(FILEPATH, OVERRIDEFILENAME); string[] array7 = (array6[0] + " " + array6[1] + " " + array6[2]).Split(" "); overridePosition = new Vector3(float.Parse(array7[0], CultureInfo.InvariantCulture), float.Parse(array7[1], CultureInfo.InvariantCulture), float.Parse(array7[2], CultureInfo.InvariantCulture)); overrideRotation = Quaternion.Euler(float.Parse(array7[3], CultureInfo.InvariantCulture), float.Parse(array7[4], CultureInfo.InvariantCulture), float.Parse(array7[5], CultureInfo.InvariantCulture)); overrideScale = new Vector3(float.Parse(array7[6], CultureInfo.InvariantCulture), float.Parse(array7[7], CultureInfo.InvariantCulture), float.Parse(array7[8], CultureInfo.InvariantCulture)); } catch { overridePosition = Vector3.zero; overrideRotation = Quaternion.identity; overrideScale = Vector3.one; } TwitchFileCheck(); if (!fileFound) { Log("File Info Not Set: " + $"{FILEPATH}\\{FILENAME}{Environment.NewLine}Please open File and edit to your info!"); } } private void TwitchFileCheck() { if (!File.Exists(FILEPATH + "\\" + FILENAME)) { string textToSave = "oauth:InsertOauthTokenHere" + Environment.NewLine + "ReplaceWithChannelName" + Environment.NewLine + Environment.NewLine + "--------------------------------------------------" + Environment.NewLine + "First Line is 'oauth:' followed by your oauth code (no space) (https://twitchtokengenerator.com/)." + Environment.NewLine + "Second Line is your Channel Name so that the bot goes to the correct spot."; saveFile(textToSave, FILEPATH + "\\" + FILENAME); fileFound = false; } connectionInfo = ReadFileText(FILEPATH, FILENAME); if (connectionInfo[0] == "oauth:InsertOauthTokenHere" || connectionInfo[1] == "ReplaceWithChannelName") { fileFound = false; } else { fileFound = true; } chat = new TwitchChatHandle(connectionInfo[0], connectionInfo[1]); } [IteratorStateMachine(typeof(d__56))] private static IEnumerator ToggleChat(bool active) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__56(0) { active = active }; } private static void SpawnStruct(string command, string structureName) { if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient)) { DateTime dateTime = DateTime.Now; string text = ""; switch (command) { case "!ball": text += responsesFileText[8]; dateTime = lastBall.AddSeconds(spawningCooldownTime); break; case "!pillar": text += responsesFileText[9]; dateTime = lastPillar.AddSeconds(spawningCooldownTime); break; case "!cube": text += responsesFileText[10]; dateTime = lastCube.AddSeconds(spawningCooldownTime); break; case "!wall": text += responsesFileText[11]; dateTime = lastWall.AddSeconds(spawningCooldownTime); break; } if (!(dateTime < DateTime.Now)) { return; } switch (command) { case "!ball": lastBall = DateTime.Now; break; case "!pillar": lastPillar = DateTime.Now; break; case "!cube": lastCube = DateTime.Now; break; case "!wall": lastWall = DateTime.Now; break; } PlayerStackProcessor component = ((Component)Singleton.instance.localPlayer.Controller).gameObject.GetComponent(); for (int i = 0; i < component.availableStacks.Count; i++) { if (((Object)component.availableStacks[i]).name == structureName) { component.Execute(component.availableStacks[i], (StackConfiguration)null); structureName = structureName.Replace("SpawnPillar", "Pillar").Replace("SpawnBall", "Ball").Replace("SpawnCube", "Cube") .Replace("SpawnWall", "Wall"); text = text.Replace("{structure}", structureName).Replace("{command}", command); Write(text); break; } } } else { Write($"@{chatEntries[0].Sender}, use {command} only inside the Gym!"); } } [IteratorStateMachine(typeof(d__58))] private IEnumerator SlowDownTime() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__58(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__59))] private IEnumerator ThrowBall() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__59(0) { <>4__this = this }; } private void UIInit() { UI.instance.AddMod(TwitchChatInGame); } private void saveFile(string textToSave, string file) { FileStream fileStream = File.Create(file); byte[] bytes = Encoding.UTF8.GetBytes(textToSave); fileStream.Write(bytes); fileStream.Close(); fileStream.Dispose(); } public static string[] ReadFileText(string filePath, string fileName) { try { return File.ReadAllLines(filePath + "\\" + fileName); } catch (Exception ex) { MelonLogger.Error((object)ex); } return null; } private void Save() { showScreen = (bool)TwitchChatInGame.Settings[0].SavedValue; if (!showScreen && (Object)(object)activeScreen != (Object)null) { activeScreen.SetActive(false); } else { UpdateChatLog(); } int num = whereToPinChat; whereToPinChat = (int)TwitchChatInGame.Settings[1].SavedValue; overrideChatPosition = (bool)TwitchChatInGame.Settings[2].SavedValue; overrideChatRotation = (bool)TwitchChatInGame.Settings[3].SavedValue; overrideChatScale = (bool)TwitchChatInGame.Settings[4].SavedValue; toggleableChat = (bool)TwitchChatInGame.Settings[5].SavedValue; tapToSwitch = (bool)TwitchChatInGame.Settings[6].SavedValue; chatBackgroundColor = (string)TwitchChatInGame.Settings[7].SavedValue; chatTextColor = (string)TwitchChatInGame.Settings[8].SavedValue; chatResponses = (bool)TwitchChatInGame.Settings[9].SavedValue; blockChatCommands = (bool)TwitchChatInGame.Settings[10].SavedValue; spawningCooldownTime = (float)TwitchChatInGame.Settings[11].SavedValue; if ((bool)TwitchChatInGame.Settings[12].SavedValue) { TwitchChatInGame.Settings[12].Value = false; TwitchChatInGame.Settings[12].SavedValue = false; MelonCoroutines.Start(ReconnectBot()); } for (int i = 0; i < commands.Count; i++) { commands[i].running = (bool)TwitchChatInGame.Settings[i + 13].SavedValue; } if (num != whereToPinChat && whereToPinChat == 0) { MelonCoroutines.Start(MoveScreenIfNeeded()); } if (chatBackgroundColor.Length < 6) { Log("Chat Background Color too Short!"); chatBackgroundColor = "FFFFFF"; TwitchChatInGame.Settings[5].SavedValue = "FFFFFF"; TwitchChatInGame.Settings[5].Value = "FFFFFF"; } if (chatTextColor.Length < 6) { Log("Chat Text Color too Short!"); chatBackgroundColor = "000000"; TwitchChatInGame.Settings[6].SavedValue = "000000"; TwitchChatInGame.Settings[6].Value = "000000"; } SetActiveScreenTransform(); LoadOverrideText(); blacklistedNames.Clear(); blacklistedWords.Clear(); string[] array = ReadFileText(FILEPATH, BLACKLISTEDNAMESFILENAME); string[] array2 = array; foreach (string text in array2) { blacklistedNames.Add(text.ToLower()); } string[] array3 = ReadFileText(FILEPATH, BLACKLISTEDWORDSFILENAME); string[] array4 = array3; foreach (string text2 in array4) { blacklistedWords.Add(text2.ToLower()); } } [IteratorStateMachine(typeof(d__64))] private IEnumerator ReconnectBot() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__64(0) { <>4__this = this }; } private void LoadOverrideText() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) string[] array = ReadFileText(FILEPATH, OVERRIDEFILENAME); string[] array2 = (array[0] + " " + array[1] + " " + array[2]).Split(" "); overridePosition = new Vector3(float.Parse(array2[0], CultureInfo.InvariantCulture), float.Parse(array2[1], CultureInfo.InvariantCulture), float.Parse(array2[2], CultureInfo.InvariantCulture)); overrideRotation = Quaternion.Euler(float.Parse(array2[3], CultureInfo.InvariantCulture), float.Parse(array2[4], CultureInfo.InvariantCulture), float.Parse(array2[5], CultureInfo.InvariantCulture)); overrideScale = new Vector3(float.Parse(array2[6], CultureInfo.InvariantCulture), float.Parse(array2[7], CultureInfo.InvariantCulture), float.Parse(array2[8], CultureInfo.InvariantCulture)); } private static void SetActiveScreenTransform() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)activeScreen == (Object)null) { return; } Transform val = null; Vector3 zero = Vector3.zero; Vector3 one = Vector3.one; Quaternion val2 = Quaternion.identity; switch (whereToPinChat) { case 0: try { val = screenSpots[0].transform; if (showScreen) { if (!activeScreen.active) { ToggleChat(active: true); } } else { activeScreen.SetActive(false); } } catch { val = null; } ((Vector3)(ref zero))..ctor(0f, 0f, 0f); val2 = Quaternion.Euler(0f, 0f, 0f); ((Vector3)(ref one))..ctor(0.005f, 0.005f, 0.005f); break; case 1: val = Singleton.instance.localPlayer.Controller.PlayerScaling.rigDefinition.LeftHandDefinition.Transform; ((Vector3)(ref zero))..ctor(0.1f, 0f, 0f); val2 = Quaternion.Euler(0f, 270f, 30f); ((Vector3)(ref one))..ctor(0.0005f, 0.0005f, 0.0005f); break; case 2: val = Singleton.instance.localPlayer.Controller.PlayerScaling.rigDefinition.RightHandDefinition.Transform; ((Vector3)(ref zero))..ctor(-0.1f, 0f, 0f); val2 = Quaternion.Euler(0f, 270f, 30f); ((Vector3)(ref one))..ctor(-0.0005f, 0.0005f, 0.0005f); break; } if ((Object)(object)val != (Object)null) { activeScreen.transform.parent = val; } activeScreen.transform.localPosition = (overrideChatPosition ? overridePosition : zero); activeScreen.transform.localRotation = (overrideChatRotation ? overrideRotation : val2); activeScreen.transform.localScale = (overrideChatScale ? overrideScale : one); string text = ""; for (int i = 0; i < chatLog.Count; i++) { text += chatLog[i]; if (i < chatLog.Count - 1) { text = text + Environment.NewLine + Environment.NewLine; } } ((TMP_Text)chatTMP).text = text; ((Graphic)rawImage).color = hexToColor(chatBackgroundColor); ((Graphic)chatTMP).color = Color.white; ((TMP_Text)chatTMP).faceColor = Color32.op_Implicit(hexToColor(chatTextColor)); } public static Color hexToColor(string hex) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) hex = hex.Replace("0x", ""); hex = hex.Replace("#", ""); byte b = byte.MaxValue; byte b2 = byte.Parse(hex.Substring(0, 2), NumberStyles.HexNumber); byte b3 = byte.Parse(hex.Substring(2, 2), NumberStyles.HexNumber); byte b4 = byte.Parse(hex.Substring(4, 2), NumberStyles.HexNumber); return Color32.op_Implicit(new Color32(b2, b3, b4, b)); } private static void CheckCommands() { if (blockChatCommands) { return; } foreach (ChatCommand command in commands) { command.RunCheck(); if (command.commandRan) { command.commandRan = false; break; } } } [IteratorStateMachine(typeof(d__69))] private static IEnumerator ProcessEntries() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__69(0); } private static void UpdateChatLog(bool addMsgToLog = false) { if (addMsgToLog && chatEntries.Count > 0) { chatLog.Add(chatEntries[0].Sender + ": " + chatEntries[0].Message); while (chatLog.Count > 5) { chatLog.RemoveAt(0); } } if (!((Object)(object)activeScreen != (Object)null)) { return; } string text = ""; for (int i = 0; i < chatLog.Count; i++) { text += chatLog[i]; if (i < chatLog.Count - 1) { text = text + Environment.NewLine + Environment.NewLine; } } ((TMP_Text)chatTMP).text = text; } [IteratorStateMachine(typeof(d__71))] private static IEnumerator CreateScreen() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__71(0); } [IteratorStateMachine(typeof(d__72))] private static IEnumerator MoveScreenIfNeeded() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__72(0); } private static void CreateScreenSpots() { //IL_0a67: Unknown result type (might be due to invalid IL or missing references) //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Expected O, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Expected O, but got Unknown //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Expected O, but got Unknown //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Expected O, but got Unknown //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Expected O, but got Unknown //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Expected O, but got Unknown //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_068d: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0719: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Expected O, but got Unknown //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Expected O, but got Unknown //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Expected O, but got Unknown //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08de: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Expected O, but got Unknown //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Expected O, but got Unknown //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_0a14: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)screenSpotsParent == (Object)null) { screenSpots.Clear(); if (currentScene == "Map0") { screenSpotsParent = new GameObject(); ((Object)screenSpotsParent).name = "TwitchChatBoxSpots"; screenSpotsParent.transform.position = Vector3.zero; screenSpotsParent.transform.rotation = Quaternion.identity; screenSpotsParent.transform.localScale = Vector3.one; GameObject val = new GameObject(); ((Object)val).name = "TwitchChatBoxSpot"; val.transform.parent = screenSpotsParent.transform; val.transform.position = new Vector3(-4.5f, 3.35f, -17.784f); val.transform.rotation = Quaternion.Euler(0f, 195f, 0f); val.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); screenSpots.Add(val); } else if (currentScene == "Map1") { screenSpotsParent = new GameObject(); ((Object)screenSpotsParent).name = "TwitchChatBoxSpots"; screenSpotsParent.transform.position = Vector3.zero; screenSpotsParent.transform.rotation = Quaternion.identity; screenSpotsParent.transform.localScale = Vector3.one; GameObject val2 = new GameObject(); ((Object)val2).name = "TwitchChatBoxSpot"; val2.transform.parent = screenSpotsParent.transform; val2.transform.position = new Vector3(-13.6509f, 5.7582f, -3.2364f); val2.transform.rotation = Quaternion.Euler(0f, 244.3657f, 0f); val2.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); screenSpots.Add(val2); } else if (currentScene == "Gym") { screenSpotsParent = new GameObject(); ((Object)screenSpotsParent).name = "TwitchChatBoxSpots"; screenSpotsParent.transform.position = Vector3.zero; screenSpotsParent.transform.rotation = Quaternion.identity; screenSpotsParent.transform.localScale = Vector3.one; GameObject val3 = new GameObject(); ((Object)val3).name = "TwitchChatBoxSpot"; val3.transform.parent = screenSpotsParent.transform; val3.transform.position = new Vector3(0.031f, 1.5563f, -3.0776f); val3.transform.rotation = Quaternion.Euler(0f, 280.8829f, 0f); val3.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); screenSpots.Add(val3); GameObject val4 = new GameObject(); ((Object)val4).name = "TwitchChatBoxSpot"; val4.transform.parent = screenSpotsParent.transform; val4.transform.position = new Vector3(14.7434f, -1.7628f, -12.3979f); val4.transform.rotation = Quaternion.Euler(0f, 62.4684f, 0f); val4.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); screenSpots.Add(val4); GameObject val5 = new GameObject(); ((Object)val5).name = "TwitchChatBoxSpot"; val5.transform.parent = screenSpotsParent.transform; val5.transform.position = new Vector3(-15.2944f, 0.7143f, 2.0057f); val5.transform.rotation = Quaternion.Euler(0f, 290.1123f, 0f); val5.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); screenSpots.Add(val5); GameObject val6 = new GameObject(); ((Object)val6).name = "TwitchChatBoxSpot"; val6.transform.parent = screenSpotsParent.transform; val6.transform.position = new Vector3(-27.2884f, 4.2261f, 2.7007f); val6.transform.rotation = Quaternion.Euler(0f, 97.1124f, 0f); val6.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); screenSpots.Add(val6); GameObject val7 = new GameObject(); ((Object)val7).name = "TwitchChatBoxSpot"; val7.transform.parent = screenSpotsParent.transform; val7.transform.position = new Vector3(-23.8473f, 0.7042f, -21.4762f); val7.transform.rotation = Quaternion.Euler(0f, 258.3796f, 0f); val7.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); screenSpots.Add(val7); } else if (currentScene == "Park") { screenSpotsParent = new GameObject(); ((Object)screenSpotsParent).name = "TwitchChatBoxSpots"; screenSpotsParent.transform.position = Vector3.zero; screenSpotsParent.transform.rotation = Quaternion.identity; screenSpotsParent.transform.localScale = Vector3.one; GameObject val8 = new GameObject(); ((Object)val8).name = "TwitchChatBoxSpot"; val8.transform.parent = screenSpotsParent.transform; val8.transform.position = new Vector3(7.245f, -3.7736f, 3.8686f); val8.transform.rotation = Quaternion.Euler(0f, 63.7015f, 0f); val8.transform.localScale = Vector3.one; screenSpots.Add(val8); GameObject val9 = new GameObject(); ((Object)val9).name = "TwitchChatBoxSpot"; val9.transform.parent = screenSpotsParent.transform; val9.transform.position = new Vector3(-25.9785f, -2.5141f, 7.6952f); val9.transform.rotation = Quaternion.Euler(0f, 253.9577f, 0f); val9.transform.localScale = Vector3.one; screenSpots.Add(val9); GameObject val10 = new GameObject(); ((Object)val10).name = "TwitchChatBoxSpot"; val10.transform.parent = screenSpotsParent.transform; val10.transform.position = new Vector3(-29.4098f, -0.6334f, -6.1211f); val10.transform.rotation = Quaternion.Euler(0f, 268.7148f, 0f); val10.transform.localScale = Vector3.one; screenSpots.Add(val10); GameObject val11 = new GameObject(); ((Object)val11).name = "TwitchChatBoxSpot"; val11.transform.parent = screenSpotsParent.transform; val11.transform.position = new Vector3(-6.877f, -17.8891f, 19.2793f); val11.transform.rotation = Quaternion.Euler(0f, 346.0926f, 0f); val11.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); screenSpots.Add(val11); GameObject val12 = new GameObject(); ((Object)val12).name = "TwitchChatBoxSpot"; val12.transform.parent = screenSpotsParent.transform; val12.transform.position = new Vector3(35.8078f, 5.8846f, 5.5854f); val12.transform.rotation = Quaternion.Euler(0f, 113.9208f, 0f); val12.transform.localScale = Vector3.one; screenSpots.Add(val12); GameObject val13 = new GameObject(); ((Object)val13).name = "TwitchChatBoxSpot"; val13.transform.parent = screenSpotsParent.transform; val13.transform.position = new Vector3(21.0445f, 5.5078f, 29.0016f); val13.transform.rotation = Quaternion.Euler(0f, 43.9476f, 0f); val13.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); screenSpots.Add(val13); GameObject val14 = new GameObject(); ((Object)val14).name = "TwitchChatBoxSpot"; val14.transform.parent = screenSpotsParent.transform; val14.transform.position = new Vector3(-3.7776f, -1.1804f, 25.0848f); val14.transform.rotation = Quaternion.Euler(0f, 320.6074f, 0f); val14.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); screenSpots.Add(val14); } } if (whereToPinChat == 0) { activeScreen.transform.parent = screenSpots[0].transform; activeScreen.transform.localPosition = Vector3.zero; activeScreen.transform.localRotation = Quaternion.identity; activeScreen.transform.localScale = new Vector3(0.005f, 0.005f, 0.005f); } } [IteratorStateMachine(typeof(d__74))] private static IEnumerator ScreenFade() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__74(0); } [IteratorStateMachine(typeof(d__75))] private IEnumerator ReadEntries() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__75(0) { <>4__this = this }; } public override void OnApplicationQuit() { if (fileFound) { Log("Stopping Twitch Bot"); } fileFound = false; chat.Dispose(); } private static void Write(string msg, bool overrideResponses = false) { if (chatResponses || overrideResponses) { msg = msg.Replace("{sender}", chatEntries[0].Sender); int num = 500; while (msg.Length > num) { string chatMessage = msg.Substring(0, num); msg = msg.Substring(num); chat.Write(chatMessage); } if (msg != "") { chat.Write(msg); } } } internal static void Log(string msg) { MelonLogger.Msg(msg); } } }