Everything posted by SXForce
-
ranking of trial scripters
paint master?
-
Random management system + new account GUI
This is great! I can implement this in my fighter script. Quick question: What happens when you register the random hook you described and the following happens: Custom hook does not activate because you are not under attack at that moment, but you get attacked before built-in random could finish? Will it just switch to your custom hook when this happens?
-
BETA v1.5.12 (RANDOMS BETA)
Awesome! These updates are showing up fast!
-
Script with multiple files
Yeah, just did this and it works. Thanks for the answer. Isn't there another way where i dont have to pass the entire class? :P
-
Script with multiple files
I am trying to create a larger script than usual, so I want to use multiple files for it. Now I have the main script that starts up, but I have to use the methods of "MethodProvider" in the OSBot API in the other class too. Something like: MainScript.java private DoWalkPath path; @Override public void onStart() { path = new DoWalkPath(); // This is just an example name, I don't want the other class just to walk... } @Override public int onLoop() throws InterruptedException { switch (state) { case WALKING_TO_BANK: path.walk(); // This is what I want break; } return 3; } DoWalkPath.java public void walk() { openTab(Tabs.Magic); selectInterfaceOption(271, 23, "Cast"); // Teleport or something sleep(random(5000, 6000)); // Wait for teleport walk(Position); // Walk from there } Now I can't use "walk()" as I don't have access to the MethodProvider in that other class. I tried extending the MethodProvider, but I every value is null (client etc).
-
BETA v1.5.4 (RANDOMS BETA)
This. Is. Awesome! Ill try it out tonight!
-
"Grand Exchange" script
Correct.
-
"Grand Exchange" script
It gets the recent price for an item. For example, if you want the price for an oak log: Exchange exchange = new Exchange(); exchange.getPrice("oak log");
-
"Grand Exchange" script
For script writers. I made this for myself. It gets the current price in Zybez for a given item. public class Exchange { private final String BASE_URL = "http://forums.zybez.net/runescape-2007-prices/api/"; public double getPrice(String itemName) { String json = getJSON(BASE_URL + getFormattedStringForUrl(itemName)); return getPriceFromJson(json); } private String getFormattedStringForUrl(String string) { while(string.contains(" ")) { string = string.replace(" ", "+"); } return string; } private double getPriceFromJson(String json) { int startPosition = json.indexOf("average\":\"") + "average\":\"".length(); int endPosition = json.indexOf("\",\"", startPosition); return Double.parseDouble(json.substring(startPosition, endPosition)); } private String getJSON(String url) { try { URL u = new URL(url); HttpURLConnection c = (HttpURLConnection) u.openConnection(); c.setRequestMethod("GET"); c.setRequestProperty("Content-length", "0"); c.setUseCaches(false); c.setAllowUserInteraction(false); c.setConnectTimeout(3000); c.setReadTimeout(3000); c.connect(); int status = c.getResponseCode(); switch (status) { case 200: case 201: BufferedReader br = new BufferedReader(new InputStreamReader(c.getInputStream())); StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line+"\n"); } br.close(); return sb.toString(); } } catch (MalformedURLException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return null; } } Usage Paste this file in your script as INNER CLASS. Like: public class SXSomeScript extends Script { @Override public void onStart() { // Your things here } @Override public int onLoop() { // Your things here } // Copy above class, this is just an example. public class Exchange { ... } } Then use it as follows in your class. Note: Use the onStart() to get the prices, not the onLoop()! Exchange exchange = new Exchange(); exchange.getPrice("dragon chainbody"); // Returns 13735000.0 (a double)
-
BETA v1.4.1
The bot mouse movements are better with right clicking and clicking on something. But when you try to interact with a character that moves, the mouse is VERY VERY slow in following the character. Edit: an admin can teamview me if you want. Then i can show it to you...
-
How to click a specific tile
You can use: walkExact(position); See: MethodProvider - http://osbot.org/api/
-
Final ETA on Randoms + SDN
Randoms are the only problem that are keeping bots from running 24/7. Glad to see that is being taken care of now.
-
Random event behaviour overruling
And what if you are using a script where you are under attack all the time. Then you CANNOT solve the strange box. You can use something like: @Overridepublic void onRandomActivate(RandomEventSolver res) { if(res instanceof StrangeBox) { runSomewhereSafe(); }}@Overridepublic void onRandomDeactivate(RandomEventSolver res) { if(res instanceof StrangeBox) { runBack(); }} would be nice. You don't have to script your own random code this way. You can just execute a part of your code, before the OSBot random code gets executed. And you could use: @Overridepublic void onRandomActivate(RandomEventSolver res) { if(res instanceof EvilChicken) { res.stop(); // onRandomDeactivate() gets called too. runIntoFightCave(); }} Edit: Above answer sounds good to for totally overriding the OSBot random system.
-
What you can expect from the next OSBot release v1.4.1!
That. Is. Awesome. I'll hope this fixes miss clicking forever.
-
Botwatch??
Latest news on this subject: "However we’re pleased to say the basic BotWatch systems are live in OSRS and we’re beginning to expand its reach across the game." http://services.runescape.com/m=rswiki/en/DevBlog:BotWatch_Update_in_Old_School_RuneScape
-
BETA v1.3.1
When I run my custom bot, it works great (50fps). Issue so far: After some time, it says "sxforce logged in" in the log and then de bot freezes. The weird thing is that i am already logged in... After a few secs, the entire message log is cleared and I still cant do anything. I don't really know what is happening here...