god damnit flash

fix your website
This commit is contained in:
MallocNull 2014-10-19 16:04:43 -05:00
parent e8b72fbdf8
commit 8f5faa7fa9
2 changed files with 12 additions and 7 deletions

View file

@ -17,12 +17,17 @@ namespace bot {
static int currentMessage; static int currentMessage;
public static void reloadContext(FirefoxDriver d) { public static void reloadContext(FirefoxDriver d) {
while(true) {
try {
List<IWebElement> chatdata = d.FindElement(By.Id("chatList")).FindElements(By.TagName("div")).ToList(); List<IWebElement> chatdata = d.FindElement(By.Id("chatList")).FindElements(By.TagName("div")).ToList();
messageDivSize = chatdata.Count; messageDivSize = chatdata.Count;
foreach(IWebElement we in chatdata) { foreach(IWebElement we in chatdata) {
if(Int32.Parse(we.GetAttribute("id").Substring(11)) > currentMessage) if(Int32.Parse(we.GetAttribute("id").Substring(11)) > currentMessage)
currentMessage = Int32.Parse(we.GetAttribute("id").Substring(11)); currentMessage = Int32.Parse(we.GetAttribute("id").Substring(11));
} }
break;
} catch(Exception shoehorn) {}
}
if(d.FindElement(By.Id("audioButton")).GetAttribute("class").ToLower() == "button") if(d.FindElement(By.Id("audioButton")).GetAttribute("class").ToLower() == "button")
d.FindElement(By.Id("audioButton")).Click(); d.FindElement(By.Id("audioButton")).Click();
} }

View file

@ -85,7 +85,7 @@ namespace bot {
tmp = new MySqlConnection("SERVER=" + dbinfo[0] + ";DATABASE=" + dbinfo[3] + ";UID=" + dbinfo[1] + ";PASSWORD=" + dbinfo[2] + ";"); tmp = new MySqlConnection("SERVER=" + dbinfo[0] + ";DATABASE=" + dbinfo[3] + ";UID=" + dbinfo[1] + ";PASSWORD=" + dbinfo[2] + ";");
tmp.Open(); tmp.Open();
} catch(Exception e) { } catch(Exception e) {
criticalError("Could not open database connection!"); criticalError("Could not open database connection! "+ e.Message);
return null; return null;
} }
return tmp; return tmp;