static O mainBot; public static Dictionary<string, int> UserPostCounts = new Dictionary<string, int>(); public static string LevelUp() { string username = cast callOpt(mainBot, "getUserName"); if (UserPostCounts.ContainsKey(username)) { UserPostCounts[username]++; switch (UserPostCounts[username]) { case 10: return "Level up! " + username + " is now level 2!"; break; case 100: return "Level up! " + username + " is now level 3!"; break; case 500: return "Level up! " + username + " is now level 4!"; break; case 1000: return "Level up! " + username + " is now level 5!"; break; case 5000: return "Level up! " + username + " is now level 6!"; break; } } else { UserPostCounts.Add(username, 1); } return string.Empty; } public static string ViewLevel(S s) { string returnString = string.Empty; if (match("!level *", s)) { string username = cast callOpt(mainBot, "getUserName"); int postCount = 0; if (UserPostCounts.ContainsKey(username)) { postCount = UserPostCounts[username]; } else { return username + " has no posts"; } returnString = username + " is level "; if (postCount < 10) { returnString += "1"; } else if (postCount >= 10 && postCount < 100) { returnString += "2"; } else if (postCount >= 100 && postCount < 500) { returnString += "3"; } else if (postCount >= 500 && postCount < 1000) { returnString += "4"; } else if (postCount >= 1000 && postCount < 5000) { returnString += "5"; } else { returnString += "6"; } returnString += " with " + postCount + " posts."; } return returnString; } static synchronized S answer(S s) { S a = ViewLevel(); if (!empty(a)) ret a; ret LevelUp(); }
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment