-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntityFeedScript.cs
More file actions
70 lines (57 loc) · 1.95 KB
/
EntityFeedScript.cs
File metadata and controls
70 lines (57 loc) · 1.95 KB
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
//MCCScript 1.0
MCC.LoadBot(new EntityFeedBot());
//MCCScript Extensions
public class EntityFeedBot : ChatBot
{
private bool hasFed = false;
private int feedPerMinion = 4;
public override void Initialize()
{
LogToConsole("========================================");
LogToConsole("[EntityFeed] Bot yuklendi!");
LogToConsole("[EntityFeed] Her minyon " + feedPerMinion + " kez beslenecek");
LogToConsole("========================================");
}
public override void Update()
{
if (!hasFed)
{
hasFed = true;
FeedAllArmorStands();
LogToConsole("[EntityFeed] Islem tamamlandi, bot kapaniyor...");
UnloadBot();
}
}
private void FeedAllArmorStands()
{
System.Collections.Generic.Dictionary<int, Entity> entities = GetEntities();
if (entities == null || entities.Count == 0)
{
LogToConsole("[EntityFeed] Hic entity bulunamadi!");
return;
}
int fedCount = 0;
foreach (System.Collections.Generic.KeyValuePair<int, Entity> kvp in entities)
{
Entity entity = kvp.Value;
if (entity.Type == EntityType.ArmorStand)
{
int entityId = kvp.Key;
for (int i = 0; i < feedPerMinion; i++)
{
PerformInternalCommand("entity " + entityId + " use");
}
LogToConsole("[EntityFeed] #" + entityId + " - " + feedPerMinion + " kez beslendi");
fedCount++;
}
}
if (fedCount > 0)
{
LogToConsole("[EntityFeed] Toplam " + fedCount + " minyon, her biri " + feedPerMinion + " kez beslendi!");
}
else
{
LogToConsole("[EntityFeed] Yakinlarda Armor Stand bulunamadi!");
}
}
}