Advertisement
Guest User

Untitled

a guest
Feb 4th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. package me.myiume.dota2interactive;
  2.  
  3. import java.util.concurrent.ExecutionException;
  4.  
  5. import me.myiume.dota2interactive.api.TetrisConnector;
  6. import me.myiume.dota2interactive.listeners.KeyPressListener;
  7. import me.myiume.dota2interactive.listeners.MouseMoveListener;
  8. import pro.beam.api.BeamAPI;
  9. import pro.beam.interactive.net.packet.Protocol;
  10. import pro.beam.interactive.robot.Robot;
  11.  
  12. public class Dota2Interactive {
  13.  
  14. static String username;
  15. static String password;
  16. static int channel;
  17. static int channelId;
  18. static String url = "https://beam.pro/api/v1/";
  19.  
  20. static String shareCode;
  21. public static Robot robot;
  22. public static BeamAPI beam;
  23. TetrisConnector bridge;
  24.  
  25. public static void main(String args[]) {
  26.  
  27. username = args[0];
  28. password = args[1];
  29. channel = Integer.parseInt(args[2]);
  30. channelId = Integer.parseInt(args[3]);
  31. shareCode = args[4];
  32.  
  33. connectToBeam();
  34. }
  35.  
  36. public static String getUsername() {
  37. return username;
  38. }
  39.  
  40. public static String getPassword() {
  41. return password;
  42. }
  43.  
  44. public static int getChannel() {
  45. return channel;
  46. }
  47.  
  48. public static String getURL() {
  49. return url;
  50. }
  51.  
  52. protected static void connectToBeam() {
  53. beam = getBridge().getBeam();
  54.  
  55. try {
  56. robot = getBridge().getRobot(beam).get();
  57. robot.on(Protocol.Report.class, new MouseMoveListener());
  58. robot.on(Protocol.Report.class, new KeyPressListener());
  59. } catch (InterruptedException | ExecutionException e) {
  60. e.getCause().printStackTrace();
  61. }
  62.  
  63. }
  64.  
  65. public static TetrisConnector getBridge() {
  66. return new TetrisConnector();
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement