Jump to content

Reid

Members
  • Posts

    804
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Reid

  1. Good drop and build up but lyrics are shit
  2. Andrew aka Anjew = fox,swift,carnival
  3. Reid

    AccuXP - [API]

    Didn't even know this existed :p Thanks for letting me know
  4. Reid

    AccuXP - [API]

    +1 which is why i posted.
  5. I'd suggest dropbox 100% uptime
  6. Reid

    AccuXP - [API]

    Did i say anything is special? I made it for myself to use and decided to post so other people can also use and it can possibly help new scripters.... fkin anjew
  7. Reid

    AccuXP - [API]

    Meant for new scripters. If you're going to hate go away. Enjoy. package org.purplekush.api; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import org.osbot.script.Script; import org.osbot.script.rs2.skill.Skill; /** * * @author Reid (PurpleKush) * @version 0.1 */ public class AccuXP { public static String status; private Script s; private static long startTime; private static int skillToTrackXP; private static Skill skillTracking; public AccuXP(Script s) { this.s = s; } /** * Starts Timer */ public void startTimer() { startTime = System.currentTimeMillis(); } /** * What skill you would like to track * @param skill */ public void trackXPForSkill(Skill skill) { skillToTrackXP = s.client.getSkills().getExperience(skill); skillTracking = skill; } /** * Paint data to canvas * @param g */ public void calculatePaint(Graphics g) { int totalXP = s.client.getSkills().getExperience(skillTracking) - skillToTrackXP; long millis = System.currentTimeMillis() - startTime; int xpPH = (int) (totalXP * 3600000.0D / millis); g.setColor(Color.WHITE); g.setFont(new Font("Myriad Pro", Font.PLAIN, 16)); g.drawString("Time Running : "+ getFormattedTime(System.currentTimeMillis()- startTime), 7, 275); g.drawString("Status : " + status, 7, 295); g.drawString("XP P/H : " + xpPH, 7, 315); g.drawString("XP Gained : " + totalXP, 7, 335); } private String getFormattedTime(final long timeMilliseconds) { final StringBuilder b = new StringBuilder(); final long runtime = timeMilliseconds; final long totalSecs = runtime / 1000; final long totalMins = totalSecs / 60; final long totalHours = totalMins / 60; final int seconds = (int) totalSecs % 60; final int minutes = (int) totalMins % 60; final int hours = (int) totalHours % 60; if (hours < 10) { b.append("0"); } b.append(hours); b.append(":"); if (minutes < 10) { b.append("0"); } b.append(minutes); b.append(":"); if (seconds < 10) { b.append("0"); } b.append(seconds); return b.toString(); } } Usage: AccuXP xp = new AccuXP(this); public void onStart(){ xp.startTimer(); xp.trackXPForSkill(Skill.COOKING); } public void onPaint(Graphics g){ xp.calculatePaint(g); }
  8. Reid

    Condition

    public abstract interface Condition { public abstract boolean active(); public abstract void run() throws InterruptedException; } Example of usage: (shit script wrote it fast for the sake of this tutorial.) public int onLoop() throws InterruptedException { if(canMine.active()){ canMine.run(); } if(canDrop.active()){ canDrop.run(); } return 10; } public Condition canMine = new Condition() { @Override public boolean active() { Global.status = "Searching for ore"; Global.rock = closestObject(Global.ROCK_ID_1, Global.ROCK_ID_2,Global.ROCK_ID_3); return Global.rock != null && !client.getInventory().isFull() && Global.rock.getPosition().distance(client.getMyPlayer().getPosition()) <= 5; } @Override public void run() throws InterruptedException { if(Global.rock != null){ Global.rock.interact("Mine"); Global.status = "Mining"; sleep(random(1000,1800)); while(client.getMyPlayer().isMoving() || client.getMyPlayer().isAnimating() || client.getMyPlayer().isUnderAttack()){ sleep(10); } } } }; public Condition canDrop = new Condition(){ @Override public boolean active() { return client.getInventory().getTotalItemsAmount() >= 28; } @Override public void run() throws InterruptedException { Global.status = "Dropping ore"; client.getInventory().dropAllExcept(Global.PICK_IDS); } };
  9. Checks if script version is up to date via a text file located online! /** * @author Reid (PurpleKush) * @param currentVersion * @param txtLocation * @return up to date or not * @throws IOException */ public static boolean versionCheck(final double currentVersion,final String txtLocation) throws IOException { final URL url = new URL(txtLocation); final BufferedReader file = new BufferedReader(new InputStreamReader(url.openStream())); final String onlineVersion = file.readLine(); file.close(); return Double.parseDouble(onlineVersion) == currentVersion; }
  10. water bottle + bic pen + tin foil
  11. Wow thanks for this
×
×
  • Create New...