M2-bot

Posts 1–9 of 9 · Page 1 of 1
M2-bot
Ok, here is something what I've done.

My first program in Java was "Hello World!" program. My second program is this bot. So do not expect something brilliant.
Do with it what you want, run it, modify, whatever.

Bot can do lot of thing and is pretty customizable.
Shooting isn't implementing in the code.

Some comments are in my national language (sorry for that).

Here's the code:
Code:
package m2bot2;

import java.awt.AWTException;
import java.awt.Color;
import java.awt****bot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

public class M2bot2 {
    

    public static void main(String[] args) throws InterruptedException {
     
        int x, zv;
        int l=0, n=0, mo=0;
        
        
        try {
            Thread.sleep(5000);
            Robot r = new Robot();
            Robot robot = new Robot();
            
            while(true){
            // Bot will choose the first tank in a row -->
                //1225pix for 6 tanks
                for (x=174;x<1051;x=x+174){
            
                    //Robot r = new Robot();
                    r.mouseMove(x,655);
                    r.delay(50);
                    r.mousePress( InputEvent.BUTTON1_MASK );
                    r.delay(50);
                    r.mouseRelease( InputEvent.BUTTON1_MASK );
                    r.delay(50);
                    r.mousePress( InputEvent.BUTTON1_MASK );
                    r.delay(50);
                    r.mouseRelease( InputEvent.BUTTON1_MASK );
                    r.delay(1000);
                
            // Bot will find out if button Battle is click-able
            // If isn't then bot will choose another tank -->
                    //Robot robot = new Robot();
                    Color c = robot.getPixelColor(663, 60);
                    Color red_Battle = new Color(231,50,42);
            
                    if(c.getRGB() == red_Battle.getRGB()){
                        r.delay(50);
                        r.mouseMove(663, 60);   
                        r.delay(50);
                        r.mousePress( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mouseRelease( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mousePress( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mouseRelease( InputEvent.BUTTON1_MASK );
                        r.delay(60000);
            //r.delay(20000); // Čas potrebný pre načítanie mapy
            // <--------------------------
// <editor-fold desc="In Battle">
                        //Color end = robot.getPixelColor(1147, 706);
                        Color end2 = robot.getPixelColor(6, 538);
                        //Color end3 = robot.getPixelColor(214,159);
                        
                        //Color k = new Color(53,51,41);
                        Color zero = new Color(5,5,0);
                        //Color scor = new Color(3,3,3);
                        //Color scor = new Color(77,74,63);
                        zv=0;

                        // Loop sa bude opakovať pokiaľ tank nebude zničený -->
                        //while(end.getRGB() != k.getRGB() || end2.getBlue() <= zero.getBlue() || end3.getRGB() == scor.getRGB()){
                        while(end2.getBlue() == zero.getBlue()){
                            // Po spustení battle sa naštartujú motory -->
                            if(mo<1){
                                r.keyPress(KeyEvent.VK_R);
                                r.delay(50);
                                r.keyRelease(KeyEvent.VK_R);
                                r.delay(50);
                                r.keyPress(KeyEvent.VK_R);
                                r.delay(50);
                                r.keyRelease(KeyEvent.VK_R);
                                r.delay(50);
                                r.keyPress(KeyEvent.VK_R);
                                r.delay(50);
                                r.keyRelease(KeyEvent.VK_R);
                                r.delay(1000);
                                System.out.println("Na začiatku battle sa tank pohol.");
                                mo++;
                            }
            // <-------------
            
            // If speed is 0 km/h, tank will go back a little
            //and then forward and turn left -->
                            Color spd = robot.getPixelColor(72, 572);
                            Color nula = new Color(128,123,84);
            
                            if(spd.getRGB() == nula.getRGB()){
                                zv=zv+1;
                                if(zv % 2 == 0){
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(800);
                                    r.keyPress(KeyEvent.VK_A);
                                    r.delay(3750);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_A);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_R);
                                    r.delay(500);}
                                else{
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(800);
                                    r.keyPress(KeyEvent.VK_D);
                                    r.delay(2400);
                                    r.keyRelease(KeyEvent.VK_F);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_D);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_R);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_R);
                                    r.delay(500);}
                                System.out.println("Speed 0 km/h.");
                            }
                            System.out.println("Za Zero speed.");
                            //System.out.println("Value of end3 is "+ end3);
            // <-------------
            
            
            // If enemies are on our base, bot will press F3 
            // which is command for team - Back To Base -->
                            Color btb = robot.getPixelColor(531, 148);
                            Color alert = new Color(160,45,41);
            
                            if(l<1){
                                if(btb.getRed() > alert.getRed() && btb.getGreen() < alert.getGreen() && btb.getBlue() < alert.getBlue()){
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F3);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F3);
                                    r.delay(50);
                                    r.keyPress(KeyEvent.VK_F3);
                                    r.delay(50);
                                    r.keyRelease(KeyEvent.VK_F3);
                                    r.delay(50);
                                    System.out.println("Capture!!!!!!!!!");
                                    l++;
                                }
                                //System.out.println("No BackToBase.");
                             }
            // <------------ BackToBase will appears only once
                             System.out.println("Za Cap.");
            // HP<40% = Help -->
                             Color help = robot.getPixelColor(88, 538);
                             Color hp = new Color(183,84,0);
            
                             if(n<1){
                                 if(help.getBlue() > hp.getBlue()){
                                     r.delay(50);
                                     r.keyPress(KeyEvent.VK_F7);
                                     r.delay(50);
                                     r.keyRelease(KeyEvent.VK_F7);
                                     r.delay(50);
                                     r.keyPress(KeyEvent.VK_F7);
                                     r.delay(50);
                                     r.keyRelease(KeyEvent.VK_F7);
                                     r.delay(50);
                                     System.out.println("Help!!!!!!!!!");
                                     n++;
                                 }
                                 //System.out.println("No Help.");
                             }
                             System.out.println("Za Help.");
            // <------------ Help only once
                             end2 = robot.getPixelColor(6, 538);
                             //end3 = robot.getPixelColor(214,159);
                         }
            // <------------ End of the Battle-loop (tank is finished) // </editor-fold>
            
            // Bot will exit battle --->
                        r.delay(1000);
                        r.keyPress(KeyEvent.VK_ESCAPE);
                        r.delay(300);
                        r.keyRelease(KeyEvent.VK_ESCAPE);
                        r.delay(300);
                        r.mouseMove(682,383);
                        r.delay(50);
                        r.mousePress( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mouseRelease( InputEvent.BUTTON1_MASK );
                        r.delay(100);
                        r.mouseMove(733,436);
                        r.delay(50);
                        r.mousePress( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mouseRelease( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mousePress( InputEvent.BUTTON1_MASK );
                        r.delay(50);
                        r.mouseRelease( InputEvent.BUTTON1_MASK );
                        r.delay(7000);
                        System.out.println("Vypínam battle.");
            // <------------
                         
                      }//End of Battle
                 }//End of red Battle buttton IF
                 System.out.println("Koniec infinite while loop.");
                 r.delay(5000);
            }// <-------- End of infinite-while-loop
            
        }
        catch (AWTException e) {
        }
    }
}
If you need something, just ask it.

