Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import com.speljohan.rsbot.bot.Bot;
- import com.speljohan.rsbot.event.listeners.PaintListener;
- import com.speljohan.rsbot.script.Script;
- import com.speljohan.rsbot.script.wrappers.*;
- import java.util.Map;
- import javax.swing.JOptionPane;
- import javax.swing.*;
- import java.awt.geom.*;
- import sun.net.ftp.*;
- import com.speljohan.rsbot.bot.Bot;
- import com.speljohan.rsbot.event.events.ServerMessageEvent;
- import com.speljohan.rsbot.event.listeners.PaintListener;
- import com.speljohan.rsbot.event.listeners.ServerMessageListener;
- import com.speljohan.rsbot.script.Script;
- import com.speljohan.rsbot.script.Skills;
- import com.speljohan.rsbot.script.wrappers.*;
- import com.speljohan.rsbot.script.Bank;
- import java.awt.event.ActionListener;
- import java.util.Map;
- import java.net.*;
- import java.io.*;
- import java.util.Date;
- import java.net.MalformedURLException;
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.JOptionPane.*;
- import javax.swing.JOptionPane;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.net.URLConnection;
- public class CrapSoulWars extends Script implements PaintListener {
- //out-of-game locations.
- int[] bankarea = new int[]{3186,3175,1903,1877};//n,s,e,w.
- int[] offtrack_west = new int[]{3174,3168,1883,1878};
- int[] offtrack_east = new int[]{3174,3168,1906,1897};
- int[] waitinggraveyard_east = new int[]{3174,3166,1896,1892};
- int[] waitinggraveyard_west = new int[]{3174,3166,1888,1884};
- int[] portalarea = new int[]{3165,3151,1899,1880};
- int[] walkway = new int[]{3174,3166,1891,1889};
- int[] waitingarea_red = new int[]{3166,3157,1909,1900};
- int[] waitingarea_blue = new int[]{3166,3159,1879,1870};
- RSTile portalloc_balance = new RSTile(1890,3162);
- RSTile portalloc_blue = new RSTile(1899,3162);
- RSTile portalloc_red = new RSTile(1880,3162);
- //in-game locations.
- int[] safezone_blue = new int[]{3230,3220,1823,1816};
- int[] safezone_red = new int[]{3244,3234,1958,1951};
- int[] base_red = new int[]{3257,3234,1978,1959};
- int[] base_blue = new int[]{3236,3206,1815,1802};
- int[] avatarspot_red = new int[]{3257,3247,1973,1961};
- int[] avatarspot_blue = new int[]{3218,3206,1813,1801};
- RSTile[] sitlocations_red = new RSTile[]{new RSTile(1976,3239),new RSTile(1968,3239),new RSTile(1976,3250),new RSTile(1972,3253),new RSTile(1962,3255)};
- RSTile[] sitlocations_blue = new RSTile[]{new RSTile(1803,3224),new RSTile(1807,3220),new RSTile(1811,3211),new RSTile(1802,3212),new RSTile(1806,3210)};
- RSTile barrierloc_blue = new RSTile(1816,3225);
- RSTile barrierloc_red = new RSTile(1958,3239);
- //out of game object
- int portal_balance = 42031;
- int portal_red = 42030;
- int portal_blue = 42029;
- //in-game objects
- int portalinbase_red = 42022;
- int portalinbase_blue = 42021;
- int barrier_red = 42018;
- int barrier_blue = 42015;
- //other stuff.
- int spot = 0;
- boolean passlogin = false;
- int entertries = 0;
- public void onRepaint(Graphics g)
- {
- }
- public double getVersion()
- {
- return 0.2;
- }
- public String getScriptCategory()
- {
- return "Ben's Scripts/Crap Series";
- }
- public String getName()
- {
- return "Crap Soul Wars";
- }
- public String getAuthor()
- {
- return "Ben B (Hunterbdb)";
- }
- public void clickCont()
- {
- int x = random(195,320);
- int y = random(454,458);
- moveMouse(x,y);
- wait(random(100,300));
- clickMouse(true);
- }
- public String getScriptDescription() {
- String html = "";
- html+="<html>";
- html+="<body bgcolor=\"#FFFFFF\">";
- html+="<p align=\"center\"><font size=\"7\" color=\"#800000\">Ben B's Crap Series</font></p>";
- html+="<p align=\"center\"><font size=\"2\" color=\"#000000\">Remember, you must enter your ";
- html+="option entries exactly as shown under <b>valid options</b>, or the script will ";
- html+="not start as an execution precaution. </font></p>";
- html+="<p align=\"center\">To use this script, you must use your Crap-Series Username and ";
- html+="password. If you don't, the script won't run and RsBot will close.</p>";
- html+="<div align=\"center\"> ";
- html+="<p><b>Instructions:</b> </p>";
- html+="<p>Begin at the soul wars place, right next to the balance portal. Be sure to ";
- html+=" have everything you need. DO NOT HAVE AUTO RETALIATE ON!</p>";
- html+="<p><b>Details:</b></p>";
- html+="<p>This script will enter the balance portal after the battles are done. It";
- html+=" will keep on doing this, earning you zeal which you can spend on experience. ";
- html+=" 24 hours can get you about 423,000 experience.</p>";
- html+="<p><b>Note:</b></p>";
- html+="<p>I didn't call this series "Crap series" because the scripts are ";
- html+=" bad or anything. I just wanted to call it Crap because i'm 5 years old, thats ";
- html+=" all. =)</p>";
- html+="<p> </p>";
- html+=" <p> </p>";
- html+="</div>";
- html+="<p align=\"center\"> </p>";
- html+="<p> </p>";
- html+="</body>";
- html+="</html>";
- return(html);
- }
- public boolean onStart(Map<String, String> args)
- {
- return true;
- }
- public void onFinish() {
- }
- public boolean isInBounds(int... bounds)
- {
- boolean result = false;
- int x = getMyPlayer().getLocation().getX();
- int y = getMyPlayer().getLocation().getY();
- if(y<=bounds[0] && y>=bounds[1] && x<=bounds[2] && x>=bounds[3])
- {
- result = true;
- }
- return result;
- }
- public void walkToWalkway()
- {
- int x = random(walkway[3],walkway[2]);
- int y = random(walkway[0],walkway[1]);
- RSTile[] path1 = new RSTile[]{new RSTile(x,y)};
- walkPathMM(randomizePath(path1,1,1),60);
- }
- public void walkToBalancePortal()
- {
- RSTile[] path1 = new RSTile[]{portalloc_balance};
- walkPathMM(randomizePath(path1,1,1),60);
- }
- public boolean isCloseToBalancePortal()
- {
- boolean result;
- if(distanceTo(portalloc_balance)<=4)
- {
- result = true;
- }
- else
- {
- result = false;
- }
- return result;
- }
- public void enterBalancePortal()
- {
- RSObject portal = getObjectAt(portalloc_balance);
- turnToObject(portal,30);
- atTile(portalloc_balance,"Join-team Balance portal");
- wait(random(1500,2500));
- if(isMenuOpen())
- {
- atMenu("Join-team Balance portal");
- }
- }
- public void walkToRedBarrier()
- {
- RSTile[] path1 = new RSTile[]{barrierloc_red};
- walkPathMM(path1,30);
- wait(random(3000,5000));
- }
- public void walkToBlueBarrier()
- {
- RSTile[] path1 = new RSTile[]{barrierloc_blue};
- walkPathMM(path1,30);
- wait(random(3000,5000));
- }
- public void passRedBarrier()
- {
- //RSObject barrier = getNearestObjectByID(barrier_red);
- //turnToObject(barrier,40);
- //atObject(barrier,"Pass Red barrier");
- setCameraRotation(269);
- setCameraAltitude(true);
- RSTile location = new RSTile(1959,3239);
- atTile(location,"Pass Red barrier");
- wait(random(4000,5000));
- if(isMenuOpen())
- {
- atMenu("Pass Red barrier");
- }
- }
- public void passBlueBarrier()
- {
- //RSObject barrier = getNearestObjectByID(barrier_blue);
- //turnToObject(barrier,40);
- //atObject(barrier,"Pass Blue barrier");
- setCameraRotation(89);
- setCameraAltitude(true);
- RSTile location = new RSTile(1815,3225);
- atTile(location,"Pass Blue barrier");
- wait(random(4000,5000));
- if(isMenuOpen())
- {
- atMenu("Pass Blue barrier");
- }
- }
- public void walkRandomRedSpot()
- {
- spot++;
- RSTile[] path1 = new RSTile[]{sitlocations_red[spot]};
- walkPathMM(randomizePath(path1,3,3),60);
- if(spot==4)
- {
- spot = 0;
- }
- }
- public void walkRandomBlueSpot()
- {
- spot++;
- RSTile[] path1 = new RSTile[]{sitlocations_blue[spot]};
- walkPathMM(randomizePath(path1,3,3),60);
- if(spot==4)
- {
- spot = 0;
- }
- }
- public void walkRandom(int[] array)
- {
- int x = random(array[3],array[2]);
- int y = random(array[1],array[0]);
- RSTile[] path1 = new RSTile[]{new RSTile(x,y)};
- walkPathMM(randomizePath(path1,2,2),40);
- }
- public void clickToEnter()
- {
- int x = random(225,295);
- int y = random(401,407);
- moveMouse(x,y);
- wait(random(500,2000));
- clickMouse(true);
- }
- public void spinCam()
- {
- setCameraRotation(random(1,359));
- setCameraAltitude((double) random(30,98));
- }
- public void randomTab()
- {
- openTab(random(0,13));
- }
- public void waitSuperLong()
- {
- randomTab();
- wait(random(15000,30000));
- spinCam();
- wait(random(15000,30000));
- spinCam();
- wait(random(15000,30000));
- randomTab();
- wait(random(15000,30000));
- spinCam();
- wait(random(15000,30000));
- spinCam();
- wait(random(15000,30000));
- randomTab();
- wait(random(15000,30000));
- randomTab();
- spinCam();
- wait(random(6000,17000));
- }
- public int loop() {
- if(!getMyPlayer().isMoving())
- {
- if(isInBounds(bankarea) || isInBounds(offtrack_west) || isInBounds(offtrack_east) || isInBounds(waitinggraveyard_west) || isInBounds(waitinggraveyard_east))
- {
- log("Location: soul wars general area.");
- log("Action: walking to walkway.");
- walkToWalkway();
- }
- else if(isInBounds(walkway))
- {
- log("Location: walkway.");
- walkToBalancePortal();
- log("Action: Walking to balance portal");
- }
- else if(isInBounds(portalarea))
- {
- log("Location: portal area.");
- wait(random(4000,8000));
- if(isCloseToBalancePortal())
- {
- entertries++;
- log("Location: Close to balance portal.");
- log("Action: entering balance portal. I have tried " + entertries +" times so far. Will wait 3 to 4 minutes after 5 tries (for anti-ban purposes).");
- enterBalancePortal();
- wait(random(3000,5000));
- if(!(isInBounds(waitingarea_red) || isInBounds(waitingarea_blue)))
- {
- log("Clicking to continue into the portal.");
- clickCont();
- wait(random(3000,5000));
- clickToEnter();
- }
- wait(random(3000,5000));
- if(!(isInBounds(waitingarea_red) || isInBounds(waitingarea_blue)))
- {
- if(entertries>=5)
- {
- entertries = 0;
- log("Has tried to enter balance portal 5 times. It is possible that you aren't allowed in for an allotted time. Will wait 3 to 4 minutes before trying again.");
- waitSuperLong();
- }
- }
- }
- else
- {
- walkToBalancePortal();
- }
- }
- else if(isInBounds(avatarspot_red))
- {
- log("Location: Red Avatar spot.");
- walkRandom(avatarspot_red);
- log("Action: walking to random location in the avatar area.");
- wait(random(10000,20000));
- spinCam();
- wait(random(10000,20000));
- randomTab();
- wait(random(10000,20000));
- spinCam();
- wait(random(10000,20000));
- randomTab();
- spinCam();
- }
- else if(isInBounds(avatarspot_blue))
- {
- log("Location: Blue Avatar spot.");
- walkRandom(avatarspot_blue);
- log("Action: walking to random location in the avatar area.");
- wait(random(10000,20000));
- spinCam();
- wait(random(10000,20000));
- randomTab();
- wait(random(10000,20000));
- spinCam();
- wait(random(10000,20000));
- randomTab();
- spinCam();
- }
- else if(isInBounds(base_red))
- {
- log("Location: red base.");
- walkRandomRedSpot();
- log("Walking to a random spot");
- wait(random(5000,15000));
- }
- else if(isInBounds(base_blue))
- {
- log("Location: blue base.");
- walkRandomBlueSpot();
- log("Walking to a random spot");
- wait(random(5000,15000));
- }
- else if(isInBounds(safezone_red))
- {
- setRun(true);
- wait(random(2000,3000));
- log("Location: red safezone.");
- log("Action: walking to red barrier");
- walkToRedBarrier();
- if(isInBounds(safezone_red))
- {
- if(distanceTo(barrierloc_red)<=4)
- {
- log("Action: passing red barrier.");
- passRedBarrier();
- }
- wait(random(5000,7000));
- }
- }
- else if(isInBounds(safezone_blue))
- {
- setRun(true);
- wait(random(2000,3000));
- log("Location: blue safezone.");
- log("Action: walking to blue barrier");
- walkToBlueBarrier();
- if(isInBounds(safezone_blue))
- {
- if(distanceTo(barrierloc_blue)<=4)
- {
- log("Action: Passing blue barrier");
- passBlueBarrier();
- }
- wait(random(5000,7000));
- }
- }
- else if(isInBounds(waitingarea_red))
- {
- entertries = 0;
- log("Location: red waiting area.");
- walkRandom(waitingarea_red);
- log("Action: walking randomly.");
- wait(random(8000,15000));
- }
- else if(isInBounds(waitingarea_blue))
- {
- entertries = 0;
- log("Location: blue waiting area.");
- walkRandom(waitingarea_blue);
- log("Action: walking randomly.");
- wait(random(8000,15000));
- }
- }
- return 1000;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement