Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xobot.client.events.MessageEvent;
- import java.text.NumberFormat;
- import java.util.Locale;
- import java.awt.Color;
- import java.awt.Graphics;
- import xobot.script.wrappers.interactive.GameObject;
- import xobot.script.wrappers.interactive.Item;
- import xobot.script.wrappers.interactive.NPC;
- import xobot.script.methods.NPCs;
- import xobot.script.methods.Bank;
- import xobot.script.methods.GameObjects;
- import xobot.script.methods.tabs.Inventory;
- import xobot.script.methods.tabs.Skills;
- import xobot.script.util.Time;
- import xobot.script.methods.Players;
- import xobot.script.methods.Shop;
- import xobot.script.methods.Packets;
- import xobot.script.methods.Widgets;
- import xobot.script.methods.input.KeyBoard;
- import xobot.script.methods.Walking;
- import xobot.script.util.Timer;
- import xobot.script.Manifest;
- import xobot.client.callback.listeners.MessageListener;
- import xobot.client.callback.listeners.PaintListener;
- import xobot.script.ActiveScript;
- import xobot.script.wrappers.Tile;
- @Manifest(authors = { "Simmy" }, name = "Universal Rug Maker", description = "Will Make Rugs Until 70 Construction (Requires Just Cash)", version = 1.01)
- public class SimmysRugMaker extends ActiveScript implements PaintListener, MessageListener{
- private int ConExp = 0;
- private int ConLevel = 0;
- private Timer Timer;
- public static int Rugs = 0;
- String status = "We Are Currently Starting The Script Up; Please Kick Back And Relax!";
- public boolean onStart() {
- this.Timer = new Timer();
- this.ConExp = Skills.CONSTRUCTION.getCurrentExp();
- this.ConLevel = Skills.CONSTRUCTION.getCurrentLevel();
- return true;
- }
- @Override
- public void MessageRecieved(MessageEvent message) {
- if (message.getMessage().contains("Congratulations"));
- }
- @Override
- public void repaint(Graphics g) {
- final int ConXp = Skills.CONSTRUCTION.getCurrentExp() - this.ConExp;
- final int CLevels = Skills.CONSTRUCTION.getCurrentLevel() - this.ConLevel;
- final int RugsHr = (int)(Rugs * 3600000.0 / this.Timer.getElapsed());
- final int ConXPs = (int)(ConXp * 3600000.0 / this.Timer.getElapsed());
- g.setColor(Color.YELLOW);
- g.drawString("Current Status: " + status, 15, 230);
- g.drawString("Time Running: " + this.Timer.toElapsedString(), 15, 245);
- g.drawString("Rugs Made: " + Rugs, 15, 260);
- g.drawString("Rugs Made(p/hr): " + NumberFormat.getNumberInstance(Locale.US).format(RugsHr), 15, 275);
- g.drawString("Construction Exp Gained: " + NumberFormat.getNumberInstance(Locale.US).format(ConXp), 15, 290);
- g.drawString("Construction Exp(p/hr): " + NumberFormat.getNumberInstance(Locale.US).format(ConXPs), 15, 305);
- g.drawString("Construction Levels Gained: " + CLevels, 15, 320);
- }
- @Override
- public int loop() {
- //Add Variables Here;
- NPC Sawmill = NPCs.getNearest(4250);
- Item BCloth = Inventory.getItem(8790);
- GameObject Portal = GameObjects.getNearest(15477);
- GameObject CPortal = GameObjects.getNearest(13405);
- GameObject ERug = GameObjects.getNearest(15273);
- GameObject MRug = GameObjects.getNearest(13592);
- if (Sawmill != null & BCloth == null & Portal != null & CPortal == null & Widgets.getOpenInterface() == -1) {
- status = "Attempting To Interact With Sawmill Operator!";
- Sawmill.interact("Trade");
- Time.sleep(() -> Widgets.getBackDialogId() == 3824, 2500);
- }
- else if (Sawmill != null & BCloth == null & Portal != null & CPortal == null & Widgets.getOpenInterface() == 3824) {
- status = "Buying Bolts Of Cloth From Sawmill Operator!";
- Shop.buy(8790, 24);
- Time.sleep(() -> BCloth != null, 1000);
- } else {
- if (Sawmill != null & BCloth != null & Portal != null & CPortal == null) {
- status = "Attempting To Interact With The Construction Portal! (Entering Build Mode!)";
- Portal.interact("Build mode");
- Time.sleep(() -> ERug != null | MRug != null, 2500);
- } else {
- if (Sawmill == null & BCloth == null & ERug != null & MRug == null & CPortal != null) {
- status = "Attempting To Interact With The Construction Portal! (Going To Sawmill!)";
- CPortal.interact("Enter");
- Time.sleep(() -> Sawmill != null, 2500);
- } else {
- if (Sawmill == null & BCloth != null & CPortal != null & ERug != null & MRug == null & Widgets.getOpenInterface() == -1) {
- status = "Attempting To Build An Ordinary Rug! (Opening Build Dialog)";
- ERug.interact("Build");
- Time.sleep(() -> Widgets.getOpenInterface() == 39550, 500);
- }
- else if (Sawmill == null & BCloth != null & CPortal != null & ERug != null & MRug == null & Widgets.getOpenInterface() == 39550) {
- status = "Attempting To Build An Ordinary Rug! (Confirming Build Dialog)";
- Packets.sendAction(632, 8317, 0, 39601);
- Time.sleep(() -> MRug != null, 750);
- } else {
- if (Sawmill == null & CPortal != null & ERug == null & MRug != null & Widgets.getBackDialogId() == -1) {
- status = "Attempting To Remove An Ordinary Rug! (Opening Remove Dialog)";
- MRug.interact("Remove");
- Time.sleep(() -> Widgets.getBackDialogId() == 2459, 1000);
- }
- else if (Sawmill == null & CPortal != null & ERug == null & MRug != null & Widgets.getBackDialogId() == 2459) {
- status = "Attempting To Remove An Ordinary Rug! (Confirming Remove Dialog)";
- Packets.sendAction(315, 11, -1, 2461);
- Time.sleep(() -> ERug != null, 1000);
- Rugs += 1;
- }
- }
- }
- }
- }
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement