Palunväga siin see on
läheb aind Blue tiimi ja seisab pmst kogu aja
!@!@ oma 95% ja 5% minu ja sõbra oma
Kui tekib probleeme andge teada
Et script töötaks pead seisma kolme ruudu kaugusel barrierist
siin siis upitud nii .java kui .class
http://www.mediafire.com/?sharekey=d418cb31356986228c9e7c56ba37815fc829d1dd73795222
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import com.speljohan.rsbot.bot.*;
import com.speljohan.rsbot.event.events.*;
import com.speljohan.rsbot.event.listeners.*;
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.accessors.*;
public class BlueSoulWars extends Script implements ServerMessageListener {
int id1 = 42029;
int B_DeathX[] = new int[]{1823,1816,1816,1823};
int B_DeathY[] = new int[]{3220,3220,3230,3230};
Polygon B_Death = new Polygon(B_DeathX, B_DeathY, 4);
int OutX[] = new int[]{1886,1890,1894,1898,1904,1897,1899,1895,1880,1880,1880,1880,1882,1899};
int OutY[] = new int[]{3182,3181,3179,3180,3172,3166,3162,3157,3154,3161,3173,3162,3162,3162};
Polygon Out = new Polygon(OutX, OutY, 11);
int R_DeathX[] = new int[]{1953,1958,1959,1959,1958,1953,1952,1952};
int R_DeathY[] = new int[]{3245,3245,3244,3236,3235,3235,3236,3244};
Polygon R_Death = new Polygon(R_DeathX, R_DeathY, 8);
public int loop() {
if(RSInterface.getChildInterface(211, 3).getAbsoluteX() > 20) {
atInterface(RSInterface.getChildInterface(211, 3));
return random(1200, 1800);
}
if(getMyPlayer().getAnimation() == 836) {
return random(18000, 20000);
}
if(RSInterface.getInterface(228).getChild(2).isValid()) {
atInterface(RSInterface.getChildInterface(228, 2));
return random(1200, 1800);
}
switch(check()) {
case 0: //Blue Team
setCompass('s');
wait(random(250,450));
RSObject blueBarrier = findObject(id1);
if(blueBarrier == null) return 800;
atObject(blueBarrier,"Pass");
return random(100, 200);
case 1: //Blue Teami Grave
if(tileOnScreen(new RSTile(1815, 3225))) {
if(!atDoorTile(new RSTile(1815, 3225), "E", "Pass")) {
turnCamera();
}
waitWhileMoving();
return random(1200, 1800);
} else {
walkTileMM(randomizeTile(new RSTile(1815, 3225), 2, 2));
waitWhileMoving();
return random(1200, 1800);
}
case 2: // look down
RSObject eastGrave = getNearestObjectByID(42013, 42016);
if(eastGrave == null) {
return random(100, 900);
}
if(tileOnScreen(eastGrave.getLocation())) {
if(!atDoorTile(eastGrave.getLocation(), "N", "Pass")) {
turnCamera();
}
waitWhileMoving();
return random(1200, 1800);
} else {
walkTileMM(eastGrave.getLocation());
waitWhileMoving();
return random(1200, 1800);
}
case 3: // look down
RSObject westGrave = getNearestObjectByID(42014, 42017);
if(westGrave == null) {
return random(100, 900);
}
if(tileOnScreen(westGrave.getLocation())) {
if(!atDoorTile(westGrave.getLocation(), "S", "Pass")) {
turnCamera();
}
waitWhileMoving();
return random(1200, 1800);
} else {
walkTileMM(westGrave.getLocation());
waitWhileMoving();
return random(1200, 1800);
}
case 100: //OUT OF game antiban
int x = random(0, 10);
switch(x) {
case 1:
log("Doing Antiban");
turnCamera();
break;
case 2:
log("Doing Antiban");
if(random(0, 3) == 1) {
tab(true);
} else {
tab(false);
}
break;
}
return random(500, 1000);
case 101: //IN GAME antiban
int a = random(0, 15);
switch(a) {
case 1:
turnCamera();
log("Doing Antiban");
break;
case 2:
if(random(0, 3) == 1) {
tab(true);
log("Doing Antiban");
} else {
tab(false);
}
break;
case 3:
walkRandomTile();
break;
}
return random(500, 1000);
}
return random(400, 700);
}
public int check() {
// if(distanceTo(new RSTile(1897, 3162)) // log(" Joining Red Team!");
// return 0;
if(distanceTo(new RSTile(1882, 3162)) log(" Joining Blue Team!");
setCompass('s');
wait(random(250,750));
return 0;
} else if(!isInPolygon(Out) && distanceTo(new RSTile(1889, 3164)) return 100;
} else if(isInPolygon(B_Death)) {
log("In Blue Graveyard...");
return 1;
//} else if(isInPolygon(R_Death)) {
// log("In Red Graveyard...");
// return 2;
} else if(distanceTo(new RSTile(1933, 3245)) log("In east grave");
return 2;
} else if(distanceTo(new RSTile(1842, 3218)) log("In west grave");
return 3;
} else if(getMyPlayer().getInteracting() != null) {
return 100;
}
return 101;
}
public boolean isInPolygon(Polygon p) {
return p.contains(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
}
public boolean atPortal(RSTile tile, String action) {
try {
Point location = Calculations.tileToScreen(tile.getX(), tile.getY(), random(1.2, 1.5), random(1.2, 1.5), 0);
if (location.x == -1 || location.y == -1) return false;
moveMouse(location, 3, 3);
if (getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
clickMouse(true);
return true;
} else {
clickMouse(false);
return atMenu(action);
}
} catch (Exception e) {
return false;
}
}
public void waitWhileMoving() {
wait(random(500, 700));
while(getMyPlayer().isMoving()) {
wait(random(100, 300));
}
}
public boolean turnCamera() {
try{
setCameraAltitude(true);
int newCamera = getCameraAngle()+random(0,270);
if(newCamera >= 360)
newCamera-=360;
setCameraRotation(newCamera);
}catch(Exception e) {
return false;
}
return true;
}
public void tab(boolean stupid) {
int[] nonStupidTabs = {TAB_CLAN, TAB_FRIENDS, TAB_INVENTORY, TAB_MUSIC, TAB_OPTIONS, TAB_STATS};
if(stupid) {
int i = random(0, 14);
if(getCurrentTab() != i) {
openTab(i);
}
} else if(!stupid) {
int i = random(0, nonStupidTabs.length - 1);
if(getCurrentTab() != i) {
openTab(i);
}
}
}
public void walkRandomTile() {
RSTile t = new RSTile(getMyPlayer().getLocation().getX() + random(-16, 16), getMyPlayer().getLocation().getY() + random(-16, 16));
if(t.isValid() && canReach(t, false)) {
walkTileMM(t);
waitWhileMoving();
}
}
public boolean atDoorTile(RSTile loc, String direction, String action) {
if (loc == null) return false;
if (Bot.getClient().isMenuOpen()) {
atMenu("Cancel");
}
Point t = null;
if (direction.toLowerCase().startsWith("n")) {
t = Calculations.tileToScreen(loc.getX(), loc.getY() + 1, .5, .1, 40);
} else if (direction.toLowerCase().startsWith("s")) {
t = Calculations.tileToScreen(loc.getX(), loc.getY(), .5, .1, 40);
} else if (direction.toLowerCase().startsWith("w")) {
t = Calculations.tileToScreen(loc.getX(), loc.getY(), .1, .5, 40);
} else if (direction.toLowerCase().startsWith("e")) {
t = Calculations.tileToScreen(loc.getX() + 1, loc.getY(), .1, .5, 40);
}
if (t == null) {
return false;
}
clickMouse(t,3,3,false);
return atMenu(action);
}
public BlueSoulWars() {
setParameter("author", "Hans & Kaz");
setParameter("version", 1.0);
setParameter("name", "BlueSoulWars");
setParameter("category", "!@!@! Credits!");
setParameter("description", disc());
}
public String disc() {
/*Used profisher's and changed it a little. */
String html = "";
html += "";
html += "[align=center]";
html += "[b]" + getName() + " v" + getVersion() + "
";
html += "By: Hans[/b]
";
html += "[align=center]";
html += "[/align]";
html += "[/align]";
html += "";
return html;
}
public boolean onStart(Map args) {
Bot.getEventManager().addListener(this);
return true;
}
public void onFinish() {
Bot.getEventManager().removeListener(this);
}
public void serverMessageRecieved(ServerMessageEvent e) {
if(e.getMessage().contains("If you die,")) {
wait(random(14000, 18000));
}
}
}