Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Point;
- import java.util.ArrayList;
- import org.parabot.core.ui.components.LogArea;
- import org.parabot.environment.api.interfaces.Paintable;
- import org.parabot.environment.api.utils.Time;
- import org.parabot.environment.api.utils.Timer;
- import org.parabot.environment.scripts.Category;
- import org.parabot.environment.scripts.ScriptManifest;
- import org.parabot.environment.scripts.Script;
- import org.parabot.environment.scripts.framework.Strategy;
- import org.rev317.accessors.NpcDef;
- import org.rev317.api.events.MessageEvent;
- import org.rev317.api.events.listeners.MessageListener;
- import org.rev317.api.methods.Bank;
- import org.rev317.api.methods.Camera;
- import org.rev317.api.methods.Interfaces;
- import org.rev317.api.methods.Inventory;
- import org.rev317.api.methods.Menu;
- import org.rev317.api.methods.Npcs;
- import org.rev317.api.methods.Players;
- import org.rev317.api.methods.SceneObjects;
- import org.rev317.api.methods.Skill;
- import org.rev317.api.methods.Walking;
- import org.rev317.api.wrappers.hud.Interface;
- import org.rev317.api.wrappers.hud.Item;
- import org.rev317.api.wrappers.hud.Tab;
- import org.rev317.api.wrappers.interactive.Character;
- import org.rev317.api.wrappers.interactive.Npc;
- import org.rev317.api.wrappers.scene.Area;
- import org.rev317.api.wrappers.scene.SceneObject;
- import org.rev317.api.wrappers.scene.Tile;
- import org.rev317.api.wrappers.walking.TilePath;
- import org.rev317.api.methods.Interfaces;
- @ScriptManifest(author = "Brookpc", category = Category.THIEVING, description = "Steals and Sells items on UltimateScape 2", name = "USThiever", servers = { "UltimateScape" }, version = 1.0)
- public class USThiever extends Script implements Paintable, MessageListener {
- private final ArrayList<Strategy> strategies = new ArrayList<Strategy>();
- public static Area TA = new Area (new Tile(2676, 3324, 0), new Tile(2648, 3324, 0), new Tile(2645, 3289, 0), new Tile(2672, 3289, 0));
- public int npcID;
- public int stallID;
- public int startlvl;
- public int[] sellIDs = {950, 1891, 1901,2309,958,4658}; //Silk, Cake, Chocolate Slice,Bread,Wolf Fur,Silver Pot
- public int curlvl;
- public int lvlcount;
- public int cashMade;
- public int infID;
- private final Color color1 = new Color(229, 255, 59);
- private final Font font1 = new Font("Arial", 0, 20);
- private final Font font2 = new Font("Arial", 0, 14);
- private final Color color2 = new Color(225, 50, 55);
- private final Timer RUNTIME = new Timer();
- @Override
- public boolean onExecute() {
- startlvl = Skill.THIEVING.getLevel();
- curlvl = Skill.THIEVING.getLevel();
- if (startlvl < 20)
- stallID = 1616;
- else if (curlvl >= 20 && curlvl <35)
- stallID = 1615;
- else if (curlvl >= 35 && curlvl < 50)
- stallID = 1614;
- else if (curlvl >= 50 && curlvl < 65)
- stallID = 1619;
- else if (curlvl >= 65 && curlvl < 75)
- stallID = 1618;
- else if (curlvl >=75)
- stallID = 1617;
- strategies.add(new steal());
- strategies.add(new trade());
- provide(strategies);
- return true;
- }
- public void atlvlchange() {
- lvlcount = (curlvl - startlvl);
- return;
- }
- public class steal implements Strategy{
- @Override
- public boolean activate() {
- final SceneObject Stalls[] = SceneObjects.getNearest(stallID);
- final SceneObject Stall = Stalls[0];
- return !Inventory.isFull()
- && TA.contains(Players.getLocal().getLocation())
- && Stall != null;
- }
- @Override
- public void execute() {
- atlvlchange();
- final SceneObject Stalls[] = SceneObjects.getNearest(stallID);
- final SceneObject Stall = Stalls[0];
- if (Stall.isOnScreen() && Players.getLocal().getAnimation() == -1 && !Players.getLocal().isWalking()) {
- Stall.interact("");
- Time.sleep(1000);
- } else if (!Stall.isOnScreen() && Players.getLocal().getAnimation() == -1){
- Tile Loc = Stall.getLocation();
- Loc.clickMM();
- Time.sleep(1000);
- }
- while (Players.getLocal().getAnimation() != -1) {
- Time.sleep(1000);
- }
- }
- }
- public class trade implements Strategy{
- @Override
- public boolean activate() {
- final Npc Sells[] = Npcs.getNearest(2270);
- final Npc Marty = Sells[0];
- return Inventory.isFull()
- && TA.contains(Players.getLocal().getLocation())
- && Marty != null;
- }
- @Override
- public void execute() {
- final Npc Sells[] = Npcs.getNearest(2270);
- final Npc Marty = Sells[0];
- LogArea.log("Interface ID: " + Interfaces.getOpenInterfaceId());
- if (Interfaces.getOpenInterfaceId() != 3824 && Marty != null) {
- Npcs.getNearest(2270)[0].interact("Trade");
- Time.sleep(200);
- } else if (Interfaces.getOpenInterfaceId() == 3824) {
- for (Item i : Inventory.getItems(sellIDs)) {
- i.interact("Sell 50");
- }
- Time.sleep(1000);
- } else if (Marty == null) {
- Time.sleep(200);
- }
- Time.sleep(100);
- }
- }
- @Override
- public void messageReceived(MessageEvent arg0) {
- }
- @Override
- public void paint(Graphics arg0) {
- Graphics2D g = (Graphics2D) arg0;
- g.setColor(new Color(0f, 0f, 0f, .5f));
- g.fillRect(4, 23, 150, 65);
- g.setColor(color2);
- g.setFont(font1);
- g.drawString("USThiever", 6, 43);
- g.setFont(font2);
- g.setColor(color1);
- g.drawString("Levels Gained: " + lvlcount, 6, 57);
- g.drawString("Runtime: " + RUNTIME, 6, 83);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement