Help with Java Bot menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    SimpleF's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with Java Bot

    Hello, im wondering if anyone here could help me out, this is the first time i try to make a simple macro program

    anyway this program i have set it to press a key and click the mouse, (This is for an MMO)

    the question im having is, How do i make the program switch to the game when i want the key to be pressed ? i want to do other things on my computer while the macro is clicking on the same key in this game, currently when i activate the macro, i have to switch to the game and let it do its thing, but i want the program to automatically, when its suppose to press the key it does it inside the game and not on something i have open.

    here is my code

    Code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.AWTException;
    import java.awt.BorderLayout;
    import java.awt.EventQueue;
    
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.border.EmptyBorder;
    
    import net.miginfocom.swing.MigLayout;
    
    import javax.swing.JButton;
    
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    
    public class TERA extends JFrame {
    
    	private JPanel contentPane;
    
    	/**
    	 * Launch the application.
    	 */
    	public static void main(String[] args) {
    		EventQueue.invokeLater(new Runnable() {
    			public void run() {
    				try {
    					TERA frame = new TERA();
    					frame.setVisible(true);
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}
    		});
    	}
    
    	public TERA() throws AWTException {
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setBounds(100, 100, 450, 300);
    		contentPane = new JPanel();
    		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    		setContentPane(contentPane);
    		contentPane.setLayout(new MigLayout("", "[]", "[][]"));
    		final Robot myRobot = new Robot();
    		
    		JButton btnMouse = new JButton("Mouse");
    		btnMouse.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent e) {
    				myRobot.delay(2000);
    				for (int i = 0; i < 5; i++) {
    					//myRobot.mouseMove(1005, i);
    					myRobot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
    					myRobot.delay(1000);
    					myRobot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
    				}
    			}
    		});
    		contentPane.add(btnMouse, "cell 0 0");
    		
    		JButton keyButton = new JButton("Key");
    		keyButton.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent e) {
    				myRobot.delay(5000);
    				for (int i = 0; i < 10; i++) {
    					
    					myRobot.keyPress(KeyEvent.VK_F);
    					myRobot.delay(15000);
    					
    				}
    			}
    		});
    		contentPane.add(keyButton, "cell 0 1");
    	}
    
    }


    i read some posts here, saying C++ is a better program to deal with online gaming and such, im not the best programmer out there but i am alright, so if C++ is the better choice, i could switch
    but my question would still be the same as above, how do i make the program do its thing inside the game and not on something i have open ( like internet, word or something like that )

    Thanks

    Help with Java Bot
  2. #2
    Willy's Avatar Elite User
    CoreCoins Purchaser
    Reputation
    478
    Join Date
    Mar 2007
    Posts
    682
    Thanks G/R
    147/124
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Searched some and this is all I found:

    Using Java to set the focus to a non Java application in Windows - Stack Overflow

    Considering the 2nd method to be the easiest one!

    write a VBScript to activate another application. For example:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.AppActivate("Firefox")
    Then use Runtime.exec from your Java app to execute the script.
    Im afraid that I dont know any other way of doing it in java!

  3. #3
    SimpleF's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by willy t3h whale View Post
    Searched some and this is all I found:

    Using Java to set the focus to a non Java application in Windows - Stack Overflow

    Considering the 2nd method to be the easiest one!



    Im afraid that I dont know any other way of doing it in java!
    Thank you,

    do you know how to do it in another language like C++ or C# maybe ?

  4. #4
    Willy's Avatar Elite User
    CoreCoins Purchaser
    Reputation
    478
    Join Date
    Mar 2007
    Posts
    682
    Thanks G/R
    147/124
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SimpleF View Post
    Thank you,

    do you know how to do it in another language like C++ or C# maybe ?
    C++:
    Assuming you have a handle of the window you want to give focus, SetFocus(HWND hWnd);
    You can either get the handle by process name, window name or starting it through your application. (Google "C++ Get HWND from [process name/window name/started application]"

    Im glad that I could help!


    References:
    SetFocus function (Windows)
    focus onto another window??

  5. #5
    SimpleF's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by willy t3h whale View Post
    C++:
    Assuming you have a handle of the window you want to give focus, SetFocus(HWND hWnd);
    You can either get the handle by process name, window name or starting it through your application. (Google "C++ Get HWND from [process name/window name/started application]"

    Im glad that I could help!


    References:
    SetFocus function (Windows)
    focus onto another window??

    Thank you very much

  6. #6
    Willy's Avatar Elite User
    CoreCoins Purchaser
    Reputation
    478
    Join Date
    Mar 2007
    Posts
    682
    Thanks G/R
    147/124
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SimpleF View Post
    Thank you very much
    No problem at all, Im glad I could help!

  7. #7
    Selvyre's Avatar Active Member
    Reputation
    30
    Join Date
    Jul 2013
    Posts
    104
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed c++ is much better for mmo bots or basically any kind of game hack tool or mod tool, the fact of the matter is that c++ has easier and more powerful native methods and functions for scanning reading and writing to memory of a process. Java has some of them but it's a total pain in the ass and the only main kit java has for automated actions is Robot.class which scans pixels so unless you want to make a ghetto ass pixel color bot I don't recommend java for the particular occasion. To get the bot to do things you need to find memory addresses inside the process(im assuming tera process) and read/write to them. Every action in the game writes out an encrypted address so like when I press W that function is sent somewhere and read by the server so you simply need to write to memory that address over and over again with a bot to get your character to act out pressing W however many times you need it to, hardest part is finding out what those addresses are im sure on some tera bot website or maybe even on here somebody has a list of at least a few addresses used on your game.

    Sources: Ive programmed bots and games for many many years with lots o' languages
    Skype: Argixx
    Coding Experience: Java: 8 years, c++: 4 years, python: lolk, c#: might as well be java, AutoIt: 1 year

  8. #8
    SimpleF's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I started playing around in C#, it looks more similar to Java, (the way you type it out), and it looked easier for me to get started with

    and i started playing around with memory adressing aswell, i been able to find the memory adress of the HP bar in Tera, however currently im looking for a tutorial on how to use the adress in C#, if there is anyone out there that knows of a tutorial i would be very grateful,

    Cheers

  9. #9
    Selvyre's Avatar Active Member
    Reputation
    30
    Join Date
    Jul 2013
    Posts
    104
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    c# will work if your looking for a java like structure to programming and syntax, but again not as powerful as c++ or as equipped for mem edit/reading but can still be good
    Skype: Argixx
    Coding Experience: Java: 8 years, c++: 4 years, python: lolk, c#: might as well be java, AutoIt: 1 year

Similar Threads

  1. Replies: 0
    Last Post: 11-16-2009, 07:49 AM
  2. Need help with BG bots
    By Rohi in forum World of Warcraft General
    Replies: 5
    Last Post: 09-13-2008, 04:19 PM
  3. Looking for some help with java.
    By shocking4life in forum Programming
    Replies: 1
    Last Post: 07-20-2008, 05:46 AM
  4. Need some help with fishing bot
    By ralphie123 in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 11-24-2006, 09:41 AM
  5. Help with fishing bots
    By Vagi99 in forum World of Warcraft General
    Replies: 1
    Last Post: 08-31-2006, 10:42 AM
All times are GMT -5. The time now is 01:36 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search