i make simple FishBot for Metin2. I use Java.
Don't work this code in windows Metin2 but works in other applications.
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
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();
}
}