PS: Yeah, I got banned for using it. With my tier 6 tanks and 2 millions of credits I got permanent banana...
yea I wont to ask 1-what to do with this code dude 2- you using this like 3 days and you banned!!!!!????? or what
1 - compile it and run it You can use command line or some program (I recommend NetBean). Of course bot is designed for my screen resolution (1366x768, wot in windowed mod) so you need to have/teach basic java programming to adapt bot for your resolution.

2 - I used it 2 or 3 night. They have a pretty good anti-bot system.
The truth about Anti-bot system
So if bot do not shoot - he get ban. Ban will be delivered approximately 2-4 days after using bot (in my case).
not sure if i understand 100 percent, but your last statement, "So if bot do not shoot - he get ban" why not remap the shoot key to a normal button, and adjust the code in your bot to make it shoot? not sure if you just chose not to implement shooting, or if it cannot be done on a mouse key, dont know too much about java sorry
It can be done, no problem. But their anti-bot system is very clever and shooting nowhere or to allies do not help against ban. Bot has to shoot at the enemy. It can be done by scanning screen for a exact pixel (red enemy's indicator for example). Problem is I do not know how to move view/camera in the game (I cannot use there the exact coordinates). Someone more experienced could do that.
DONT USE THIS SHIT YOU WILL GET BANNED!!!!
Quote Originally Posted by Seb View Post
DONT USE THIS SHIT YOU WILL GET BANNED!!!!
Lol, do not panic, you genius

Just calm down and breath deeply
hey! i want to ask about how to use it

---------- Post added at 04:26 PM ---------- Previous post was at 04:24 PM ----------

what is the step?
a prosim mohol by si aj pisať po slovensky lebo moja anglictina je na nic
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?