i2 Quiz Bot Source Code For C# and VB.NET
Password: ramtin
[You must be registered and logged in to see this link.]
Password: ramtin
[You must be registered and logged in to see this link.]
No user |
public static void Score(string Username, int score)
{
try
{
if (BotsXmlDoc == null)
return;
AddUser(Username);
XmlNode XNode = BotsXmlDoc.SelectSingleNode("i2QuizBot");
XmlNodeList NList = XNode.SelectNodes("User");
for (int i = 0; i < NList.Count; i++)
{
if (NList[i].Attributes.GetNamedItem("Us").Value == Username.ToLower())
{
int getMyInt = int.Parse(NList[i].Attributes.GetNamedItem("Score").Value);
int newInt = getMyInt + score;
NList[i].Attributes.GetNamedItem("Score").Value = newInt.ToString();
break;
}
}
}
catch { }
}
public static string GetUserScore(string Username)
{
string str = "this username dosen't exist";
try
{
if (BotsXmlDoc == null)
return "Looks like you are dosen't fill anything";
AddUser(Username);
XmlNode XNode = BotsXmlDoc.SelectSingleNode("i2QuizBot");
XmlNodeList NList = XNode.SelectNodes("User");
for (int i = 0; i < NList.Count; i++)
{
if (NList[i].Attributes.GetNamedItem("Us").Value == Username.ToLower())
{
str = NList[i].Attributes.GetNamedItem("Score").Value;
break;
}
}
}
catch { }
return str;
}
|
|