Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.geom.Area;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.awt.image.BufferedImage;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.*;
- import org.rsbot.script.methods.Bank;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.*;
- import java.io.IOException;
- import java.net.URL;
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.io.PrintWriter;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import java.awt.BasicStroke;
- import java.awt.Container;
- import java.awt.Image;
- @ScriptManifest(authors = {""}, keywords = {""}, name = "Skeleton", description = "boodsbies.", version = 1)
- public class Test extends Script{
- RSTile[] Cows = {
- new RSTile(3205, 3209, 0)
- , new RSTile(3217,3219,0)
- , new RSTile(3234,3222,0)
- , new RSTile(3249,3226,0)
- , new RSTile(3259,3239,0)
- , new RSTile(3250,3252,0)
- , new RSTile(3252,3267,0)};
- RSTile Ne= new RSTile(3263, 3256);
- RSTile Sw= new RSTile(3243, 3293);
- //RSArea CowPen = ("3263, 3256");
- RSArea CowPen = new RSArea(Sw, Ne);
- RSTile BankTile = new RSTile(3208, 3220, 2);
- RSTile TopStairs = new RSTile(3205, 3209, 2);
- RSTile MiddleStairs = new RSTile(3205, 3209, 1);
- RSTile BottomStairs = new RSTile(3205, 3209, 0);
- int CowHide=0;
- int CurrentExp;
- int BankerID= 494;
- int LowLife=200;
- int CowID = 12362;
- int Stairs = 36775;
- boolean Walked = false;
- //private int[] FoodIDS = { 1895, 1893, 1891, 4293, 2142, 291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343,1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229, 6883, 1971, 4608, 1883, 1885, 15272 };
- @Override
- public boolean onStart()
- {
- return true;
- }
- public int loop() {
- log.severe("okay, Started.");
- if(getMyPlayer().getLocation().equals(CowPen) == true && inventory.isFull()==false)
- walkPath(Cows);
- {
- RSNPC Cow = npcs.getNearest(CowID);
- Cow.interact("Attack");
- log.severe("Im at cows.");
- }
- RSTile BankTile = new RSTile(3208, 3220, 2);
- if(getMyPlayer().getLocation().equals(BankTile) == true && bank.isOpen()==false && inventory.isFull()==true)
- {
- bank.open();
- log("Bank open");
- if(bank.isOpen()==true){
- sleep(random(400,400));
- bank.depositAll();
- log("Deposited stuff.");
- sleep(random(400,600));
- if (inventory.empty()==true){
- sleep(random(350,500));
- bank.close();
- log("Bank should close");
- sleep(random(500,600));
- TopStairWalk();
- sleep(random(700,900));
- while(getMyPlayer().isMoving()){
- sleep(100,300);
- }
- sleep(100,300);
- if((!getMyPlayer().getLocation().equals(TopStairs) == true))
- {
- GoDownStairs();
- {
- TopStairWalk();
- }
- if(getMyPlayer().getLocation().equals(BottomStairs) ==false){
- GoDownStairs();
- }
- }
- if(getMyPlayer().getLocation().equals(BottomStairs) ==true){
- try{
- walkPath(Cows);
- }
- finally{
- }
- }
- }
- }}
- return random(100,400);}
- private boolean walkPath(RSTile[] path) {
- if (calc.distanceTo(path[path.length - 1]) > 4) {
- RSTile n = getNext(path);
- if(n!=null){
- walking.walkTileMM(n.randomize(2, 2));
- if(random(1,6) != 2){
- mouse.moveRandomly(20);
- }
- }
- }
- return false;
- }
- private RSTile getNext(RSTile[] path) {
- boolean found = false;
- for (int a = 0; a < path.length&&!found; a++) {
- if(calc.tileOnMap(path[path.length-1-a])){
- found = true;
- return path[path.length-1-a];
- }
- }
- return null;
- }
- private void GoDownStairs()
- {
- RSObject staircase = objects.getNearest(Stairs);
- if(staircase.isOnScreen()==false){
- staircase = objects.getNearest(36774);
- doAction(staircase, "Climb-down");
- }
- doAction(staircase, "Climb-down");
- }
- @Override
- public void onFinish() {
- }
- private boolean doAction(RSObject object, String action) {
- if (object != null) {
- int iters = random(3, 6);
- while (--iters > 0 && !menu.contains(action)) {
- try {
- mouse.move(object.getPoint());
- if (menu.contains(action)) {
- sleep(random(20,100));
- if (menu.contains(action)) {
- break;
- }
- }
- } catch (Exception e) {
- }
- }
- if (menu.contains(action)) {
- return menu.doAction(action);
- } else {
- return false;
- }
- }
- return false;
- }
- private void WalkToCows() {
- RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), CowTile);
- if (walkWeb != null) {
- if (!getMyPlayer().isMoving()
- || calc.distanceTo(walking.getDestination()) < 4) {
- try {
- walkWeb.step();
- } catch (Exception e) {
- }}}}
- private void TopStairWalk() {
- RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), TopStairs);
- if (walkWeb != null) {
- if (!getMyPlayer().isMoving()
- || calc.distanceTo(walking.getDestination()) < 4) {
- try {
- walkWeb.step();
- } catch (Exception e) {
- }}}}
- private void WalkToBank() {
- RSWeb walkWeb = web.getWeb(getMyPlayer().getLocation(), BankTile);
- if (walkWeb != null) {
- if (!getMyPlayer().isMoving()
- || calc.distanceTo(walking.getDestination()) < 4) {
- try {
- walkWeb.step();
- } catch (Exception e) {
- }}}}
- }
Add Comment
Please, Sign In to add comment