Don't workd PressKey for Metin2

03/16/2016 18:49 m0z0#1
Hello,
i make simple FishBot for Metin2. I use Java.
Don't work this code in windows Metin2 but works in other applications.:rolleyes:
This code PressKey F1 with a pause 300ms.
Who know why this code don't work window of metin2?:(
p.s Sorry for my English :handsdown:
Code:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.*;

class myFrame extends JFrame
{
    private Robot robot;
    public myFrame()
    {
        setTitle("iRobot");
        JPanel panel = new JPanel(); 
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice screen=env.getDefaultScreenDevice(); 
        try {
            robot=new Robot(screen);
        } catch (AWTException ex) { }
        JButton bt1 = new JButton("Start"); // создаем кнопку
        panel.add(bt1); // добавляем нашу кнопку на панель
        bt1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                for(int i=0; i<10; i++) 
                {
                   robot.keyPress(KeyEvent.VK_F1);
                    robot.delay(300);
                }
            }
        });
        Container pane = getContentPane(); 
        pane.add(panel); 
        pack(); 
    }
}

public class MyRobot {
    public static void main(String[] args) {
        myFrame frame = new myFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
        frame.show(); 
    }
}
03/16/2016 20:59 Mi4uric3#2
Metin2 uses Incas Gameguard Software which uses a kernel driver to protect the game process against attacks like those.