-
Notifications
You must be signed in to change notification settings - Fork 4
/
AutoCollect.cs
56 lines (44 loc) · 1.5 KB
/
AutoCollect.cs
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
using BrokeProtocol.Collections;
using BrokeProtocol.Entities;
using BrokeProtocol.Utility.Networking;
using BrokeProtocolClient.settings;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BrokeProtocolClient.modules.player
{
class AutoCollect : Module
{
public NumberSetting range = new NumberSetting("Range", 1, 16, 5, 0.5);
public AutoCollect() : base(Categories.Player, "Auto Collect", "Automatically collects items around you")
{
addSetting(range);
}
public override void onActivate()
{
}
public override void onDeactivate()
{
}
public override void onRender()
{
}
public override void onUpdate()
{
if (!getClient().ClManager.myPlayer) return;
foreach (ShEntity item in EntityCollections.Entities)
{
if (getClient().ClManager.myPlayer.Distance(item) > range.getValueFloat()) continue;
if (!getClient().ClManager.myPlayer.CanCollectEntity(item)) continue;
if ((item as ShExplosion).armed) continue;
getClient().ClManager.SendToServer((ENet.PacketFlags)1, SvPacket.Collect, new object[]
{
item.ID,
false
});
}
}
}
}