Thread: Making a bot

Results 1 to 9 of 9
  1. #1 Making a bot 
    Registered Member
    Join Date
    Jul 2016
    Posts
    67
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    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
    Reply With Quote  
     

  2. #2  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    28
    Posts
    2,887
    Thanks given
    417
    Thanks received
    885
    Rep Power
    856
    Um what?


    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Jul 2016
    Posts
    67
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    A clan wars bot 718
    Reply With Quote  
     

  5. #4  
    The One & Only


    Join Date
    Oct 2013
    Posts
    2,572
    Thanks given
    422
    Thanks received
    1,620
    Rep Power
    5000
    join csgo you'll be a bot
    rekt ahaha savage
    OT: ?? ok
    Attached image
    Spoiler for More Signatures:

    Attached image
    Credits to Niceman, Vippy and Dami for the awesome signatures
    Attached image
    Attached image


    Reply With Quote  
     

  6. Thankful users:


  7. #5  
    Registered Member
    Join Date
    Jul 2016
    Age
    27
    Posts
    392
    Thanks given
    19
    Thanks received
    61
    Rep Power
    68
    Quote Originally Posted by Royal View Post
    join csgo you'll be a bot
    rekt ahaha savage
    OT: ?? ok
    Holy shit LOL
    Thanks,
    Mikk
    Reply With Quote  
     

  8. #6  
    Registered Member

    Join Date
    Oct 2011
    Posts
    2,084
    Thanks given
    0
    Thanks received
    1,043
    Rep Power
    3608
    * @author Andre (423 Million)
    * @date July 23rd 2015
    ayeee.
    Reply With Quote  
     

  9. #7  
    Ex-Staff

    Koy's Avatar
    Join Date
    Oct 2010
    Posts
    1,871
    Thanks given
    1,299
    Thanks received
    910
    Rep Power
    5000
    some 2007 shit right here
    Reply With Quote  
     

  10. #8  
    Registered Member
    excl150's Avatar
    Join Date
    Jul 2014
    Posts
    123
    Thanks given
    46
    Thanks received
    30
    Rep Power
    97
    Quote Originally Posted by Royal View Post
    join csgo you'll be a bot
    rekt ahaha savage
    OT: ?? ok
    lmao thx for that laugh
    Reply With Quote  
     

  11. #9  
    Banned
    Join Date
    Sep 2013
    Posts
    146
    Thanks given
    72
    Thanks received
    25
    Rep Power
    0
    Quote Originally Posted by Royal View Post
    join csgo you'll be a bot
    rekt ahaha savage
    OT: ?? ok
    Haha x-)
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Making reaction bot startup!
    By Defiled RSPS in forum Help
    Replies: 2
    Last Post: 10-01-2014, 03:03 AM
  2. Cold Poet's Guide to making your bot run Perfect. [SPEED WISE]
    By Cold Poet in forum RuneScape Underground
    Replies: 1
    Last Post: 04-19-2012, 05:39 PM
  3. Help with making a bot
    By Bridget7298 in forum Application Development
    Replies: 5
    Last Post: 03-25-2012, 04:17 AM
  4. Hey how do you make a bot?
    By D A R K in forum Help
    Replies: 2
    Last Post: 08-14-2011, 01:18 AM
  5. Want to make a bot with me?
    By poke1103 in forum Application Development
    Replies: 12
    Last Post: 05-11-2010, 08:21 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •