private void Form1_Load(object sender, EventArgs e) { Thread t = new Thread(() => { Task <GroupRank[]> task = RobloxAPI.GetGroupRanks(1237888); while (!task.IsCompleted) { Thread.Sleep(1); } Console.WriteLine("Group Ranks in 1237888."); foreach (GroupRank rank in task.Result) { Console.WriteLine("ID: {0} Name: {1} Rank: {2}", rank.ID, rank.Name, rank.Rank); } Task <GroupRank> ntask = RobloxAPI.GetUserRankInGroup(5762824, 1237888); while (!ntask.IsCompleted) { Thread.Sleep(1); } nrank = ntask.Result; if (nrank != null) { Console.WriteLine("User 5762824 is GroupRank: ID: {0} Name: {1} Rank: {2}", nrank.ID, nrank.Name, nrank.Rank); } }); t.Start(); }
public async void RefreshRanks() { _Ranks = await RobloxAPI.GetGroupRanks(_GroupID); }