Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.myiume.dota2interactive;
- import java.util.concurrent.ExecutionException;
- import me.myiume.dota2interactive.api.TetrisConnector;
- import me.myiume.dota2interactive.listeners.KeyPressListener;
- import me.myiume.dota2interactive.listeners.MouseMoveListener;
- import pro.beam.api.BeamAPI;
- import pro.beam.interactive.net.packet.Protocol;
- import pro.beam.interactive.robot.Robot;
- public class Dota2Interactive {
- static String username;
- static String password;
- static int channel;
- static int channelId;
- static String url = "https://beam.pro/api/v1/";
- static String shareCode;
- public static Robot robot;
- public static BeamAPI beam;
- TetrisConnector bridge;
- public static void main(String args[]) {
- username = args[0];
- password = args[1];
- channel = Integer.parseInt(args[2]);
- channelId = Integer.parseInt(args[3]);
- shareCode = args[4];
- connectToBeam();
- }
- public static String getUsername() {
- return username;
- }
- public static String getPassword() {
- return password;
- }
- public static int getChannel() {
- return channel;
- }
- public static String getURL() {
- return url;
- }
- protected static void connectToBeam() {
- beam = getBridge().getBeam();
- try {
- robot = getBridge().getRobot(beam).get();
- robot.on(Protocol.Report.class, new MouseMoveListener());
- robot.on(Protocol.Report.class, new KeyPressListener());
- } catch (InterruptedException | ExecutionException e) {
- e.getCause().printStackTrace();
- }
- }
- public static TetrisConnector getBridge() {
- return new TetrisConnector();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement