Everything posted by Kenneh
-
Banking issue
Xavier pls private interface Filter<T> { // WHY IS THIS NOT IN THE API boolean accept(T t); } private final Comparator<RS2Object> comparator = new Comparator<RS2Object>() { @Override public int compare(RS2Object o1, RS2Object o2) { return distance(o1) - distance(o2); } }; private final Filter<RS2Object> filter = new Filter<RS2Object>() { @Override public boolean accept(RS2Object rs2Object) { return rs2Object.getName().equals("Bank booth") && Arrays.asList(rs2Object.getDefinition().getActions()).contains("Bank"); } }; public RS2Object getClosestBank() { final List<RS2Object> allObjects = client.getCurrentRegion().getObjects(); Collections.sort(allObjects, comparator); for(RS2Object obj : allObjects) { if(filter.accept(obj)) { return obj; } } return null; }
-
Banking issue
Oh god, does osbot not have filters? Filters makes everything look better! private Filter<GameObject> bankFilter = new Filter<GameObject>() { // no need to remake the filter every time you call the bank because you can just reference this. @Override // its private because it's only going to be used for internal use in the getBankBooth() method public boolean accept(GameObject gameObject) { return gameObject.getName().equals("Bank booth") && Arrays.asList(gameObject.getActions()).contains("Bank"); } }; public GameObject getBankBooth() { return GameObjects.getNearest(bankFilter); }
-
Clunky code...
The only reason I'm even commenting on this is because the guy who made this thread forked my github. https://github.com/MobbyGFX/OSBot/blob/master/OSBot/src/org/solace/scripts/TestScript.java
-
My cellphones Internet is probably better than your computer's
Man, that's terrible!
-
My cellphones Internet is probably better than your computer's
HTC One?
-
Clunky code...
Well then you clearly don't know me.
-
Clunky code...
Well, to be honest... A lot. If that's the default API for here, I suggest you write your own so that it's cleaner. ctx.getScript().sleep(MethodProvider.random(500, 1000)); Just looks terrible.
-
Mini Screen to see your bots!
Note that it's a resource waste and it won't draw paint information. It's funny to watch though
-
The Issue With Free Scripts
so you want me to release a free version of all the scripts you currently have premium? ;)
-
Shitty computer
I have no issues with 8.1 on my laptop or desktop computer.
-
OSBot Website Not Loading Correctly
Clear your cache, ctrl + f5
-
Zybez price retriever
Thanks, I added suggestions similar to how irc works. "dragon sc + tab" return dragon scimitar
-
Zybez price retriever
Haha, I got bored. It relys on the Gson API and I don't know if that's provided by osbot. Here's a nifty little utility I was able to make with it with little effort. should extract the picture and maybe an auto fill feature would make it nice I'm really bad at swing, so I'm not sure how to make this look decent. For the auto complete, that'd be a nifty feature, but all this does is grab what you put in the box and appends it to the end of the url. I dont think I can make it auto complete without a list of item names of some sort.
-
Zybez price retriever
Haha, I got bored. It relys on the Gson API and I don't know if that's provided by osbot. Here's a nifty little utility I was able to make with it with little effort.
-
BarrowsPro - Coming soon
You keep using that word, but I don't think you know what it means. When I say flawlessly, I mean without having any problems. I'm having a hard time believing that this script, still in its development stage, ran for 8+ hours without a single issue.
-
BarrowsPro - Coming soon
You keep using that word, but I don't think you know what it means.
-
What would you do if OSBot was shut down today...
good 2 see u here Heh, Ive been here for ages. I have accounts on just about all the oldschool bots, but only script for onoce :P
-
How stupid Jagex is and what they think Bonds did to Runescape
;)
-
Perfect Combat
No wonder this site isn't progressing.
-
Zybez price retriever
I don't know what libraries are in the client by default, but this provides a bit more information package org.kenneh.framework.net; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.Date; import com.google.gson.Gson; public class PriceGrabber { private static final String URL_BASE = "http://forums.zybez.net/runescape-2007-prices/api/item/"; private final int itemId; private String name; private int average; private int low; private int high; private String imageURL; private Offer[] offers; private Price price; public Offer[] getOffers() { return offers; } public Price getRaw() { return price; } public String getImageURL() { return imageURL; } public int getLow() { return low; } public int getHigh() { return high; } public int getAverage() { return average; } public int getId() { return itemId; } public String getName() { return name; } public PriceGrabber(final String itemName) { this.name = itemName; price = new Gson().fromJson(getJson(getName()), Price.class); low = (int) price.getLow(); average = (int) price.getAverage(); high = (int) price.getHigh(); name = price.getName(); imageURL = price.getImageURL(); itemId = price.getId(); offers = price.getOffers(); } public PriceGrabber(final int itemId) { this.itemId = itemId; price = new Gson().fromJson(getJson(String.valueOf(getId())), Price.class); low = (int) price.getLow(); average = (int) price.getAverage(); high = (int) price.getHigh(); name = price.getName(); imageURL = price.getImageURL(); offers = price.getOffers(); } private String getJson(String end) { try { URL url = new URL(URL_BASE + end.toLowerCase().replaceAll(" ", "%20")); URLConnection urlconn = url.openConnection(); urlconn.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36"); urlconn.setRequestProperty("Connection", "close"); BufferedReader in = new BufferedReader(new InputStreamReader(urlconn.getInputStream())); return in.readLine(); } catch(Exception a) { System.out.println("Error connecting to server."); } return null; } public static void main(String[] args) { PriceGrabber price = new PriceGrabber("amulet of fury"); System.out.println(price.getRaw()); System.out.println(price.getOffers()[0]); } private class Offer { private int selling; private int quantity; private int price; private long date; private String rs_name; private String contact; private String notes; public boolean isSelling() { return selling == 1; } public int getQuantity() { return quantity; } public int getPrice() { return price; } public String getDate() { Date d = new Date(date * 1000L); return d.toString(); } public String getRSName() { return rs_name; } public String getContact() { return contact; } public String getNotes() { return notes; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getRSName()).append(" is ").append(isSelling() ? "selling" : "buying").append(" ").append(getQuantity()); sb.append(" of the item ").append(" for ").append(getPrice()).append(" on ").append(getDate()).append("\t"); sb.append("Contact ").append(getContact()).append("\t"); sb.append("Notes: ").append(getNotes()); return sb.toString(); } } private class Price { private int id; private String name; private String image; private double average; private double recent_high; private double recent_low; private Offer[] offers; public Offer[] getOffers() { return offers; } public double getHigh() { return recent_high; } public double getLow() { return recent_low; } public String getImageURL() { return image; } public int getId() { return id; } public String getName() { return name; } public double getAverage() { return average; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("id=").append(getId()).append("\t"); sb.append("name=").append(getName()).append("\t"); sb.append("image=").append(getImageURL()).append("\t"); sb.append("average=").append(getAverage()).append("\t"); sb.append("high=").append(getHigh()).append("\t"); sb.append("low=").append(getLow()).append("\t"); sb.append("offers=").append(getOffers().length); return sb.toString(); } } }
-
Would anyone be interested in buying PBE acc's?
You can sign up for free right now lmao.
-
BarrowsPro - Coming soon
I don't see this happening.
-
What would you do if OSBot was shut down today...
Go to Aurora ;)
-
Kenneh's GDK
More profit, easier to write. I'm pretty lazy ;)
-
Kenneh's GDK
rsbot 1 all over again lelelele osbot client 2 shit to work with, aurora is nice with devs who are active and listen and overall fun to talk to. Much better imo ;)