Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.10 KB | None | 0 0
  1. package a;
  2.  
  3.  
  4. import net.minecraft.client.Minecraft;
  5. import net.minecraft.client.gui.GuiButton;
  6. import net.minecraft.client.gui.GuiScreen;
  7. import net.minecraft.client.gui.GuiTextField;
  8.  
  9. import org.lwjgl.input.Keyboard;
  10. import org.lwjgl.input.Mouse;
  11.  
  12. import cpw.mods.fml.client.config.GuiSlider;
  13.  
  14. public class GUI
  15. extends GuiScreen
  16. {
  17. //id,xPos,yPos,width, height, String prefix, String suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr //
  18. private static GuiSlider velocitySlider = new GuiSlider(0, 50, 0, 125, 20, "", "", 70, 100, 96, false, true);
  19. private static GuiButton velocityToggle = new GuiButton(4, 180, 0, 20, 20, "On");
  20. // id, xpos, ypos, wid, hei, name
  21. private static GuiButton velocityLabel = new GuiButton(1, 8, 0, 0, 20, "KB");
  22. //private static GuiTextField velocBind = new GuiTextField(Minecraft.getMinecraft().fontRenderer, 200, 20, 20, 20);
  23. //5 - 17 cps
  24. private static GuiSlider cpsSlider = new GuiSlider(0, 50, 20, 125, 20, "", "", 5, 17, 8, false, true);
  25. private static GuiButton clickToggle = new GuiButton(4, 180, 20, 20, 20, "On");
  26. private static GuiButton clickLabel = new GuiButton(1,10,20,0,20,"CPS");
  27.  
  28. private static GuiSlider reachSlider = new GuiSlider(0, 50, 40, 125, 20, "", "", 33, 60, 35, false, true);
  29. private static GuiButton reachToggle = new GuiButton(4, 180, 40, 20, 20, "On");
  30. private static GuiButton reachLabel1 = new GuiButton(1,10,40,0,20,"Rea");
  31. private static GuiButton reachLabel2 = new GuiButton(1,25,40,0,20,"ch");
  32.  
  33. private static GuiSlider aimSlider = new GuiSlider(0, 60, 60, 125, 20, "", "", 5, 40, 15, false, true);
  34. private static GuiButton aimToggle = new GuiButton(4, 190, 60, 20, 20, "On");
  35. private static GuiButton aimLabel1 = new GuiButton(1,10,60,0,20,"Aim");
  36. private static GuiButton aimLabel2 = new GuiButton(1,27,60,0,20,"Ass");
  37. private static GuiButton aimLabel3 = new GuiButton(1,43,60,0,20,"ist");
  38.  
  39. private static GuiButton aimDist = new GuiButton(1,10,80,0,20,"Dis");
  40. private static GuiButton aimDist2 = new GuiButton(1,24,80,0,20,"tan");
  41. private static GuiButton aimDist3 = new GuiButton(1,39,80,0,20,"ce:");
  42. private static GuiSlider aimDistSlider = new GuiSlider(0, 60, 80, 125, 20, "", "", 40, 70, 50, false, true);
  43.  
  44. private static GuiButton showGui = new GuiButton(1,10,100,0,20,"Sho");
  45. private static GuiButton showGui2 = new GuiButton(1,27,100,0,20,"w G");
  46. private static GuiButton showGui3 = new GuiButton(1,40,100,0,20,"ui");
  47. private static GuiButton guiToggle = new GuiButton(4, 140, 100, 20, 20, "On");
  48.  
  49.  
  50.  
  51. private static GuiButton dest = new GuiButton(1,10,120,0,20,"Des");
  52. private static GuiButton dest1 = new GuiButton(1,26,120,0,20,"tru");
  53. private static GuiButton dest2 = new GuiButton(1,41,120,0,20,"ct:");
  54. private static GuiButton selfDestruct = new GuiButton(4, 140, 120, 20, 20, "Go");
  55. public static EventManager em;
  56.  
  57.  
  58. public GUI(EventManager em){
  59. this.em = em;
  60. }
  61.  
  62. @Override
  63. public void initGui(){
  64. this.buttonList.add(cpsSlider);
  65. this.buttonList.add(clickToggle);
  66. this.buttonList.add(clickLabel);
  67.  
  68. this.buttonList.add(velocitySlider);
  69. this.buttonList.add(velocityToggle);
  70. this.buttonList.add(velocityLabel);
  71.  
  72. this.buttonList.add(reachSlider);
  73. this.buttonList.add(reachToggle);
  74. this.buttonList.add(reachLabel1);
  75. this.buttonList.add(reachLabel2);
  76.  
  77.  
  78. this.buttonList.add(aimLabel1);
  79. this.buttonList.add(aimLabel2);
  80. this.buttonList.add(aimLabel3);
  81. this.buttonList.add(aimSlider);
  82. this.buttonList.add(aimToggle);
  83.  
  84. this.buttonList.add(aimDist);
  85. this.buttonList.add(aimDist2);
  86. this.buttonList.add(aimDist3);
  87. this.buttonList.add(aimDistSlider);
  88.  
  89. this.buttonList.add(guiToggle);
  90. this.buttonList.add(showGui);
  91. this.buttonList.add(showGui2);
  92. this.buttonList.add(showGui3);
  93.  
  94. this.buttonList.add(dest);
  95. this.buttonList.add(dest1);
  96. this.buttonList.add(dest2);
  97. this.buttonList.add(selfDestruct);
  98. }
  99. @Override
  100. public void drawScreen(int mouseX, int mouseY, float partialTicks){
  101. this.drawDefaultBackground();
  102. super.drawScreen(mouseX, mouseX, partialTicks);
  103. }
  104.  
  105. @Override
  106. public boolean doesGuiPauseGame(){
  107. return true;
  108. }
  109.  
  110. @Override
  111. protected void actionPerformed(GuiButton button) {
  112. if(button == velocityToggle){
  113. toggleVelocity();
  114. }
  115. if(button == clickToggle){
  116. toggleAutoclicker();
  117. }
  118. if(button == reachToggle){
  119. toggleReach();
  120. }
  121. if(button == aimToggle){
  122. toggleAimAssist();
  123. }
  124. if(button == guiToggle){
  125. if(guiToggle.displayString.equalsIgnoreCase("on")){
  126. guiToggle.displayString = "Off";
  127. }else{
  128. guiToggle.displayString = "On";
  129. }
  130. em.toggleOverlay();
  131. }
  132. updateValues();
  133. if(button == selfDestruct){
  134. em.selfDestruct();
  135. }
  136. }
  137.  
  138.  
  139. public static void updateValues() {
  140. em.getAutoclicker().updateCps();
  141. em.getReach().updateReach();
  142. em.getVelocity().updateVelocity();
  143. em.getAimAssist().updateAimAssist();
  144. }
  145. public static double getReach(){
  146.  
  147. return reachSlider.getValueInt()/10D;
  148. }
  149.  
  150. public static int getCps(){
  151.  
  152. return cpsSlider.getValueInt();
  153. }
  154.  
  155. public static int getVelocity(){
  156.  
  157. return velocitySlider.getValueInt();
  158. }
  159.  
  160. public static double getAimAssist(){
  161. return aimSlider.getValueInt()/10D;
  162. }
  163.  
  164. @Override
  165. public void onGuiClosed() {
  166. updateValues();
  167. super.onGuiClosed();
  168. }
  169.  
  170. public static void toggleVelocity(){
  171. em.getVelocity().toggle();
  172. if(velocityToggle.displayString.equalsIgnoreCase("on")){
  173. velocityToggle.displayString = "Off";
  174. }else{
  175. velocityToggle.displayString = "On";
  176. }
  177. }
  178.  
  179. public static void toggleAutoclicker(){
  180. if(clickToggle.displayString.equalsIgnoreCase("on")){
  181. clickToggle.displayString = "Off";
  182. }else{
  183. clickToggle.displayString = "On";
  184. if(Mouse.isButtonDown(0)){
  185. em.getAutoclicker().reset();
  186. }
  187. }
  188. em.getAutoclicker().toggle();
  189. }
  190.  
  191. public static void toggleReach(){
  192. if(reachToggle.displayString.equalsIgnoreCase("on")){
  193. reachToggle.displayString = "Off";
  194. }else{
  195. reachToggle.displayString = "On";
  196. }
  197. em.getReach().toggle();
  198. }
  199.  
  200. public static void toggleAimAssist(){
  201. if(aimToggle.displayString.equalsIgnoreCase("on")){
  202. aimToggle.displayString = "Off";
  203. }else{
  204. aimToggle.displayString = "On";
  205. }
  206. em.getAimAssist().toggle();
  207. }
  208.  
  209. public static double getDist() {
  210. return aimDistSlider.getValueInt()/10;
  211. }
  212.  
  213. public static void destroy() {
  214. if(Minecraft.getMinecraft().currentScreen instanceof GUI){
  215. Minecraft.getMinecraft().setIngameFocus();
  216. }
  217. velocitySlider = null;
  218. velocityLabel = null;
  219. velocityToggle = null;
  220.  
  221. cpsSlider = null;
  222. clickLabel = null;
  223. clickToggle = null;
  224.  
  225. reachSlider = null;
  226. reachLabel1 = null;
  227. reachLabel2 = null;
  228. reachToggle = null;
  229.  
  230. aimDist = null;
  231. aimDist3 = null;
  232. aimDist2 = null;
  233. aimDistSlider = null;
  234.  
  235. aimLabel1 = null;
  236. aimLabel2 = null;
  237. aimLabel3 = null;
  238. aimSlider = null;
  239. aimToggle = null;
  240.  
  241. showGui = null;
  242. showGui2 = null;
  243. showGui3 = null;
  244. guiToggle = null;
  245.  
  246. dest = null;
  247. dest1 = null;
  248. dest2 = null;
  249. selfDestruct = null;
  250. }
  251.  
  252. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement