Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.util.LinkedList;
- import java.util.List;
- import org.runedream.api.Script;
- import org.runedream.api.ScriptManifest;
- import org.runedream.api.methods.*;
- import org.runedream.api.util.Log;
- import org.runedream.api.util.Random;
- import org.runedream.api.util.Time;
- import org.runedream.api.wrappers.Tab;
- @ScriptManifest(
- authors = { "Nissan Nut" },
- name = "Tea Stealer",
- version = 1.1,
- description = "Script Skeleton.",
- keywords = { "tea", "jbot", "theiving", "nissan nut"},
- language = { true, true, true, true })
- public class TeaStealer extends Script{
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- private int xpGained = 0;
- private int teaHour = 0;
- private int xpHour = 0;
- private long startTime = 0;
- private int inventory = 0;
- private int stolen = 0;
- private static final Color tea = new Color(85, 77, 73);
- private static final Color stall = new Color(228, 216, 196);
- private List<Point> teaPoints = new LinkedList<Point>();
- private List<Point> stallPoints = new LinkedList<Point>();
- private static final Rectangle CLOSEVIEW = new Rectangle(290, 110, 360, 190);
- @Override
- public boolean onStart(){
- Game.clickCompass();
- Camera.pitchUp(1000);
- Inventory.open();
- return true;
- }
- @Override
- public int loop() {
- Mouse.setSpeed(Random.random(4, 7));
- inventory = Inventory.getCount();
- stallPoints = ImageUtil.getPointsWithColor(Game.getImage(), stall, 0.01);
- if (stallPoints.size() > 0){
- Point Stall = stallPoints.get(Random.random(0, stallPoints.size()));
- teaPoints = ImageUtil.getPointsWithColor(Game.getImage(), tea, 0.01);
- if (teaPoints.size() > 0){
- Point Tea = teaPoints.get(Random.random(0, teaPoints.size()));
- if (CLOSEVIEW.contains(Tea)){
- Time.sleep(25, 250);
- Mouse.click(Stall);
- if (!Inventory.isFull()){
- Time.sleep(7975);
- }
- }
- }
- }
- if (Inventory.getCount() > inventory){
- stolen++;
- }
- if (Inventory.isFull()){
- for(int i = 0; i < 28; i++){
- if(Inventory.getSlotAt(i).isEmpty())
- continue;
- final Point CENTER = Inventory.getSlotAt(i).getCenter();
- final Point CLICK = new Point(Random.random(CENTER.x - 6, CENTER.x + 6), Random.random(CENTER.y - 6, CENTER.y + 6));
- Mouse.click(CLICK, false);
- Time.sleep(400, 600);
- if(Mouse.getLocation().y > 403){
- Point p = new Point((int) (Mouse.getLocation().x + (Random.random(-10, 10))), Random.random(455, 470));
- if (Game.isPointValid(p)) {
- Mouse.click(p);
- }
- }else{
- Point p = new Point((int) (Mouse.getLocation().x + (Random.random(-10, 10))), (int) (Mouse.getLocation().y + (Random.random(54, 67))));
- if (Game.isPointValid(p)) {
- Mouse.click(p);
- }
- }
- Time.sleep(500, 800);
- }
- }
- antiban();
- return 1;
- }
- private void antiban() {
- switch (Random.random(1, 100)){
- case 1:
- Mouse.moveOffScreen();
- Time.sleep(1000, 3000);
- break;
- case 2:
- Mouse.moveSlightly();
- break;
- case 3:
- Camera.pitchDown(100);
- Camera.pitchUp(150);
- break;
- case 4:
- Tabs.openTab(Tab.STATS);
- Time.sleep(100, 500);
- Mouse.moveSlightly();
- Time.sleep(1000, 3000);
- Inventory.open();
- Time.sleep(100, 500);
- break;
- case 5:
- Time.sleep(1000, 3000);
- break;
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D) g1;
- millis = System.currentTimeMillis() - startTime;
- hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- seconds = millis / 1000;
- xpGained = (int) (stolen*16);
- teaHour = (int) ((stolen) * 3600000D / (System.currentTimeMillis() - startTime));
- xpHour = (int) (teaHour*16);
- g.drawString("Tea Stealer by Nissan Nut", 12, 280);
- g.drawString("Runtime: " + hours +":"+ minutes + ":" + seconds, 12, 290);
- g.drawString("Tea Stolen: "+ stolen, 12, 300);
- g.drawString("Tea/Hour: "+ teaHour, 12, 310);
- g.drawString("XP Gained: "+ xpGained, 12, 320);
- g.drawString("XP/Hour: "+ xpHour, 12, 330);
- }
- @Override
- public void onStop(){
- Log.log("Tea's Stolen: " + stolen);
- Log.log("XP Gained: " + stolen*16);
- }
- }
Add Comment
Please, Sign In to add comment