-
Notifications
You must be signed in to change notification settings - Fork 4
/
Spinbot.cs
64 lines (48 loc) · 1.75 KB
/
Spinbot.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
using BrokeProtocol.Utility.Networking;
using BrokeProtocolClient.settings;
using ENet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace BrokeProtocolClient.modules.combat
{
class Spinbot : Module
{
public NumberSetting rotationSpeed = new NumberSetting("Rotation speed", -360, 360, 0, 1);
public BooleanSetting lookDown = new BooleanSetting("Look down", false);
Quaternion rotation;
public Spinbot() : base(Categories.Combat, "Spinbot", "Spins your player")
{
addSetting(rotationSpeed);
addSetting(lookDown);
}
public override void onActivate()
{
if (!getClient().ClManager.myPlayer) return;
rotation = getClient().ClManager.myPlayer.GetRotation;
}
public override void onUpdate()
{
if (!getClient().ClManager.myPlayer) return;
Vector3 eulerAngles = rotation.eulerAngles;
eulerAngles.y += rotationSpeed.getValueInt() * Time.deltaTime;
Log($"Rotation speed: {rotationSpeed.getValueInt() * Time.deltaTime}");
if (lookDown.isEnabled())
eulerAngles.x = 90.1f;
else
eulerAngles.x = getClient().ClManager.myPlayer.GetRotation.eulerAngles.x;
rotation = Quaternion.Euler(eulerAngles);
}
public override bool onSendToServer(PacketFlags channel, SvPacket packet, params object[] args)
{
return true;
}
public bool ShouldIgnoreRotationUpdate()
{
return true;
}
}
}