Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.00 KB | None | 0 0
  1. var logs = '';
  2.  
  3. // minified libs (takes less space and works/should work faster than normal libs + not needed to import them), minified using https://javascript-minifier.com/
  4. //string funcs
  5. String.prototype.includes = function (t, e) { "use strict"; return "number" != typeof e && (e = 0), !(e + t.length > this.length) && -1 !== this.indexOf(t, e) };
  6. //gl funcs
  7. var GL11 = Java.type("org.lwjgl.opengl.GL11"); function drawRect(L, G, l, g, _) { var e = (_ >> 24 & 255) / 255, a = (_ >> 16 & 255) / 255, E = (_ >> 8 & 255) / 255, r = (255 & _) / 255; GL11.glEnable(GL11.GL_BLEND), GL11.glDisable(GL11.GL_TEXTURE_2D), GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA), GL11.glEnable(GL11.GL_LINE_SMOOTH), GL11.glPushMatrix(), GL11.glColor4f(a, E, r, e), GL11.glBegin(GL11.GL_TRIANGLE_FAN), GL11.glVertex2d(l, G), GL11.glVertex2d(L, G), GL11.glVertex2d(L, g), GL11.glVertex2d(l, g), GL11.glEnd(), GL11.glPopMatrix(), GL11.glEnable(GL11.GL_TEXTURE_2D), GL11.glDisable(GL11.GL_BLEND), GL11.glDisable(GL11.GL_LINE_SMOOTH), GL11.glColor4f(1, 1, 1, 1) } function drawCircle(L, G, l, g) { var _ = (g >> 24 & 255) / 255, e = (g >> 16 & 255) / 255, a = (g >> 8 & 255) / 255, E = (255 & g) / 255; GL11.glColor4f(e, a, E, _), GL11.glEnable(GL11.GL_BLEND), GL11.glDisable(GL11.GL_TEXTURE_2D), GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA), GL11.glEnable(GL11.GL_LINE_SMOOTH), GL11.glPushMatrix(), GL11.glLineWidth(1), GL11.glBegin(GL11.GL_POLYGON); for (var r = 0; r <= 360; r++)GL11.glVertex2d(L + Math.sin(r * Math.PI / 180) * l, G + Math.cos(r * Math.PI / 180) * l); GL11.glEnd(), GL11.glPopMatrix(), GL11.glEnable(GL11.GL_TEXTURE_2D), GL11.glDisable(GL11.GL_BLEND), GL11.glDisable(GL11.GL_LINE_SMOOTH), GL11.glColor4f(1, 1, 1, 1) };
  8. //http funcs
  9. function httpGet(e) { var t = new java.net.URL(e).openConnection(); return t.requestMethod = "GET", asResponse(t) } function httpPost(e, t, n) { n = n || "application/json"; var a = new java.net.URL(e).openConnection(); return a.requestMethod = "POST", a.setRequestProperty("Content-Type", n), a.doOutput = !0, write(a.outputStream, t), asResponse(a) } function asResponse(e) { return { data: read(e.inputStream), statusCode: e.responseCode } } function write(e, t) { var n = new java.io.DataOutputStream(e); n.writeBytes(t), n.flush(), n.close() } function read(e) { for (var t, n = new java.io.BufferedReader(new java.io.InputStreamReader(e)), a = new java.lang.StringBuffer; null != (t = n.readLine());)a.append(t); return n.close(), a.toString() };
  10. //mc utils
  11. var globalScope = this, KeyBinding = Java.type("net.minecraft.client.settings.KeyBinding"), EnumFacing = Java.type("net.minecraft.util.EnumFacing"), Vec3 = Java.type("net.minecraft.util.Vec3"), minecraftUtils = function () { var e = {}, n = function (n) { var t; return !("string" != typeof n || !e.hasOwnProperty(n)) && (t = e[n][1], globalScope.hasOwnProperty(n) && globalScope[n] instanceof KeyBinding && globalScope[n].setKeyCode(0), e[n][0].setKeyCode(t), delete e[n], KeyBinding.resetKeyBindingArrayAndHash(), !0) }; return { hookKeyBind: function (t, o) { var i; if (!(t instanceof KeyBinding) || "string" != typeof o) return !1; globalScope.hasOwnProperty(o) && globalScope[o] instanceof KeyBinding || (globalScope[o] = new KeyBinding("key.hook_" + o, 0, "key.categories.misc")), e.hasOwnProperty(o) && n(o); for (var r = Object.keys(e), a = 0; a < r.length; a++)if (e[r[a]][0] == t) { n(r[a]); break } return 0 == (i = t.getKeyCode()) && (i = t.getKeyCodeDefault()), t.setKeyCode(0), globalScope[o].setKeyCode(i), e[o] = [t, i], KeyBinding.resetKeyBindingArrayAndHash(), !0 }, unhookKeyBind: n, unhookAllKeyBinds: function () { for (var t = Object.keys(e), o = 0; o < t.length; o++)n(t[o]); return !0 } } }(); function hookKeyBind(e, n) { return minecraftUtils.hookKeyBind(e, n) } function unhookKeyBind(e) { return minecraftUtils.unhookKeyBind(e) } function unhookAllKeyBinds() { return minecraftUtils.unhookAllKeyBinds() } function getCenterOfBlockSide(e, n) { var t = new Vec3(e).addVector(.5, .5, .5), o = new Vec3(n.getDirectionVec()); return t.addVector(.5 * o.xCoord, .5 * o.yCoord, .5 * o.zCoord) } function isBlockInReach(e, n) { var t = mc.playerController.getBlockReachDistance() + .25, o = e.getPositionEyes(1), i = getCenterOfBlockSide(n, getClosestBlockSide(o, n)); return o.distanceTo(i) <= t } function getClosestBlockSide(e, n) { var t, o, i, r, a, c = null; for (a in EnumFacing.values()) o = getCenterOfBlockSide(n, t = EnumFacing.values()[a]), i = e.distanceTo(o), (null == c || i < c) && (c = i, r = t); return r };
  12. //timing funcs
  13. var Timer = Java.type("java.util.Timer"); function setInterval(e, n) { var t = new Timer("setInterval", !0); return t.schedule(function () { e() }, n, n), t } function clearInterval(e) { e.cancel() } function setTimeout(e, n) { var t = new Timer("setTimeout", !0); return t.schedule(function () { e() }, n), t } function clearTimeout(e) { e.cancel() };
  14. //system funcs
  15. var StringSelection = Java.type("java.awt.datatransfer.StringSelection"), ScaledResolution = Java.type("net.minecraft.client.gui.ScaledResolution"), Toolkit = Java.type("java.awt.Toolkit"); function copyToClipboard(t) { var e = new StringSelection(t); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(e, null) } function getScaledWidth() { return new ScaledResolution(mc).getScaledWidth() } function getScaledHeight() { return new ScaledResolution(mc).getScaledHeight() };
  16. //math funcs
  17. Math.trunc = function (t) { return (t = +t) - t % 1 || (isFinite(t) && 0 !== t ? t < 0 ? -0 : 0 : t) }, Math.toRadians = function (t) { return t * Math.PI / 180 }, Math.toDegrees = function (t) { return 180 * t / Math.PI };
  18.  
  19. function createBoolean(text, state) {
  20. State = state;
  21. if (state !== true && state !== false) {
  22. logs += ('\n\u00A78Error found when creating \u00A7eBOOLEAN \u00A78 problem happened with statement:' + text);
  23. State = false;
  24. }
  25. return value.createBoolean(text, State);
  26. };
  27. function createText(text, text2) {
  28. return value.createText(text.toString(), text2.toString());
  29. };
  30. function createInteger(text, default_value, minimal_value, maximal_value) {
  31. if ((!isFinite(default_value) || !isFinite(minimal_value) || !isFinite(maximal_value))) logs += ('\n\u00A78Error found when creating \u00A7cINTEGER \u00A78 problem happened with integer:' + text);
  32. return value.createInteger(text, isFinite(default_value) ? default_value : 0, isFinite(minimal_value) ? minimal_value : 0, isFinite(maximal_value) ? maximal_value : 0);
  33. };
  34. function createFloat(text, default_value, minimal_value, maximal_value) {
  35. if ((!isFinite(default_value) || !isFinite(minimal_value) || !isFinite(maximal_value))) logs += ('\n\u00A78Error found when creating \u00A7dFLOAT \u00A78 problem happened with float:' + text);
  36. return value.createFloat(text, isFinite(default_value) ? default_value : 0, isFinite(minimal_value) ? minimal_value : 0, isFinite(maximal_value) ? maximal_value : 0);
  37. };
  38. function createList(text, array, default_value) {
  39. if (Array.isArray(array) && array.indexOf(default_value) <= -1) logs += ('\n\u00A78Error found when creating \u00A7dLIST \u00A78 problem happened with default_value:' + text);
  40. if (!Array.isArray(array)) logs += ('\n\u00A78Error found when creating \u00A7dLIST \u00A78 problem happened with array:' + text);
  41. return value.createList(text, Array.isArray(array) ? array : [''], Array.isArray(array) ? default_value : '');
  42. };
  43. function category(category) {
  44. if (~["combat", "movement", "player", "exploit", "fun"].indexOf(category.toLowerCase())) return category;
  45. logs += ('\n\u00A78Error found in \u00A7dSCRIPT CATEGORY \u00A78 category given:\u00A7c ' + category + ' \u00A78replaced with \u00A7a Fun');
  46. return 'Fun';
  47. };
  48. function description(description) {
  49. if (description == undefined || description == null) return '';
  50. return description;
  51. };
  52. function tag(tag, animated) {
  53. Tag = tag;
  54. if (animated == undefined || animated == null) {
  55. logs += ('\n\u00A78Error found in \u00A7dSCRIPT TAG\u00A78 animation bool given:\u00A7c ' + animated.toString() + ' \u00A78replaced with \u00A7a false');
  56. animated = false;
  57. }
  58. if (Tag == undefined || Tag == null) {
  59. logs += ('\n\u00A78Error found in \u00A7dSCRIPT TAG \u00A78 tag given:\u00A7c ' + tag.toString() + ' \u00A78replaced with \u00A7a');
  60. return '';
  61. }
  62. if (animated) {
  63. if (mc.thePlayer.ticksExisted % 5 == 0) {
  64. Tag = ">" + tag + "<";
  65. } else {
  66. Tag = "<" + tag + ">";
  67. }
  68. } else {
  69. Tag = tag;
  70. };
  71. return Tag;
  72. };
  73. function name(name) {
  74. if (name == undefined || name == null || name == '') {
  75. logs += ('\n\u00A78Error found in \u00A7dSCRIPT NAME \u00A78 name given:\u00A7c ' + name.toString() + ' \u00A78replaced with \u00A7aturtlBaseScript');
  76. return 'turtlBaseScript';
  77. }
  78. return name;
  79. };
  80. function getSpeed(entity) {
  81. return Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ);
  82. };
  83. function getMoveYaw() {
  84. var moveYaw = mc.thePlayer.rotationYaw;
  85. if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing == 0) {
  86. moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
  87. } else if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing != 0) {
  88. if (mc.thePlayer.moveForward > 0)
  89. moveYaw += mc.thePlayer.moveStrafing > 0 ? -45 : 45;
  90. else
  91. moveYaw -= mc.thePlayer.moveStrafing > 0 ? -45 : 45;
  92.  
  93. moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
  94. } else if (mc.thePlayer.moveStrafing != 0 && mc.thePlayer.moveForward == 0) {
  95. moveYaw += mc.thePlayer.moveStrafing > 0 ? -90 : 90;
  96. }
  97. return moveYaw;
  98. };
  99. function setSpeed(speed, strafe) {
  100. if (!mc.thePlayer.moveForward && !mc.thePlayer.moveStrafing) return;
  101. if (mc.thePlayer.onGround || (strafe && !mc.thePlayer.onGround)) {
  102. var yaw = getMoveYaw();
  103. mc.thePlayer.motionX = -Math.sin(Math.toRadians(yaw)) * speed;
  104. mc.thePlayer.motionZ = Math.cos(Math.toRadians(yaw)) * speed;
  105. }
  106. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement