Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void saveGame(int id, bool notify)
- {
- var item = userstats.FirstOrDefault(o => o.userid == id);
- string userFileName = item.name + ".txt";
- string fullPath = @"C:\Users\SomeusernameidkLOL\Desktop\eebotdata\savedata\" + userFileName;
- string[] lines = File.ReadAllLines(fullPath).Concat(new string[99]).ToArray();
- int digStartIndex = Array.FindIndex(lines, row => row.Contains("START_DIGBOT"));
- int generalStartIndex = Array.FindIndex(lines, row => row.Contains("START_GENERAL"));
- lines[2] = "2";
- lines[digStartIndex + 1] = item.picklvl.ToString();
- lines[digStartIndex + 2] = item.picklife.ToString();
- lines[digStartIndex + 3] = item.gold.ToString();
- lines[digStartIndex + 4] = item.dirt.ToString();
- lines = lines.Where(x => !string.IsNullOrEmpty(x)).ToArray();
- File.WriteAllLines(fullPath, EMPTY_STR_LIST);
- File.WriteAllLines(fullPath, lines);
- if (notify)
- conn.Send("say", "/pm " + item.name + " [DigBot] Your data has been successfully saved!");
- //justshop.Add(item.userid, DateTime.Now);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement