-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBotSpammer.cs
151 lines (112 loc) · 4.21 KB
/
BotSpammer.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
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
using BrokeProtocolClient.settings;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace BrokeProtocolClient.modules.exploit.botter
{
class BotSpammer : Module
{
BotManager manager;
ModeSetting mode;
BooleanSetting randomServer = new BooleanSetting("Join random server", false);
InputSetting hostName = new InputSetting("Host name", 15, "127.0.0.1");
InputSetting port = new InputSetting("Port", 5, "5557");
ActionSetting current;
BooleanSetting randomName = new BooleanSetting("Random name (lenght of \"Name\")", true);
InputSetting name = new InputSetting("Name", 16, "NotABot");
NumberSetting messageAmount = new NumberSetting("Amount of messages", 1, 8, 8, 1);
InputSetting message = new InputSetting("Message on join", 64, "BPclient on top!");
ActionSetting start;
ActionSetting remove;
ActionSetting login;
ActionSetting register;
public BotSpammer() : base(Categories.Exploit, "Bot spammer", "Allows to spam bots")
{
manager = new BotManager();
mode = new ModeSetting("Mode", BotManager.Mode.Auto);
mode.SetOnChanged(() => manager.SetMode((BotManager.Mode)mode.getMode()));
addSetting(mode);
addSetting(randomServer);
addSetting(hostName);
addSetting(port);
current = new ActionSetting("Set current server", Current);
addSetting(current);
addSetting(randomName);
addSetting(name);
start = new ActionSetting("Start", Start);
addSetting(start);
addSetting(messageAmount);
addSetting(message);
login = new ActionSetting("Login", Login);
addSetting(login);
register = new ActionSetting("Register", Register);
addSetting(register);
remove = new ActionSetting("Remove bot", Remove);
addSetting(remove);
}
public override void onActivate()
{
}
public override void onDeactivate()
{
}
public override void onRender()
{
}
public override void onUpdate()
{
}
public void Start()
{
string username = randomName.isEnabled() ? utils.Utils.RandomString(name.getValue().Length) : name.getValue();
string password = utils.Utils.RandomString(16);
string deviceID = utils.Utils.RandomString(SystemInfo.deviceUniqueIdentifier.Length);
Bot bot = new Bot(username, password, 0, 0, deviceID, "");
bot.addOnJoinAction(
new Action(() =>
{
Client.instance.StartCoroutine(SpamThread(bot));
}
));
if (randomServer.isEnabled())
{
manager.ConnectRandomServer(bot);
}
else
{
manager.AddBot(bot, hostName.getValue(), ushort.Parse(port.getValue()));
}
}
private void Current()
{
bool inGame = getClient().ClManager != null;
hostName.setValue(inGame ? getClient().ClManager.connection.IP : "");
port.setValue(inGame ? getClient().ClManager.connection.Port.ToString() : "");
}
private void Login()
{
manager.LoginAll();
}
private void Register()
{
manager.RegisterAll();
}
private void Remove()
{
manager.DisconnectAll();
}
private IEnumerator SpamThread(Bot bot)
{
for (int i = 0; i < messageAmount.getValueInt(); i++)
{
bot.SendGlobalMessage(message.getValue());
}
yield return new WaitForSeconds(0.5f);
manager.DisconnectByName(bot.username);
}
}
}