Jump to content

Dreamliner

Trade With Caution
  • Posts

    1642
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    0%

Everything posted by Dreamliner

  1. You should replace for (int i = 0; i < LineLimt; i++) { lines.add(i, br.readLine().toString()); } with String line = null; int i = 0; while ((line = br.readLine()) != null) { lines.add(i++,line); } This eliminates having to know how long the file is!
  2. Hello OSBot. Recently, I've been working with paints and noticed that with paints that require large calculations and things of that nature, the paint actually lags the bot. The solution is to use a thread which updates the data periodically. For instance, say you want to display range xp: One might calculate how much range xp is gained per paint update. BAD. public void onPaint(Graphics g) { drawString("Range XP Gained: " + this.client.getSkills().getExperience(Skill.RANGED) - this.INITIAL_RANGE_XP,0,0); }You can see that it calculates this EVERY time paint is called. I believe it is based on the current FPS.The correct way to do it is using a thread. Here is your onLoop() - public void onLoop() { if (this.start == false) { this.paintUpdater = new PaintUpdater(this.client, this); this.paintThread = new Thread(this.paintUpdater); this.paintThread.start(); this.start = true; } return 1000; } Here is your thread class - public class PaintUpdater implements Runnable { public Client client; public Script script; public int INITIAL_RANGE_XP; public int range_xp_gained; public boolean run = true; public PaintUpdater(Client c, Script s) { this.client = c; this.script = s; this.INITIAL_RANGE_XP = c.getSkills().getExperience(Skill.RANGED); } public void run() { while (this.run) { try { update(); Thread.sleep(200); } catch (InterruptedException e) { } } } public void update() { this.range_xp_gained = this.client.getSkills().getExperience(Skill.RANGED) - this.INITIAL_RANGE_XP; } public int getRangeXPGained() { return this.range_xp_gained; } public void stop() { this.run = false; } } and here is your paint - public void onPaint(Graphics g) { drawString("Range XP Gained: " + this.paintUpdater.getRangeXPGained(),0,0); } The rest is up to you to make it work how you please!
  3. banned members of pb >.< bah lol hai. Hey lol Who are you on pb I like big quote blocks, so I feel this is a productive post
  4. 1 minute 45 lol. I run 5 miles a day, so my lungs are pretty healthy
  5. And what he could have understood wrong? Client reconnects every 5 seconds, but problem is (=bug) that how much processing client does for it... You do understand the Google Chrome connecting to the internet is different to a Java Client connecting trying to connect to a servers which are down? You realize I said 0.0.0.0 which doesn't exist. Obviously the java throws an error when it doesn't get any data back. I have made several java server/clients and they never hog the cpu when the server is down. Are you sure you're the one who doesn't know what you're talking about? Also, please tell me how we load a website without connecting to a server. Seems like you've got it all figured out, huh?
  6. It's not a bug it's the client which is trying to connect to the server every 5 seconds. I can refresh my chrome browser to 0.0.0.0 every 5 seconds and it won't destroy my CPU.
  7. I am very excited for offline mode. This needs to be top priority. Once people realize that taking down the site no longer takes down the bots, the attacks will die out. Also, when the bot is running and trying to connect to the host, there is massive CPU usage. Perhaps it's a bug?
  8. They know the salt. All they have to do is salt the has when cracking. Salts prevent against dictionary attacks for people who use the password - password or 1234
  9. Dreamliner

    BETA v1.7.31

    [ERROR][08/05/13 07:08:04 AM]: Class p does not have a valid accessor! [ERROR][08/05/13 07:08:05 AM]: Class p does not have a valid accessor! [ERROR][08/05/13 07:08:06 AM]: Class p does not have a valid accessor! [ERROR][08/05/13 07:08:06 AM]: Class p does not have a valid accessor! [ERROR][08/05/13 07:08:07 AM]: Class p does not have a valid accessor! [ERROR][08/05/13 07:08:07 AM]: Class p does not have a valid accessor!
  10. Yep, just letting them know
  11. Wrong dialog. This is the dialog you receive one you complete the random and are teleported back
  12. No problem :P I feel you didn't understand the test: If the light switch was already down, keeping it down is still an option. All I was trying to say was it needs a semi-dynamic base that the user can manipulate.
  13. Freaky forester is not clicking the last interface once you are back.
  14. That's not as randomized as the method I posted, nor is it as simplified. I'd have to disagree. I did a little bit of statistical analysis on your method: Case one yields an average range of 750 to 2000 if not using a dynamic base. Case one yields an average range of 250 to 1500 if using a dynamic base. Case two yields an average range of 750 to 1675 if not using a dynamic base. Case two yields an average range of 50 to 975 if using a dynamic base. Case three yields an average range of 750 to 1675 if not using a dynamic base. Case three yields an average range of 23 to 948 if using a dynamic base. (all of these are bell curves with their peak at the mean) If you logged every time the bot slept, you would have a graph that looks like 2 or 3 superimposed bell curves (or 5 if you randomly use the dynamic base). To have something truly random, you have to use this method along with a way of changing the base to better suit your needs in a script. Such as an action that requires 1 tick compared to something that needs 5. If you slept the same way every time, it would look obvious by the randomness of it. By default, humans are not random. There was a study done that asked a human to flick on and off a light switch in a random pattern. The study concluded that there was a non-random pattern that the person followed subconsciously. When humans do actions, they get tuned to what they are doing. It is very easy to keep the beat in a song, compared to trying to play something in random intervals. Its not how our brains work. This is a very well written video explaining what I'm walking about http://www.youtube.com/watch?v=H2lJLXS3AYM
  15. I think you would be much better off using this (quick writeup) public void newSleep(int min, int max) { int x = 0; do { x = gRandom(min,max,(double)(max-min)/2); } while (x < min || x > max); sleep(x); } This way you can refine it in certain areas of your code, instead of it being generally around one area.
  16. If the bot has a spell or item selected as a random appears, it will fail.
  17. Could you guys add one more day of credit to VIP's so they don't lose it when there's one day before the automatic billing kicks in?
  18. The picture I can take literally is of a drawString. The jar is full of methods for you to use in your scripts.
  19. Devs: I have made a watchdog tool kit to automatically watch for any experience gains while running any script. It has a few features, and will be expanding with any ideas which seem beneficial - With this jar, you can set up an amount of time (in advance) to count xp gains. When the xp gains are older than your chosen time, the are removed and not counted any more. The result is a (sort of) real time glance for how well the bot has done in the past x amount of time. No more 19 hour proggies with some xp/hr which means nothing. Xp varies while running scripts. (combat especially.) I hope this toolkit gets used and abused in future scripts. import java.awt.Graphics; // import my watchdog import dreamliner.XPWatchdog; import org.osbot.script.Script; import org.osbot.script.ScriptManifest; import org.osbot.script.rs2.skill.Skill; @ScriptManifest(name = "Dream's Watchdog Tester", author = "Dreamliner", version = 1.0, info = "Watchdog tester. Hope you like!") public class AIO extends Script { // create the watchdog reference XPWatchdog watchdog; Thread t; public void onStart() { log("Waiting for log in"); while (this.client.getLoginState() != 30) { try { sleep(250); } catch (InterruptedException e) { e.printStackTrace(); } } // initialize the watchdog this.watchdog = new XPWatchdog(this.client,this); // create the new watchdog thread this.t = new Thread(this.watchdog); // start the thread this.t.start(); } public int onLoop() throws InterruptedException { return 1000; } public void onPaint(Graphics g) { // pick anything you want to display. g.drawString(this.watchdog.getXpPerPrune(Skill.ATTACK) + " per 5 mins", 300, 300); } public void onExit() { log("thread interrupted"); this.t.interrupt(); } } link to the jar file -> http://goo.gl/Fy2hu link to jar tester -> http://goo.gl/HnqII Methods: public void setPruneTime(int t); // sets the amount of time (in milliseconds) to get rid of data points (> 1000ms) // default: 1000*60*5 ms (5 mins) public int getXpPerPrune(Skill s); // returns the amount of xp gained per prune time for the skill of your choice public int getAllXpPerPrune(); // returns the total amount of xp gained on the account during the prune time. a picture was requested..
  20. I'm looking for this too, if anyone wants to give a hint of where to start
  21. You guys are making this way harder than it needs to be. There's a reason comments exist
  22. Direct ID method is easier on the CPU.
×
×
  • Create New...