Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.ItemEvent;
- import java.awt.*;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.*;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = "Tooth", name = "TBeerStealer")
- public class TBeerStealer extends Script /* implements PaintListener */{
- RSTile bankTile = new RSTile(3270, 3167);
- RSTile beerTile = new RSTile(3319, 3137);
- /* int cupID = 1919;
- int shelvesID = 21794;
- int bankBoothID = 35647;
- int startTime = 0;
- int time = startTime;
- int cups = 0;
- int money = cups * grandExchange.getMarketPrice(cupID);
- int cupsh = cups / time; */
- private final RSTile[] toBank = {
- new RSTile(3311, 3146), new RSTile(3297, 3149),
- new RSTile(3286, 3151), new RSTile(3277, 3157),
- new RSTile(3270, 3167)
- };
- public boolean onStart() {
- mouse.setSpeed(random (2,7));
- if (game.getCurrentTab() != Game.TAB_INVENTORY) {
- game.openTab(Game.TAB_INVENTORY);
- }
- return true;
- }
- @Override
- public int loop() {
- if (inventory.isFull()) {
- if (atBank()) {
- bank();
- } else {
- if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) < random(5, 8)) {
- walking.walkPathMM(toBank, 15);
- }
- }
- } else {
- if (atGrab()) {
- grab();
- } else {
- //
- }
- }
- return random(1200,1800);
- }
- private boolean atGrab() {
- if (calc.distanceTo(beerTile) <= 5) {
- return true;
- }
- return false;
- }
- private void grab() {
- RSObject obj = objects.getNearest(shelvesID);
- if (obj != null) {
- //obj.doClick();
- obj.doAction("search");
- }
- }
- private boolean atBank() {
- if (calc.distanceTo(bankTile) <= 5) {
- return true;
- }
- return false;
- }
- private void bank() {
- bank.open();
- sleep(random(200,400));
- bank.depositAll();
- sleep(random(200,400));
- bank.close();
- sleep(random(200,400));
- cups = cups + inventory.getCount(cupID);
- }
- public void onRepaint(Graphics g1) {
- final Color color1 = new Color(255, 254, 254);
- final Font font1 = new Font("Verdana", 0, 18);
- final Font font2 = new Font("Verdana", 1, 18);
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Cups:" + cups, 575, 250);
- g.drawString("Cups/h:", 575, 275);
- g.drawString("Money:" + money, 575, 300);
- g.drawString("Money/h:", 575, 325);
- g.drawString("Time:", 575, 350);
- g.setFont(font2);
- g.drawString("TCupStealer", 575, 400);
- g.drawString("by Tooth", 575, 425);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement