Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.util.ArrayList;
- import java.util.Arrays;
- import xobot.client.callback.listeners.PaintListener;
- import xobot.script.ActiveScript;
- import xobot.script.Manifest;
- import xobot.script.methods.Bank;
- import xobot.script.methods.GameObjects;
- import xobot.script.methods.NPCs;
- import xobot.script.methods.Packets;
- import xobot.script.methods.Players;
- import xobot.script.methods.Walking;
- import xobot.script.methods.tabs.Inventory;
- import xobot.script.methods.tabs.Skills;
- import xobot.script.util.Timer;
- import xobot.script.wrappers.Tile;
- import xobot.script.wrappers.WidgetChild;
- import xobot.script.wrappers.interactive.GameObject;
- import xobot.script.wrappers.interactive.Item;
- import xobot.script.wrappers.interactive.NPC;
- import xobot.script.methods.Widgets;
- import xobot.script.methods.input.KeyBoard;
- import xobot.script.util.Time;
- @Manifest(authors = { "Casual" }, name = "fThiever 0.1")
- public final class fThieve extends ActiveScript implements PaintListener{
- private Timer t;
- private int startxp = 0;
- public static void teleport(String location) {
- final NPC wizard = NPCs.getNearest(4397);
- if(wizard != null) {
- final WidgetChild prev = Widgets.getWidgetChild(42860954);
- if(prev != null && prev.getText().toLowerCase().startsWith(location.toLowerCase())) {
- wizard.interact("prev");
- return;
- }else {
- if(Widgets.isVisible(654)) {
- WidgetChild[] options = Widgets.get(654).getChildren();
- for(WidgetChild option : options) {
- final String text = option.getText();
- if(text != null && !text.isEmpty() && text.toLowerCase().trim().startsWith(location.toLowerCase())) {
- Packets.sendAction(0, option.getId(), 8, 0, "", "Ok");
- Time.sleep(150);
- Packets.sendAction(0, 42860643, 28, 0, "", "Close");
- }
- }
- }else {
- wizard.interact("talk-to");
- Time.sleep(() -> Widgets.isVisible(654), 750);
- Time.sleep(150);
- teleport(location);
- }
- }
- }
- }
- public void bank() {
- GameObject obj = GameObjects.getNearest(6943);
- if (!Players.getMyPlayer().isMoving() && !Bank.isOpen() && obj != null && Inventory.isFull()) {
- obj.interact("Bank");
- Time.sleep(5000);
- } else {
- Tile t = new Tile(3086, 3250);
- while (!Players.getMyPlayer().isMoving()) {
- Walking.walkTo(t);
- Time.sleep(1000);
- }
- }
- if (Bank.isOpen()) {
- if(Inventory.isFull()) {
- Bank.depositAll();
- Time.sleep(150);
- }
- } else {
- return;
- }
- }
- public boolean onStart() {
- t = new Timer(System.currentTimeMillis());
- startxp = Skills.getCurrentExp(Skills.THIEVING);
- KeyBoard.typeWord("::home", true);
- Time.sleep(3500);
- teleport("draynor village");
- Time.sleep(5000);
- Walking.walkTo(new Tile(3086, 3250));
- return true;
- }
- @Override
- public int loop() {
- final int npc;
- npc = 3257;
- NPC farmer = NPCs.getNearest(npc);
- if (Inventory.isFull()) {
- bank(); }
- if(farmer != null) {
- farmer.interact("pickpocket");
- return 2700;
- }
- return 1000;
- }
- private final Color color1 = new Color(255, 255, 255, 84);
- private final Color color2 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 23);
- private final Font font2 = new Font("Arial", 0, 16);
- @Override
- public void repaint(Graphics g1) {
- int xp = Skills.getCurrentExp(Skills.THIEVING) - startxp;
- int ph = (int) ((xp) * 3600000D / (t.getElapsed()));
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRect(343, 155, 171, 183);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(343, 155, 171, 183);
- g.setFont(font1);
- g.drawString("fThiever 0.1", 367, 184);
- g.setFont(font2);
- g.drawString("Time: " + t.toElapsedString(), 352, 219);
- g.drawString("XP: " + format(xp), 352, 249);
- g.drawString("XP(h): " + format(ph), 352, 277);
- }
- public String format(int i) {
- if(i > 1000000) {
- return (i / 1000000) + "M";
- }else if(i > 1000) {
- return (i / 1000) + "K";
- }
- return String.valueOf(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement