public static void getData(Point position, int direction, int indiceToFind) { Console.WriteLine("looking for : " + D2OParsing.GetPoiName(indiceToFind) + " FROM : " + position.x + " " + position.y + " " + getDir(direction)); indices = new Dictionary <int, Indice>(); string html = string.Empty; string url = @"http://dofus-map.com/huntTool/getData.php?x=" + position.x + "&y=" + position.y + "&direction=" + getDir(direction) + "&world=0&language=fr"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.AutomaticDecompression = DecompressionMethods.GZip; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream)) { html = reader.ReadToEnd(); } JObject jsonObject = JObject.Parse(html); JToken indicesInfos = jsonObject.GetValue("hints"); foreach (JToken indiceInfo in indicesInfos.Children()) { //Console.WriteLine("n : " + indiceInfo.SelectToken("n") + " x :" + (int)indiceInfo.SelectToken("x")); indices.Add(int.Parse(indiceInfo.SelectToken("n").ToString()), new Indice(int.Parse(indiceInfo.SelectToken("n").ToString()), new Point(int.Parse(indiceInfo.SelectToken("x").ToString()), int.Parse(indiceInfo.SelectToken("y").ToString())), int.Parse(indiceInfo.SelectToken("d").ToString()))); } int indiceDofusHuntToFind = DofusHuntValues[D2OParsing.GetPoiName(indiceToFind)]; Indice indice = indices[indiceDofusHuntToFind]; Console.WriteLine(D2OParsing.GetPoiName(indiceToFind) + " : \n" + indice.position.x + ";" + indice.position.y + " : " + indice.direction + " cases vers " + getDir(direction)); MessageHandler.mapToGo = indice.position; }