Jump to content

Chris

Scripter II
  • Posts

    8365
  • Joined

  • Last visited

  • Days Won

    14
  • Feedback

    100%

Everything posted by Chris

  1. I'll work on some fixes Monday night I have an exam to worry about atm sorry
  2. check if the mirror client is up to date. I don't handle the mirror mode and i dont use any custom code for the hopper
  3. injection or mirro?
  4. can also add coins and tokens wealth += i.getId() == 995 ? i.getAmount() : i.getId() == 13204 ? (i.getAmount() * 1000) : (getPrice(i.getId()) * i.getAmount());
  5. import java.awt.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.text.NumberFormat; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "", name = "Bank Evaluator", info = "Determines the value of bank", logo = "", version = 1) public class Main extends Script { private int wealth = 0; private long startTime; private long endTime; private static final Pattern pattern = Pattern.compile("(?:\"overall\":)([0-9]+)"); private static int getPrice(int id) throws MalformedURLException, IOException { String url = "http://api.rsbuddy.com/grandExchange?a=guidePrice&i=" + id; BufferedReader reader = new BufferedReader( new InputStreamReader(new URL(String.format(url, id)).openConnection().getInputStream())); String line; while ((line = reader.readLine()) != null) { Matcher m = pattern.matcher(line); if (m.find() && m.groupCount() > 0) { int overallPrice = Integer.parseInt(m.group(1)); if (overallPrice == 0) break; return overallPrice; } } reader.close(); return 0; } @Override public void onPaint(Graphics2D paint) { paint.setColor(Color.ORANGE); paint.drawString("Amount of time took to get bank wealth: " + formatT(endTime), 10, 310); paint.drawString("Amount of items found in bank: " + formatIntegers(getBank().getItems().length), 10, 325); paint.drawString("Bank amount: " + formatIntegers(wealth), 10, 340); } private String formatT(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } @Override public void onStart() { startTime = System.currentTimeMillis(); if (getBank().isOpen()) { for (Item i : getBank().getItems()) { if (i != null){ try { wealth = wealth + (getPrice(i.getId()) * i.getAmount()); } catch (IOException e) { e.printStackTrace(); } } } endTime = System.currentTimeMillis() - startTime; } } private String formatIntegers(int num) { return NumberFormat.getInstance().format(num); } @Override public int onLoop() throws InterruptedException { return 1000; } } made some changes hope u like
  6. report the thread and put in comments to transfer the thread
  7. there are no bug reports on it so yes.
  8. i cleared my inbox so u would have to pm me again
  9. run the script then check the logger for id it says it
  10. I checked the code yesterday and it loots if the bolts are on the ground stack of 2 or greater. it wont loot it if your inventory is full. I'll have to do some testing after my security exam tomorrow.
  11. Contacts on my profile or meet chatbox
  12. Because you're a beginner in java and osbot scripting. PLus states are garbage to learn from
  13. dont use states its trash
  14. pull caps clean 1 by 1 clean the casing happens every time after my kawaii anime sessions
  15. ekks deee!
  16. https://youtu.be/pb0fGJXS2Qg
  17. by not using breaks. I have not implemented anything for break handler
  18. Doing some testing at brutal dragons..managed to grab a visage! my internet cut out though...so i have to add it manually to the database :'( Full logs
  19. Chris

    cli

    java -jar ..................... TIMEOUT 3 java -jar .................. TIMEOUT 3 //repeat
  20. If you can grab video on what it does before it dies it would be helpful. only reason would be you are on a low eat at % As for the client stopping it looks like the random event for the game lobby isnt working properly. it should click the 'click here to play button' before attempting to reloop the script. I'll try testing this myself sometime today. I didn't change anything so yes it will always be working. Anytime there is a problem with the script is if I accidently push a bad update, the client isnt on a stable build (Runescape gameupdates), or things are removed from the API. Otherwise please use the bug report form located on my alt thread which is located on the main thread.
  21. get the root id of the bank area when you have something searched then try messing with the childs of that root. then call the getItems() method.
×
×
  • Create New...