-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helper.js
154 lines (129 loc) · 4.28 KB
/
Helper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/** @author XLittleLeft#7638, ezMatt#9161 */
module = script.registerModule("Helper",COMBAT);
module.addBooleanProperty("speed_helper","SpeedHelper",true);
module.addBooleanProperty("anti_void","BetterAntiVoid",false);
module.addDoubleProperty("set_delay","AntiVoidDelay",1000.0,1000.0,3000.0,10.0);
module.addBooleanProperty("army","MakeArmy",false);
module.addDoubleProperty("army_delay","ArmyDelay",1000.0,10.0,5000.0,10.0);
module.addBooleanProperty("iq_booster","IQBooster",true);
module.addBooleanProperty("debug","Debug",false);
var timer = timer_util.getTimer();
var voidtimer = timer_util.getTimer();
var speed_flag = false;
var hide = true;
var packets = [];
var x, y, z;
function printInfo2(text) {
client.print("\u00A7dX-Helper -> \u00A7c" + text + "\u00A7f");
};
function printInfo(text) {
client.print("\u00A7dX-Helper -> \u00A7b" + text + "\u00A7f");
};
module.onEvent("playerPreUpdateEvent",function(event){
if (module.getProperty("speed_helper").getBoolean()) {
if (client.isEnabled("Speed")) {
if (client.isEnabled("Step")) {
speed_flag = true;
client.toggleModule("Step");
printInfo2("Disabled Step");
}
} else if (speed_flag) {
client.toggleModule("Step");
printInfo("Enabled Step");
speed_flag = false;
}
}
if (module.getProperty("army").getBoolean()) {
if (timer.delay(module.getProperty("army_delay").getLong())) {
client.toggleModule("Blink");
timer.reset();
}
if (hide) {
player.sendMessage(".hide Blink");
hide = false;
}
}
if (module.getProperty("anti_void").getBoolean()) {
if (client.isEnabled("AntiVoid")) {
client.toggleModule("AntiVoid");
}
if(player.ticksExisted() === 0) {
voidtimer.reset();
}
}
});
module.onEvent("packetSendEvent", function(event) {
if (module.getProperty("anti_void").getBoolean()) {
try {
var packet = event.getPacket();
if(isC03(packet)) {
if(packet.isOnGround()) {
if(packet.getName() != "0x03" && packet.getName() != "0x05") {
x = packet.getX();
y = packet.getY();
z = packet.getZ();
if (module.getProperty("debug").getBoolean()) {
client.print(x, y, z)
}
}
voidtimer.reset();
} else if(overVoid()) {
event.setCancelled(true);
packets.push[packet]
if(voidtimer.delay(module.getProperty("set_delay").getDouble()) && player.motionY < 0) {
player.setPosition(x, y, z);
packets = [];
}
}
if(packet.isOnGround() || !overVoid()) {
if(packets.length > 0) {
for(var i = 0; i < packets.length; i++) {
switch(p.getName()) {
case "0x03": {
connection.sendPacketNoEvent("0x03", p.isOnGround());
}
case "0x04": {
connection.sendPacketNoEvent("0x04", p.getX(), p.getY(), p.getZ(), p.isOnGround());
}
case "0x05": {
connection.sendPacketNoEvent("0x05", p.getYaw(), p.getPitch(), p.isOnGround());
}
case "0x06": {
connection.sendPacketNoEvent("0x06", p.getX(), p.getY(), p.getZ(), p.getYaw(), p.getPitch(), p.isOnGround());
}
}
}
packets = [];
}
}
}
} catch (e) {
client.print(e.message)
}
}
});
module.onEvent("enable",function(event){
printInfo("Thanks for use XLittleLeft & ezMatt's js");
});
module.onEvent("disable",function(event){
printInfo("UnLoad Successfully")
timer.reset();
voidtimer.reset();
});
function isC03(packet) {
return (packet.getName() == "0x03" || packet.getName() == "0x04" || packet.getName() == "0x05" || packet.getName() == "0x06")
};
function overVoid() {
for(var i = 0; i < player.getY(); i++) {
if(blockName(player.getX(), i, player.getZ()) != "tile.air") {
return false;
}
}
return true;
};
function blockName(x_p,y_p,z_p) {
return world.getBlockName(world.getBlockAtBlockPos(BlockPos(x_p,y_p,z_p)))
};
function BlockPos(ix, iy, iz) {
return world.getBlockPos(ix < 0 ? ix - 1 : ix, iy, iz < 0 ? iz - 1 : iz);
};