Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Cursor;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.RenderingHints;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.LinkedList;
- import java.util.List;
- import java.awt.*;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- import org.rsbot.script.methods.Magic;
- import org.rsbot.script.methods.Skills;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.SwingConstants;
- import javax.swing.WindowConstants;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- @ScriptManifest(authors = "Spin" , name = "ZezimaTabs",
- description = "Exclusive for Zezima Tabs", version = 1.0)
- public class ZezimaTabs extends Script implements PaintListener,
- ServerMessageListener {
- String tabName = " ";
- String kistrue = " ";
- int roundedxpperh = 0;
- int roundedxpgained = 0;
- int moneyroundedmade = 0;
- int moneyroundedperh = 0;
- public int expTab = 0;
- public int tabCounter = 0;
- int currentXP;
- int startXP;
- int gainedXP;
- int xpPerHour;
- public int moneymade = 0;
- public int moneymadeperh = 0;
- long runTime;
- long seconds;
- long minutes;
- long hours;
- public int selectedTab = 0;
- public int tabsperhour = 0;
- public int TabID = 0;
- public int TabPrice = 0;
- public int lumbtele = 8008;
- public int ardotele = 8011;
- public int cametele = 8010;
- public int falatele = 8009;
- public int houstele = 8013;
- public int varrtele = 8007;
- public int btbtele = 8014;
- public int btptele = 8015;
- public int enditele = 8019;
- public int endrtele = 8020;
- public int enemtele = 8017;
- public int enontele = 8021;
- public int enrutele = 8018;
- public int ensatele = 8016;
- public int watctele = 8012;
- public static interface GameConstants {
- int[] LECTERN_IDS = new int[] { 13642, 13643, 13644, 13645, 13646, 13647, 13648 };
- int[] BUTLER_IDS = new int[] { 4241, 4243 };
- int HOUSE_INTERFACE = 232;
- int SOFT_CLAY_INTERFACE = 234;
- int PAYMENT_INTERFACE = 232;
- int PAYMENT_CHAT_INTERFACE = 243;
- int SOFT_CLAY = 1761;
- int PORTAL = 15482;
- int LAW_RUNE = 563;
- int TAB_INTERFACE = 400;
- }
- //Paint Variables
- public long startTime = System.currentTimeMillis();
- private String status = "";
- private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- public static interface PaintConstants {
- RenderingHints RENDERING_HINTS = new RenderingHints(
- RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- Color MOUSE_COLOR = new Color(0, 0, 0, 50);
- Color MOUSE_BORDER_COLOR = new Color(255, 252, 0, 50);
- }
- public static interface Action {
- public void process();
- public boolean isValid();
- }
- public class PortalAction implements Action {
- public void process() {
- if (isInterfaceValid(GameConstants.HOUSE_INTERFACE)) {
- interfaces.getComponent(GameConstants.HOUSE_INTERFACE, 2).doClick();
- sleep(900, 1200);
- } else {
- RSObject portal = objects.getNearest(GameConstants.PORTAL);
- if (portal != null) {
- if (portal.isOnScreen()) {
- if (portal.doAction("Enter")) {
- sleep(500);
- if (!getMyPlayer().isIdle()) {
- sleep(1000);
- }
- }
- } else {
- if (walking.getDestination() == null || calc.distanceBetween(walking.getDestination(), portal.getLocation()) > 4) {
- walking.walkTo(portal.getLocation());
- sleep(750, 900);
- } else {
- idle();
- }
- }
- }
- }
- }
- public boolean isValid() {
- return !hasHousePortal();
- }
- }
- public class BankingAction implements Action {
- public void process() {
- if (isInterfaceValid(GameConstants.SOFT_CLAY_INTERFACE)
- || isInterfaceValid(GameConstants.PAYMENT_CHAT_INTERFACE)
- || isInterfaceValid(GameConstants.PAYMENT_INTERFACE)) {
- if (isInterfaceValid(GameConstants.SOFT_CLAY_INTERFACE)) {
- if (interfaces.getComponent(GameConstants.SOFT_CLAY_INTERFACE, 3).getText().contains("clay")) {
- interfaces.getComponent(GameConstants.SOFT_CLAY_INTERFACE, 3).doClick();
- sleep(750, 1200);
- keyboard.sendText("" + (28 - inventory.getCount()), true);
- sleep(600, 1200);
- } else if (interfaces.getComponent(GameConstants.SOFT_CLAY_INTERFACE, 2).getText().contains("clay")) {
- interfaces.getComponent(GameConstants.SOFT_CLAY_INTERFACE, 2).doClick();
- sleep(500, 700);
- } else {
- interfaces.getComponent(GameConstants.SOFT_CLAY_INTERFACE, 6).doClick();
- sleep(500, 700);
- }
- } else if (isInterfaceValid(GameConstants.PAYMENT_CHAT_INTERFACE)) {
- interfaces.clickContinue();
- sleep(900, 1200);
- } else if (isInterfaceValid(GameConstants.PAYMENT_INTERFACE) && interfaces.getComponent(GameConstants.PAYMENT_INTERFACE, 3).getText().contains("bank")) {
- interfaces.getComponent(GameConstants.PAYMENT_INTERFACE, 3).doClick();
- sleep(1000, 1200);
- } else if (isInterfaceValid(GameConstants.PAYMENT_INTERFACE)) {
- interfaces.getComponent(GameConstants.PAYMENT_INTERFACE, 5).doClick();
- sleep(1000, 1200);
- }
- return;
- }
- RSObject door = objects.getNearest(doorFilter);
- if (door != null) {
- if(door.doAction("Open")) {
- sleep(700);
- } else {
- return;
- }
- }
- RSNPC butler = npcs.getNearest(GameConstants.BUTLER_IDS);
- if (butler != null) {
- if (butler.isOnScreen()) {
- sleep(750);
- if (canCraft()) {
- return;
- }
- if (butler.doAction("Fetch-from-bank")) {
- sleep(3000);
- if (!getMyPlayer().isIdle()) {
- sleep(3000);
- }
- }
- } else {
- if (walking.getDestination() == null || calc.distanceBetween(walking.getDestination(), butler.getLocation()) > 4) {
- walking.walkTo(butler.getLocation());
- sleep(750, 900);
- } else {
- idle();
- }
- }
- } else {
- idle();
- }
- }
- public boolean isValid() {
- return !canCraft() && hasHousePortal();
- }
- }
- public class WaitingAction implements Action {
- int ticks = 0;
- public void process() {
- if (getMyPlayer().getAnimation() != -1) {
- ticks = 0;
- idle();
- } else if (ticks > 30) {
- setCrafting(false);
- ticks = 0;
- } else {
- ticks ++;
- idle();
- }
- }
- public boolean isValid() {
- return canCraft() && isCrafting() && hasHousePortal();
- }
- }
- public class CraftingAction implements Action {
- public void process() {
- if (isInterfaceValid(GameConstants.TAB_INTERFACE)) {
- RSComponent tab = interfaces.getComponent(GameConstants.TAB_INTERFACE, craftingTab);
- if (tab != null && tab.isValid()) {
- tab.doAction("Make-all");
- setCrafting(true);
- sleep(600);
- }
- } else {
- if (lectern == null) {
- lectern = objects.getNearest(GameConstants.LECTERN_IDS);
- }
- if (lectern != null) {
- RSObject door = objects.getNearest(doorFilter);
- if (door != null) {
- if(door.doAction("Open")) {
- sleep(700);
- } else {
- return;
- }
- }
- if (lectern.isOnScreen()) {
- if(lectern.doAction("Study")) {
- sleep(900, 1200);
- if (!getMyPlayer().isIdle()) {
- sleep(1000);
- }
- }
- } else {
- if (walking.getDestination() == null || calc.distanceBetween(walking.getDestination(), lectern.getLocation()) > 4) {
- walking.walkTo(lectern.getLocation());
- sleep(750, 900);
- } else {
- idle();
- }
- }
- }
- }
- }
- public boolean isValid() {
- return canCraft() && !isCrafting() && hasHousePortal();
- }
- }
- private List<Action> actions = new LinkedList<Action>();
- private RSObject lectern;
- private int craftingTab = -1;
- private boolean crafting = false;
- private Filter<RSObject> doorFilter = new Filter<RSObject>() {
- public boolean accept(RSObject t) {
- if (t.getDef() == null || t.getDef().getName() == null) {
- return false;
- }
- if (calc.distanceTo(t) > 2) {
- return false;
- }
- if (t.getDef().getName().equals("Door") && t.getDef().getActions() != null && t.getDef().getActions().length > 0) {
- for (String action : t.getDef().getActions()) {
- if (action == null)
- continue;
- if (action.equals("Open")) {
- return true;
- }
- }
- }
- return false;
- }
- };
- private ArbiTabsGUI gui = new ArbiTabsGUI();
- private int[] CRAFTING_TABS = new int[] { 15, 13, 5, 2, 14, 16, 11, 8, 10, 6, 7, 9, 3, 4 };
- private int[] SELECTED_TAB = new int[] { varrtele, lumbtele, cametele, ardotele, houstele, watctele, ensatele, enemtele, enrutele, enditele, endrtele, enontele, btbtele, btptele };
- private int[] EXP_TAB = new int[] { 35, 41, 55, 61, 30, 68, 17, 37, 59, 67, 78, 97, 25, 65 };
- private String[] TAB_NAME = new String[] { "Varrock", "Lumbridge", "Camelot", "Ardounge", "House", "WatchTower", "Sapphire", "Emerald", "Ruby", "Diamond", "Dragon", "Onyx", "Bannanas", "Peaches" };
- public boolean onStart() {
- log.severe("Welcome to ZezimaTabs's clan chat only B2P tab maker");
- log.severe("Created by some fool, rewritten/sped up/ fixed by Spin=]");
- log.severe("Happy Tab Making!");
- log("Do I get some type of reward for this? ;P");
- startXP = skills.getCurrentExp(Skills.MAGIC);
- gui.setVisible(true);
- while (!gui.isStart()) {
- sleep(100, 200);
- }
- selectedTab = SELECTED_TAB[gui.comboBox1.getSelectedIndex()];
- tabName = TAB_NAME[gui.comboBox1.getSelectedIndex()];
- expTab = EXP_TAB[gui.comboBox1.getSelectedIndex()];
- craftingTab = CRAFTING_TABS[gui.comboBox1.getSelectedIndex()];
- actions.add(new WaitingAction());
- actions.add(new CraftingAction());
- actions.add(new BankingAction());
- actions.add(new PortalAction());
- mouse.setSpeed(1);
- return true;
- }
- public void onFinish() {
- log.severe("Ran For howeverlong you ran it for.");
- log.severe("In Addition I hope it worked fine. ");
- log.severe("Thanks for using ZezimaTabs =]");
- }
- public int loop() {
- for (Action action : actions) {
- if (action.isValid()) {
- action.process();
- return random(100, 200);
- }
- }
- return -1;
- }
- private boolean hasHousePortal() {
- return objects.getNearest(13405) != null;
- }
- private boolean canCraft() {
- return inventory.getCount(GameConstants.SOFT_CLAY) > 0;
- }
- private boolean isInterfaceValid(int interfaceId) {
- return interfaces.getComponent(interfaceId, 0).isValid();
- }
- private void idle() {
- if (random(0, 50) == 0) {
- int rand2 = random(1, 3);
- for (int i = 0; i < rand2; i++) {
- mouse.move(random(100, 500), random(100, 300));
- sleep(random(200, 500));
- }
- mouse.move(random(0, 400), 647, 50, 100);
- sleep(random(100, 750));
- mouse.move(random(75, 400), random(75, 400), 30);
- }
- if (random(0, 50) == 0) {
- Point curPos = mouse.getLocation();
- mouse.move(random(0, 500), random(0, 300), 20);
- sleep(random(100, 300));
- mouse.move(curPos, 20, 20);
- }
- if (random(0, 50) == 0) {
- int angle = camera.getAngle() + random(-40, 40);
- if (angle < 0) {
- angle += 359;
- }
- if (angle > 359) {
- angle -= 359;
- }
- camera.setAngle(angle);
- }
- if (random(0, 50) == 0) {
- if (random(0, 4) == 0) {
- camera.setPitch(random(50, 80));
- } else {
- camera.setPitch(true);
- }
- }
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- }
- public void setCrafting(boolean crafting) {
- this.crafting = crafting;
- }
- public boolean isCrafting() {
- return crafting;
- }
- private class ArbiTabsGUI extends JFrame {
- private static final long serialVersionUID = 1L;
- private boolean start = false;
- public ArbiTabsGUI() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- setStart(true);
- this.setVisible(false);
- }
- private void initComponents() {
- label1 = new JLabel();
- comboBox1 = new JComboBox();
- label2 = new JLabel();
- button1 = new JButton();
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- setTitle("AutoTabMaker");
- setAlwaysOnTop(true);
- setResizable(false);
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- label1.setText("AutoTabMaker");
- label1.setHorizontalAlignment(SwingConstants.CENTER);
- label1.setFont(new Font("Verdana", Font.PLAIN, 16));
- contentPane.add(label1);
- label1.setBounds(0, 0, 395, 25);
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Varrock Teleport",
- "Lumbridge Teleport",
- "Camelot Teleport",
- "Ardougne Teleport",
- "Home Teleport",
- "Watchtower Teleport",
- "Enchant Saphire",
- "Enchant Emerald",
- "Enchant Ruby",
- "Enchant Diamond",
- "Enchant Dragonstone",
- "Enchant Onyx",
- "Bones To Bananas",
- "Bones To Peaches"
- }));
- comboBox1.setFont(new Font("Verdana", Font.PLAIN, 12));
- contentPane.add(comboBox1);
- comboBox1.setBounds(85, 30, 300, 35);
- label2.setText("Make Tab:");
- label2.setFont(new Font("Verdana", Font.PLAIN, 14));
- label2.setLabelFor(comboBox1);
- contentPane.add(label2);
- label2.setBounds(new Rectangle(new Point(5, 35), label2.getPreferredSize()));
- button1.setText("Start");
- button1.setFont(new Font("Verdana", Font.PLAIN, 14));
- button1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- contentPane.add(button1);
- button1.setBounds(new Rectangle(new Point(315, 70), button1.getPreferredSize()));
- {
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- setSize(400, 135);
- setLocationRelativeTo(null);
- }
- public void setStart(boolean start) {
- this.start = start;
- }
- public boolean isStart() {
- return start;
- }
- private JLabel label1;
- private JComboBox comboBox1;
- private JLabel label2;
- private JButton button1;
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- public void onRepaint(Graphics g1) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement