Um what?
|
package bot.scripts;
import java.awt.Graphics;
import java.util.Random;
import com.Class255;
import com.Class264;
import com.Player;
import bot.Bot;
import bot.utils.Tile;
public class PlayWorldClwBot extends Script {
Tile t = null;
/**
* @author Andre (423 Million)
* @date July 23rd 2015
*/
@Override
public boolean onStart() {
sendMsg("@Developer Andre aka (423 Million)");
sendMsg("Starting " + this.getClass().getSimpleName() + " bot...");
deathes--;
return true;
}
private int noPvpAmt = 0;
private int deathes = 0;
private int removedFromClw = 0;
private String lastTargetAttked = "";
private static boolean multiMode = false;
private static boolean attacking = false;
private static int actualDeathes = 0;
public static final int meleeWepId = 18365;
public static final int shieldId = 2667;
public static final int rangeWepId = 18331;
private static String currentAttackMethod = "";
@Override
public void run() {
super.run();
try {
t = new Tile(Bot.getMyPlayerX(), Bot.getMyPlayerY(), 0);
if (isInLobby(Bot.getMyPlayerX(), Bot.getMyPlayerY())) {
sendMsg("You're in the lobby...moving to port in a sec");
Bot.setLastAttackedPlayer("");//resets attled player
//Bot.activateQuickprayers();//no longer using since we use getEquipmentName for pray switching
String wep = Bot.getEquipmentName(Bot.getMyPlayer(), SLOT_WEAPON).toLowerCase();
String shield = Bot.getEquipmentName(Bot.getMyPlayer(), SLOT_SHIELD).toLowerCase();
if (Bot.isFrozen())
Bot.setFrozen(false);
if (Bot.inventory.getSlotByItem(meleeWepId) == -1 && !wep.contains("scimitar")) {
ClwBot.sendMsg("Obtain a rune scimy");
} else if (Bot.inventory.getSlotByItem(shieldId) == -1 && !shield.contains("shield")) {
ClwBot.sendMsg("Obtain a saradomin kite shield");
} else if (Bot.inventory.getSlotByItem(rangeWepId) == -1 && !wep.contains("bow")) {
ClwBot.sendMsg("Obtain a maple sighted long bow");
}
if (getActualDeathes() % 2 == 0) {
if (!wep.contains("bow"))
Bot.clickButton(44498944, rangeWepId, Bot.inventory.getSlotByItem(rangeWepId), 2);
//Bot.rangePrayBonus();
sendMsg("Using range to attack.");
setCurrentAttackMethod("range");
} else {
if (!wep.contains("scimitar"))
Bot.clickButton(44498944, meleeWepId, Bot.inventory.getSlotByItem(meleeWepId), 2);
Bot.clickButton(44498944, shieldId, Bot.inventory.getSlotByItem(shieldId), 2);
//Bot.meleePrayBonus();
sendMsg("Using melee to attack.");
setCurrentAttackMethod("melee");
}
Thread.sleep(1000);
Thread.sleep((new Random().nextInt(5) + 1) * 30000);//1-5 seconds wait time
Bot.clickObject(38698, new Tile(2989, 9684, 0), 1); // click on port
deathes++;
sendMsg("Total deathes so far: " + deathes);
Thread.sleep(3500);
} else if (isInSafe(Bot.getMyPlayerX(), Bot.getMyPlayerY())) {
if (!isMultiMode()) {
Bot.rangeProtectionPrayer();
Thread.sleep((new Random().nextInt(5) + 1) * 400);//1-5 seconds wait time
Bot.walkTo(new Tile(2815 + random(0, 0), 5513 + random(0, 0), 0));
sendMsg("You're in safe! Running to PVP area...(not multi)");
Thread.sleep(3000);
if (isAttacking()) {
attackUserSingle();
}
} else {//multi
Bot.walkTo(new Tile(2807 + random(0, 8), 5537 + random(0, 6), 0));//more exact
sendMsg("You're in safe! Running to PVP area...(multi)");
Thread.sleep(3000);
}
} else if (!isMultiMode() && isInPvp(Bot.getMyPlayerX(), Bot.getMyPlayerY())) {
sendMsg("I'm in single PVP. Counter: " + noPvpAmt);
//int randNumbr = new Random().nextInt(300);
/*if (!Bot.hasHpBar(Bot.getMyPlayer()) && Bot.getCurrentAnimation() != 11786
&& Bot.getCurrentAnimation() != 5713 && randNumbr == 243) {
Bot.rest();
}*/
if (removedFromClw > 0)
removedFromClw = 0;
if (noPvpAmt > 0)
noPvpAmt = 0;
Thread.sleep(1500);
if (isAttacking()) {
attackUserSingle();
}
} else if (isMultiMode() && isInMulti(Bot.getMyPlayerX(), Bot.getMyPlayerY())) {
sendMsg("I'm in multi PVP. Counter: " + noPvpAmt);
/*if (!Bot.hasHpBar(Bot.getMyPlayer()) && Bot.getCurrentAnimation() != 11786
&& Bot.getCurrentAnimation() != 5713) {
Bot.rest();
}*/
if (removedFromClw > 0)
removedFromClw = 0;
if (noPvpAmt > 0)
noPvpAmt = 0;
Thread.sleep(1500);
if (isAttacking()) {
attackUserMulti();
}
} else {
if (noPvpAmt > 20)
noPvpAmt = 0;
if (noPvpAmt < (-10))
noPvpAmt = 0;
sendMsg("I'm not in PVP!! Counter: " + noPvpAmt);
if (noPvpAmt > 2) {
if (removedFromClw > 4) {
Bot.command("home");
sendMsg("Teleporting to clw incase of null...Will reset counter as well.");
checkLogin();
removedFromClw = 0;
} else {
if (!isMultiMode()) {
Thread.sleep((new Random().nextInt(5) + 1) * 5000);
//Bot.walkTo(new Tile(2811 + random(0, 4), 5512 + random(0, 4), 0));
Bot.walkTo(new Tile(2816 + random(0, 3), 5514 + random(0, 3), 0));
sendMsg("Running to single PVP area...As we were lured away...");
} else if (isMultiMode()) {
Bot.walkTo(new Tile(2807 + random(0, 8), 5537 + random(0, 6), 0));
sendMsg("Running to multi PVP area...As we were lured away...");
}
sendMsg("Reset no pvp area counter...");
checkLogin();
removedFromClw++;
noPvpAmt = 0;
}
}
noPvpAmt++;
Thread.sleep(2500);
}
} catch (Exception e) {
sendMsg("Sleep force closed");
}
}
public static boolean isInLobby(int xPlayer, int yPlayer) {
return (xPlayer >= 2983 && xPlayer <= (2983 + 19) && yPlayer >= 9670 && yPlayer <= (9670 + 17));
}
public static boolean isInSafe(int xPlayer, int yPlayer) {
return (xPlayer >= 2756 && xPlayer <= (2756 + 120) && yPlayer >= 5508 && yPlayer <= (5508 + 3));
}
public static boolean isInPvp(int xPlayer, int yPlayer) {
return (xPlayer >= 2809 && xPlayer <= (2809 + 12) && yPlayer >= 5512 && yPlayer <= (5512 + 7));
}
public static boolean isInMulti(int xPlayer, int yPlayer) {//new for multi system
if (xPlayer >= 2800 && xPlayer <= (2818) && yPlayer >= 5537 && yPlayer <= (5549))
return true;
else
return false;
}
private void attackUserMulti() {//new attack method
if (inSafe(t) == true)
return;
if (Bot.hasHpBar(Bot.getMyPlayer())) {
sendMsg("In a fight...");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
sendMsg("Sleep force closed 2");
}
return;
}
for (int i = 0; i <= ClwBot.ragTargets.size(); i++) {//if u want random targets
String target = ClwBot.ragTargets.get(new Random().nextInt(ClwBot.ragTargets.size()));//random targets
//for (String target : ClwBot.ragTargets) {
if (Bot.playerAvailableBoolean(target) == false)
continue;
if (Bot.playerAvailableBoolean(target) == true) {
Player playerNam = Bot.getPlayer(target);
try {
if (Bot.inSafe(target) == true) {
sendMsg("Player " + target + ", is in safe, they will be skipped.");
continue;
}
if (!isInMulti(Bot.getPlayerX(playerNam), Bot.getPlayerY(playerNam))) {
sendMsg("Player " + target + ", is not in multi, they will be skipped.");
continue;
}
if (Bot.hasHpBar(Bot.getMyPlayer())) {
sendMsg("In a fight...");
Thread.sleep(2000);
break;
}
if (inSafe(t)) {
runFromLobby();
Thread.sleep(3000);
break;
}
else {
sendMsg("Attacking: " + target + ".");
Bot.attackPlayer(target);
setLastTargetAttked(target);
Thread.sleep(5000);
}
} catch (InterruptedException e) {
sendMsg("Sleep force closed 3");
return;
}
} else
sendMsg("Can't find target.");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
sendMsg("Sleep force closed 4");
return;
}
}
}
private void attackUserSingle() {//new attack method
if (inSafe(t) == true)
return;
if (Bot.hasHpBar(Bot.getMyPlayer())) {
sendMsg("In a fight...");
Player lastAttked = Bot.getPlayer(getLastTargetAttked() != null ? getLastTargetAttked() : null);
if (lastAttked == null) {
sendMsg("Can't find last attacked player...");
return;
}
String weaponName = Bot.getEquipmentName(lastAttked, SLOT_WEAPON).toLowerCase();
if (weaponName != null) {
if (weaponName.toLowerCase().contains("bow") || weaponName.contains("knife")
|| weaponName.contains("morrigan") || weaponName.contains("sagaie")
|| weaponName.contains("javelin")) {//range
if (!Bot.getLastPray().equalsIgnoreCase("range"))
Bot.rangeProtectionPrayer();
} else if (weaponName.contains("scimitar") || weaponName.contains("rapier") ||
weaponName.contains("rapier") || weaponName.contains("whip") ||
weaponName.contains("claws") || weaponName.contains("godsword") ||
weaponName.contains("dharok") || weaponName.contains("maul") ||
weaponName.contains("hammer") || weaponName.contains("sword") ||
weaponName.contains("dagger") || weaponName.contains("flail") ||
weaponName.contains("spear") || weaponName.contains("mace") ||
weaponName.contains("hatchet") || weaponName.contains("axe")) {//melee
if (!Bot.getLastPray().equalsIgnoreCase("melee"))
Bot.meleeProtectionPrayer();
} else if (weaponName.contains("staff") || weaponName.contains("wand")) {//mage
if (!Bot.getLastPray().equalsIgnoreCase("mage"))
Bot.mageProtectionPrayer();
} else
sendMsg("They have no weapon!");
} else
sendMsg("Weapon name is nulled.");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
sendMsg("Sleep force closed 2");
}
return;
}
for (int i = 0; i <= ClwBot.ragTargets.size(); i++) {//if u want random targets
String target = ClwBot.ragTargets.get(new Random().nextInt(ClwBot.ragTargets.size()));//random targets
//for (String target : ClwBot.ragTargets) {
if (Bot.playerAvailableBoolean(target) == false)
continue;
if (Bot.playerAvailableBoolean(target) == true) {
Player playerNam = Bot.getPlayer(target);
if (playerNam == null) {
sendMsg("Failed returning players gear. Could not find player :" + target);
continue;
}
String weaponName = Bot.getEquipmentName(playerNam, SLOT_WEAPON);
try {
if (Bot.inSafe(target) == true) {
sendMsg("Player " + target + ", is in safe, they will be skipped.");
continue;
}
if (Bot.hasHpBar(Bot.getPlayer(target))) {
sendMsg("Player " + target + ", is in a fight, they will be skipped.");
continue;
}
if (Bot.hasHpBar(Bot.getMyPlayer())) {
sendMsg("In a fight...");
if (weaponName != null) {
if (weaponName.toLowerCase().contains("bow") || weaponName.contains("knife")
|| weaponName.contains("morrigan") || weaponName.contains("sagaie")
|| weaponName.contains("javelin")) {//range
if (!Bot.getLastPray().equalsIgnoreCase("range"))
Bot.rangeProtectionPrayer();
} else if (weaponName.contains("scimitar") || weaponName.contains("rapier") ||
weaponName.contains("rapier") || weaponName.contains("whip") ||
weaponName.contains("claws") || weaponName.contains("godsword") ||
weaponName.contains("dharok") || weaponName.contains("maul") ||
weaponName.contains("hammer") || weaponName.contains("sword") ||
weaponName.contains("dagger") || weaponName.contains("flail") ||
weaponName.contains("spear") || weaponName.contains("mace") ||
weaponName.contains("hatchet") || weaponName.contains("axe")) {//melee
if (!Bot.getLastPray().equalsIgnoreCase("melee"))
Bot.meleeProtectionPrayer();
} else if (weaponName.contains("staff") || weaponName.contains("wand")) {//mage
if (!Bot.getLastPray().equalsIgnoreCase("mage"))
Bot.mageProtectionPrayer();
} else
sendMsg("They have no weapon!");
} else
sendMsg("Weapon name is nulled.");
Thread.sleep(2000);
break;
}
if (inSafe(t)) {
runFromLobby();
Thread.sleep(3000);
break;
}
else {
sendMsg("Attacking: " + target + ".");
removedFromClw = 0;
Bot.attackPlayer(target);
setLastTargetAttked(target);
if (weaponName != null) {
if (weaponName.toLowerCase().contains("bow") || weaponName.contains("knife")
|| weaponName.contains("morrigan") || weaponName.contains("sagaie")
|| weaponName.contains("javelin")) {//range
if (!Bot.getLastPray().equalsIgnoreCase("range"))
Bot.rangeProtectionPrayer();
} else if (weaponName.contains("scimitar") || weaponName.contains("rapier") ||
weaponName.contains("rapier") || weaponName.contains("whip") ||
weaponName.contains("claws") || weaponName.contains("godsword") ||
weaponName.contains("dharok") || weaponName.contains("maul") ||
weaponName.contains("hammer") || weaponName.contains("sword") ||
weaponName.contains("dagger") || weaponName.contains("flail") ||
weaponName.contains("spear") || weaponName.contains("mace") ||
weaponName.contains("hatchet") || weaponName.contains("axe")) {//melee
if (!Bot.getLastPray().equalsIgnoreCase("melee"))
Bot.meleeProtectionPrayer();
} else if (weaponName.contains("staff") || weaponName.contains("wand")) {//mage
if (!Bot.getLastPray().equalsIgnoreCase("mage"))
Bot.mageProtectionPrayer();
} else
sendMsg("They have no weapon!");
} else
sendMsg("Weapon name is nulled.");
Thread.sleep(5000);
}
} catch (InterruptedException e) {
sendMsg("Sleep force closed 3");
return;
}
} else
sendMsg("Can't find target.");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
sendMsg("Sleep force closed 4");
return;
}
}
}
private void runFromLobby() {
try {
for (int i = 0; i <= 14; i++) {
for (int a = 0; a <= 12; a++) {
if (t.equals(2986 + i, 9672 + a)) {//we do all the bottom on death (so lobby spawn)
sendMsg("You're in the lobby...moving to port in a sec");
Bot.activateQuickprayers();
Bot.clickObject(38698, new Tile(2989, 9684, 0), 1); // click on port
deathes++;
sendMsg("Total deathes so far: " + deathes);
Thread.sleep(3500);
}
}
}
} catch (InterruptedException e) {
sendMsg("Sleep force closed");
}
}
public static boolean inSafe(Tile aTile) {//lobby??old method
boolean yesInSafe = false;
for (int i = 0; i <= 14; i++) {
for (int a = 0; a <= 8; a++) {
if (aTile.equals(2987 + i, 9675 + a)) {//lobby spawn
yesInSafe = true;
}
}
}
return yesInSafe;
}
private static final Random RANDOM = new Random();
public static final int random(int min, int max) {
final int n = Math.abs(max - min);
return Math.min(min, max) + (n == 0 ? 0 : random);
}
public static final int random(int maxValue) {
if (maxValue <= 0)
return 0;
return RANDOM.nextInt(maxValue);
}
}
Anyone knows how i can get this to run?
for playworldpw.com
Um what?
A clan wars bot 718
join csgo you'll be a bot
rekt ahaha savage
OT: ?? ok
ayeee.* @author Andre (423 Million)
* @date July 23rd 2015
some 2007 shit right here
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |