From 21917ee901de974e704461d17061c299ac637051 Mon Sep 17 00:00:00 2001 From: MallocNull Date: Sun, 19 Oct 2014 16:27:26 -0500 Subject: [PATCH] github is the worst fucking program to ever be ma aids --- bot/bot/Chat.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/bot/Chat.cs b/bot/bot/Chat.cs index 2ad856b..1fe364b 100644 --- a/bot/bot/Chat.cs +++ b/bot/bot/Chat.cs @@ -23,8 +23,8 @@ namespace bot { List chatdata = d.FindElement(By.Id("chatList")).FindElements(By.TagName("div")).ToList(); messageDivSize = chatdata.Count; foreach(IWebElement we in chatdata) { - if(Int32.Parse(we.GetAttribute("id").Substring(11)) > currentMessage) - currentMessage = Int32.Parse(we.GetAttribute("id").Substring(11)); + if(Int32.Parse(we.GetAttribute("id").Substring(we.GetAttribute("id").LastIndexOf('_') + 1)) > currentMessage) + currentMessage = Int32.Parse(we.GetAttribute("id").Substring(we.GetAttribute("id").LastIndexOf('_') + 1)); } Console.WriteLine("got here"); break;