Jump to content

warfront1

Members
  • Posts

    10
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

1199 profile views

warfront1's Achievements

Newbie

Newbie (1/10)

11

Reputation

  1. warfront1

    Art.

    The artist is invisible, his presence perceptible yet he is not there. Only his art and the space created are portrayed. It’s as if the artist soul was transposed from his body on to the canvas. The artist’s creation is iconic, similar to the work of Salvador Dali or Rembrandt . The hand of the artist has become arbitrary, the fusion of raw emotions meshed with a blank slate. What a profound masterpiece. Warfront1
  2. Vouch for Aloe, completed 5,000 MTD account order in 2 hours. Great Service. Warfront1
  3. Working closely with Alek over the past few years has changed my life. He is truly an inspiration individual and his excellence is reflected through all venues of his life. Regardless of venue, be it his job, relationships, programming, friendships, family, or public service; Alek has continued to put forth a truly commendable force of dedication, compassion, and sound ethic. Despite Alek’s external OsBot obligations, we have spent numerous nights online, past hours, with our small development teams working on code and customer support. It would be sufficient to say that there were many all nighters pulled since the launch of OsBot. Alek’s work was and remains undoubtedly instrumental in OsBot's success. Let’s all take a moment, and thank Alek for his amazing work and dedication. This one goes out to you, Alek! Warfront1
  4. No externals were used in this class, all manual regex parsing, I will post usage later! package scripts; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ZybezRSItem { private static String Json = ""; public ZybezRSItem(String ItemName){ try { Json = readUrl("http://forums.zybez.net/runescape-2007-prices/api/"+ItemName.replaceAll("\\s","+")); } catch (Exception e) { Json = ""; e.printStackTrace(); } } public int getAveragePrice(){ Pattern pattern = Pattern.compile("(?<=\"average\":\")[0-9]+"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return(Integer.parseInt(matcher.group())); return 0; } public int getRecentHigh(){ Pattern pattern = Pattern.compile("(?<=\"recent_high\":\")[0-9]+"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return(Integer.parseInt(matcher.group())); return 0; } public int getRecentLow(){ Pattern pattern = Pattern.compile("(?<=\"recent_low\":\")[0-9]+"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return(Integer.parseInt(matcher.group())); return 0; } public int getHighAlchPrice(){ Pattern pattern = Pattern.compile("(?<=\"high_alch\":\")[0-9]+"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return(Integer.parseInt(matcher.group())); return 0; } public String getImageUrl(){ Pattern pattern = Pattern.compile("(?<=\"image\":\")[^\"]*"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return((matcher.group()).replace("\\", "")); return ""; } public String getZybezID(){ Pattern pattern = Pattern.compile("(?<=\"id\":\")[^\"]*"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return((matcher.group()).replace("\\", "")); return ""; } private static String readUrl(String urlString) throws Exception { BufferedReader reader = null; try { URL url = new URL(urlString); reader = new BufferedReader(new InputStreamReader(url.openStream())); StringBuffer buffer = new StringBuffer(); int read; char[] chars = new char[1024]; while ((read = reader.read(chars)) != -1) buffer.append(chars, 0, read); return buffer.toString(); } finally { if (reader != null) reader.close(); } } public static String getAllOffersAsJson(){ Pattern pattern = Pattern.compile("(?<=\"offers\":\\[)[^\\]]*"); Matcher matcher = pattern.matcher(Json); while (matcher.find()) return((matcher.group())); return ""; } public static Map<String, String[]> getAllOffersInMap(){ Map<String, String[]> ReturnMap = new HashMap<String, String[]>(); String JsonOffersAsString = getAllOffersAsJson(); Pattern pattern = Pattern.compile("(?<=\"selling\":\")[0|1]"); Matcher matcher = pattern.matcher(JsonOffersAsString); int sizeofreturn = 0; while (matcher.find()){ sizeofreturn = sizeofreturn + 1; } String[] SellingOrBuying = new String[sizeofreturn]; String[] QuantityArray = new String[sizeofreturn]; String[] PriceArray = new String[sizeofreturn]; String[] DateArray = new String[sizeofreturn]; String[] RSNameArray = new String[sizeofreturn]; String[] ContactArray = new String[sizeofreturn]; String[] NotesArray = new String[sizeofreturn]; int counter = 0; pattern = Pattern.compile("(?<=\"selling\":\")[0|1]"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ SellingOrBuying[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"quantity\":\")[0-9]+"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ QuantityArray[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"price\":\")[0-9]+"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ PriceArray[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"date\":\")[0-9]+"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ DateArray[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"rs_name\":\")[^\"]*"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ RSNameArray[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"contact\":\")[^\"]*"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ ContactArray[counter]=((matcher.group())); counter = counter + 1; } counter = 0; pattern = Pattern.compile("(?<=\"notes\":\")[^\"]*"); matcher = pattern.matcher(JsonOffersAsString); while (matcher.find()){ NotesArray[counter]=((matcher.group())); counter = counter + 1; } ReturnMap.put("selling", SellingOrBuying); ReturnMap.put("quantity", QuantityArray); ReturnMap.put("price", QuantityArray); ReturnMap.put("date", DateArray); ReturnMap.put("rs_name", RSNameArray); ReturnMap.put("contact", ContactArray); ReturnMap.put("notes", NotesArray); return ReturnMap; } public String getFullJsonReturn(){ return Json; } }
  5. It is opening random doors along the path. The addition of another parameter to disable the automatic door opening would be great! Thanks, Warfront1
×
×
  • Create New...